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

elf_reader: Allow strings read-only global data sections #742

Merged
merged 1 commit into from Jul 22, 2022

Conversation

dylandreimerink
Copy link
Member

In the past we had the limitation that string sections like
.rodata.str1.1 could not not be loaded since clang/LLVM doesn't
provide BTF information for such sections. In #675 we lifted the
requirement to have BTF information for global data sections. This means
that we can now also allow string sections to be loaded as global data.

All facilities to do so are already in place, this commit just removes
the check for references to sections with the SHF_STRINGS flag set.

Fixes: #741
Signed-off-by: Dylan Reimerink dylan.reimerink@isovalent.com

@dylandreimerink dylandreimerink marked this pull request as ready for review July 20, 2022 15:05
@dylandreimerink dylandreimerink requested review from ti-mo and lmb and removed request for ti-mo July 20, 2022 15:05
ti-mo
ti-mo previously requested changes Jul 20, 2022
Copy link
Collaborator

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

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

Thanks! Could we also try to load these on kernels that support them?

elf_reader_test.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@lmb lmb left a comment

Choose a reason for hiding this comment

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

Nice!

In the past we had the limitation that string sections like
`.rodata.str1.1` could not not be loaded since clang/LLVM doesn't
provide BTF information for such sections. In cilium#675 we lifted the
requirement to have BTF information for global data sections. This means
that we can now also allow string sections to be loaded as global data.

All facilities to do so are already in place, this commit just removes
the check for references to sections with the `SHF_STRINGS` flag set.

Fixes: cilium#741
Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
@lmb lmb dismissed ti-mo’s stale review July 22, 2022 16:54

Comments were addressed

@lmb lmb merged commit e291bf2 into cilium:master Jul 22, 2022
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.

Load string sections as global data maps
3 participants