This is an archive of the discontinued LLVM Phabricator instance.

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

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

Details

Summary

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
R_*_NONE).

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.
This comment was removed by MaskRay.
Herald added a project: Restricted Project. · View Herald TranscriptSep 18 2023, 9:19 PM
Herald added a subscriber: pengfei. · View Herald Transcript