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

build/elf: handle SHT_RELR sections #744

Closed
wants to merge 1 commit into from

Conversation

fg-scontain
Copy link

Hi, I was using the elf builder with a binary from alpine 3.20. Apparently, that binary uses relative relocations (#722). The following changes made the builder accept the binary.

@@ -227,7 +227,7 @@ impl<'data> Builder<'data> {
| elf::SHT_LLVM_DEPENDENT_LIBRARIES => {
SectionData::Data(section.data(endian, data)?.into())
}
elf::SHT_REL | elf::SHT_RELA => relocations,
elf::SHT_REL | elf::SHT_RELA | elf::SHT_RELR => relocations,
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem correct because we don't currently parse SHT_RELR relocations, so relocations will be empty.

@philipc
Copy link
Contributor

philipc commented Nov 21, 2024

I think it's best to add full support for SHT_RELR to the crate instead of trying to do a minimal patch for the build/elf. I've started working on this.

@philipc philipc mentioned this pull request Nov 29, 2024
@philipc philipc closed this in #746 Dec 1, 2024
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