This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Convert .got section to input section
ClosedPublic

Authored by evgeny777 on Nov 10 2016, 5:10 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

evgeny777 updated this revision to Diff 77471.Nov 10 2016, 5:10 AM
evgeny777 retitled this revision from to [ELF] Convert .got section to input section.
evgeny777 updated this object.
evgeny777 added reviewers: ruiu, rafael.
evgeny777 set the repository for this revision to rL LLVM.
evgeny777 added a project: lld.
evgeny777 added subscribers: grimar, ikudrin, llvm-commits.
ruiu accepted this revision.Nov 10 2016, 4:34 PM
ruiu edited edge metadata.

LGTM. Thank you for doing this!

ELF/SyntheticSections.cpp
568 ↗(On Diff #77471)

This is not related to this patch, but probably we should make the MIPS GOT a separate class than the GOT for all the other archs, because MIPS seems too different. (I'm just writing what I'm thinking, so no need to take an action.)

ELF/SyntheticSections.h
74 ↗(On Diff #77471)

Isn't it an error to call getVA before setting OutSec? If so, use assert.

ELF/Writer.cpp
561 ↗(On Diff #77471)

This function seems to be doing the same thing as before (am I right?). The new code seems a bit hard to understand to me. Can you keep this function as is?

582 ↗(On Diff #77471)

And inline this function here.

This revision is now accepted and ready to land.Nov 10 2016, 4:34 PM
evgeny777 added inline comments.Nov 11 2016, 3:38 AM
ELF/SyntheticSections.h
74 ↗(On Diff #77471)

getVA() is called from getPPC64TocBase(), which in its turn is called from scanRelocs(). The Out<ELFT>::Got->getVA() used to return 0 on such occasions, but now we do crash, because we don't have OutSec yet.

This revision was automatically updated to reflect the committed changes.