Skip to content

Why does my eBPF program contain an .rodata map? #592

Answered by ti-mo
OrangeGzY asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @OrangeGzY, thanks for your question. Please refrain from creating issues and marking them as bugs, this is not the case here.

An .rodata section generally shows up when declaring and initializing global constants, but declaring any kind of string in your program often has the same effect.

The library exposes data sections as e.g. an .rodata map after loading to allow their contents to be modified before loading them into the kernel. As you've noticed, this can be somewhat surprising for newcomers. This feature requires kernel support, which only landed as of 5.2, which the error message is pretty clear about.

Today, there are a few ways to inspect the contents of a data section. One o…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@OrangeGzY
Comment options

Answer selected by OrangeGzY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #591 on March 07, 2022 13:10.