This is an archive of the discontinued LLVM Phabricator instance.

[ELF][MIPS] Move MIPS GOT header generation to the GotSection
ClosedPublic

Authored by atanasyan on Apr 24 2016, 4:24 AM.

Details

Summary

MIPS is the only target requires GOT header. We already have MIPS specific code in the GotSection class, so move MIPS GOT header generation there and delete redundant stuff like GotHeaderEntriesNum field and writeGotHeader method.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 54799.Apr 24 2016, 4:24 AM
atanasyan retitled this revision from to [ELF][MIPS] Move MIPS GOT header generation to the GotSection.
atanasyan updated this object.
atanasyan added reviewers: rafael, ruiu.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a project: lld.
atanasyan added a subscriber: llvm-commits.
rafael added inline comments.Apr 25 2016, 11:59 AM
ELF/OutputSections.cpp
149 ↗(On Diff #54799)

Won't this produce the wrong result for mips now?

rafael edited edge metadata.Apr 25 2016, 12:00 PM

getting phab to send an email.

I added a comment on phab, but it is not sending an email.

Cheers,
Rafael

atanasyan added inline comments.Apr 25 2016, 12:11 PM
ELF/OutputSections.cpp
149 ↗(On Diff #54799)

Now LLD does not support MIPS TLS relocations. So this code does not make worse anything.

I have another couple of patches to support MIPS TLS. As an announce - it might sound like a joke but for GOT entries related to TLS relocations MIPS ABI uses almost regular approach with creation of dynamic relocations for each GOT enty etc. But ABI requires to separate these 'regular' TLS related entries from MIPS specific local/global parts of GOT :)

This revision was automatically updated to reflect the committed changes.