Skip to content

Commit 5613de1

Browse files
committed
libbpf-cargo: escape map names
commit 51ffd0f added support for custom sections. this broke skeleton generation when bpf_printk() was used along with BPF_NO_GLOBAL_DATA, as e.g. the map '.rodata.str1.1' contains invalid chars. add simple escaping to the map name as well (similar to the one used for the section name) Signed-off-by: Eliad Peller <eliad.peller@wiz.io>
1 parent 51ffd0f commit 5613de1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libbpf-cargo/src/gen/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ fn gen_skel_map_defs(
366366

367367
for map in MapIter::new(object.as_mut_ptr()) {
368368
let map_name = match get_map_name(map)? {
369-
Some(n) => n,
369+
Some(n) => n.replace('.', "_"),
370370
None => continue,
371371
};
372372

0 commit comments

Comments
 (0)