Victor Campos 501c77da60
[LLD][ELF][ARM] Fix resolution of R_ARM_THM_JUMP8 and R_ARM_THM_JUMP11 for big endian (#126933)
These relocations apply to 16-bit Thumb instructions, so reading 16 bits
rather than 32 bits ensures the correct bits are masked and written
back. This fixes the incorrect masking and aligns the relocation logic
with the instruction encoding.

Before this patch, 32 bits were read from the ELF object. This did not
align with the instruction size of 16 bits, but the masking incidentally
made it all work nonetheless. However, this was the case only in little
endian.

In big endian mode, the read 32-bit word had to have its bytes reversed.
With this byte reordering, the masking would be applied to the wrong
bits, hence causing the incorrect encoding to be produced as a result of
the relocation resolution.

The added test checks the result for both little and big endian modes.
2025-02-17 10:10:35 +00:00
..
2024-10-05 09:37:27 -07:00
2024-10-06 00:31:51 -07:00
2024-11-14 22:17:10 -08:00
2024-10-10 22:22:25 -07:00
2024-09-29 14:45:00 -07:00
2025-01-03 09:38:04 -08:00
2024-09-29 15:39:52 -07:00
2024-09-29 15:32:16 -07:00
2024-10-11 23:34:43 -07:00

See docs/NewLLD.rst