This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - add predefined sections to output sections list in one place.
ClosedPublic

Authored by grimar on May 5 2016, 9:12 AM.

Details

Diff Detail

Event Timeline

grimar updated this revision to Diff 56298.May 5 2016, 9:12 AM
grimar retitled this revision from to [ELF] - add predefined sections to output sections list in one place..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
ruiu edited edge metadata.May 5 2016, 6:51 PM

Naturally this change made me wonder whether this is too inefficient or not, but it is probably okay since the number of output sections is not very large.

ELF/Writer.cpp
1470–1474

Move this after the code to add BuildId to remove the variable I.

if (needsInterpSection())
  OutputSections.insert(OutputSections.begin(), Out<ELFT>::Interp);
1477

now -> to beginning of the file

grimar updated this revision to Diff 56390.May 6 2016, 2:39 AM
grimar edited edge metadata.

Addressed review comments

grimar added a comment.May 6 2016, 2:41 AM
In D19981#423197, @ruiu wrote:

Naturally this change made me wonder whether this is too inefficient or not, but it is probably okay since the number of output sections is not very large.

While this is not large vector of pointers, it should be fine.

ELF/Writer.cpp
1470–1474

Done.

1477

Done.

grimar updated this revision to Diff 63671.Jul 12 2016, 5:43 AM
  • Rebased
rafael accepted this revision.Jul 13 2016, 7:14 AM
rafael edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jul 13 2016, 7:14 AM
This revision was automatically updated to reflect the committed changes.