Page MenuHomePhabricator

[ELF] -r: fix R_*_NONE to section symbols on Elf*_Rel targets

Authored by MaskRay on May 16 2019, 11:20 PM.



On Elf*_Rel targets, for a relocation to a section symbol, an R_ABS is
added to compute the implicit addend which will be applied in the
relocated location.

Addends of R_*_NONE should be ignored, so don't emit an R_ABS.

This fixes crashes on X86 and ARM (their relocateOne() do not handle

Diff Detail

rLLD LLVM Linker

Event Timeline

MaskRay created this revision.May 16 2019, 11:20 PM
peter.smith accepted this revision.May 17 2019, 1:46 AM

LGTM. The addend in a R_*_NONE relocation is not meaningful anyway as the relocation is never resolved to a value.

This revision is now accepted and ready to land.May 17 2019, 1:46 AM
MaskRay updated this revision to Diff 200027.May 17 2019, 5:56 AM
MaskRay retitled this revision from [ELF] -r: fix R_*_NONE on Elf*_Rel targets to [ELF] -r: fix R_*_NONE to section symbols on Elf*_Rel targets.
MaskRay edited the summary of this revision. (Show Details)

Update description

This revision was automatically updated to reflect the committed changes.