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

Fix #150 - Check ELF endianness before writing new runpath #151

Conversation

UraniumKnight
Copy link

This pull request makes a change to the way the RUNPATH field is updated in the dynamic section. Currently, patchelf does not take into account the target architecture of the ELF file before doing this (when --make-rpath-relative is specified). Thus, the elf file ends up having an invalid tag for RUNPATH if the endianness differs. (0x1d000000 instead of 0x0000001d).

The change proposed here updates the way these fields are written using the already defined endian-safe functions. Tested on both PowerPC and ARM targets with a x86_64 host.

This commit modifies the way fields are written in the dynamic
section in order to account the architecture of the target ELF
file. Instead of copying the raw data, use the helper functions
to convert endianness.

Signed-off-by: Bryce Ferguson <bryce.ferguson@rockwellcollins.com>
@domenkozar
Copy link
Member

@UraniumKnight there are conflicts now, is this PR still needed on master?

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.

None yet

3 participants