This is an archive of the discontinued LLVM Phabricator instance.

[ELF][MIPS] Add MipsGotSection to handle MIPS GOT
ClosedPublic

Authored by atanasyan on Nov 15 2016, 10:42 PM.

Details

Summary

MIPS GOT handling is very different from other targets so it is better to keep the code in the separatre section class MipsGotSection. This patch introduces the new section and moves all MIPS specific code from GotSection to the new class. I did not rename fields and methods in the MipsGotSection class to reduce the diff and plan to do that by the separate commit.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 78141.Nov 15 2016, 10:42 PM
atanasyan retitled this revision from to [ELF][MIPS] Add MipsGotSection to handle MIPS GOT.
atanasyan updated this object.
atanasyan added a reviewer: ruiu.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a project: lld.
atanasyan added a subscriber: llvm-commits.
rafael accepted this revision.Nov 16 2016, 12:02 PM
rafael added a reviewer: rafael.
rafael added a subscriber: rafael.

LGTM with a nit.

ELF/Relocations.cpp
99

Got can be set in the function, no need to make it an argument.

This revision is now accepted and ready to land.Nov 16 2016, 12:02 PM
atanasyan added inline comments.Nov 16 2016, 12:22 PM
ELF/Relocations.cpp
99

Got can be set in the function, no need to make it an argument.

I'm not sure that it is possible. GotSection used by ARM and MipsGotSection used by MIPS both have methods like addDynTlsEntry, getGlobalDynOffset etc but these methods are not virtual and are not defined in any base class. That is why I use GOT template argument.

ruiu accepted this revision.Nov 16 2016, 12:52 PM
ruiu edited edge metadata.

LGTM. I think this really improves readability. Thanks!

This revision was automatically updated to reflect the committed changes.