Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libbpf-cargo: escape map names #750

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

eliad-wiz
Copy link
Contributor

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)

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 <[email protected]>
Copy link
Collaborator

@danielocfb danielocfb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good catch, thanks! The replace in the one path was really only intended for the first separator, which is always present. I figured we would not allow additional special characters in the rest. Alas...

@danielocfb danielocfb merged commit 8fd6424 into libbpf:master Apr 1, 2024
12 checks passed
@eliad-wiz eliad-wiz deleted the fix-map-name-escape branch April 2, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants