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

elf2flt: xtensa: fix text relocations #30

Merged

Conversation

gregungerer
Copy link
Contributor

The commit 5e08f19 ("Don't always update text in !pic_with_got case") changed good_32bit_resolved_reloc to not do endianness swapping for relocated entries in the text segment. This broke little-endian xtensa FLAT images which after this change fail to start with the following message:

binfmt_flat: reloc outside program 0x24c80100 (0 - 0x6e430/0x56a20)

Fix it by preserving 'update_text' when building for xtensa.

This fix is a modified version of an original fix by Max Filippov [email protected]. This commit message was his, though his Signed-off-by has been dropped due to it being a different fix.

The relocation code is used "as-is" but a different entry path into it ensures that "update_text" is not cleared for Xtensa.

Fixes: 5e08f19 ("Don't always update text in !pic_with_got case")
Reported-by: Niklas Cassel [email protected]

The commit 5e08f19 ("Don't always update text in !pic_with_got case")
changed good_32bit_resolved_reloc to not do endianness swapping for
relocated entries in the text segment. This broke little-endian xtensa
FLAT images which after this change fail to start with the following
message:

  binfmt_flat: reloc outside program 0x24c80100 (0 - 0x6e430/0x56a20)

Fix it by preserving 'update_text' when building for xtensa.

This fix is a modified version of an original fix by Max Filippov
<[email protected]>. This commit message was his, though his
Signed-off-by has been dropped due to it being a different fix.

The relocation code is used "as-is" but a different entry path
into it ensures that "update_text" is not cleared for Xtensa.

Fixes: 5e08f19 ("Don't always update text in !pic_with_got case")
Reported-by: Niklas Cassel <[email protected]>
Signed-off-by: Greg Ungerer <[email protected]>
@gregungerer gregungerer merged commit 26dfb54 into uclinux-dev:main Sep 6, 2023
1 check passed
@gregungerer gregungerer deleted the gregungerer/xtensa-relocation branch September 6, 2023 11:32
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.

1 participant