elf2flt: xtensa: fix text relocations #30
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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]