This is an archive of the discontinued LLVM Phabricator instance.

[ELF][MIPS] Ignore 'hint' relocations like R_MIPS_JALR in the `scanRelocs` method
ClosedPublic

Authored by atanasyan on Jan 14 2016, 8:57 AM.

Details

Summary

MIPS ABI has relocations like R_MIPS_JALR which is just a hint for linker to make some code optimization. Such relocations should not be handled as a regular ones and lead to say dynamic relocation creation.

The patch introduces new virtual Target::isHintReloc method, overrides it in the MipsTargetInfo class and calls it in the Writer<ELFT>::scanRelocs method.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 44892.Jan 14 2016, 8:57 AM
atanasyan retitled this revision from to [ELF][MIPS] Ignore 'hint' relocations like R_MIPS_JALR in the `scanRelocs` method.
atanasyan updated this object.
atanasyan added reviewers: ruiu, rafael.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a project: lld.
atanasyan added a subscriber: llvm-commits.
ruiu accepted this revision.Jan 14 2016, 11:03 AM
ruiu edited edge metadata.

LGTM

ELF/Writer.cpp
215 ↗(On Diff #44892)

I'd be good to add a brief comment here as well, saying that we can ignore hint relocations because they are for optional optimizations.

This revision is now accepted and ready to land.Jan 14 2016, 11:03 AM
This revision was automatically updated to reflect the committed changes.