This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Split Writer::assignAddresses(): extract code for initializing dummies sections
ClosedPublic

Authored by grimar on Apr 1 2016, 4:41 AM.

Details

Reviewers
ruiu
rafael
Summary

Extracts code for initializing dummies sections
to avoid possible duplication in following patches.

Diff Detail

Event Timeline

grimar updated this revision to Diff 52350.Apr 1 2016, 4:41 AM
grimar retitled this revision from to [ELF] - Split Writer::assignAddresses(): extract code for dummies to fixDummiesSections().
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
grimar retitled this revision from [ELF] - Split Writer::assignAddresses(): extract code for dummies to fixDummiesSections() to [ELF] - Split Writer::assignAddresses(): extract code for initializing dummies sections to fixDummiesSections().Apr 1 2016, 6:10 AM
grimar updated this object.Apr 1 2016, 7:12 AM
ruiu added inline comments.Apr 1 2016, 9:27 AM
ELF/Writer.cpp
1364

This line does not depend on any data we have created until the control reaches this point. Move this to writeResult.

1365–1366

Then you can move this at end of createPhdrs.

grimar updated this revision to Diff 52390.Apr 1 2016, 10:10 AM
grimar retitled this revision from [ELF] - Split Writer::assignAddresses(): extract code for initializing dummies sections to fixDummiesSections() to [ELF] - Split Writer::assignAddresses(): extract code for initializing dummies sections.
grimar updated this object.
  • Addressed review comments.
ruiu edited edge metadata.Apr 1 2016, 10:14 AM

I cleaned up this part of the Writer, so please rebase to head and upload the patch again. Thanks.

In D18691#389584, @ruiu wrote:

I cleaned up this part of the Writer, so please rebase to head and upload the patch again. Thanks.

Ok. Btw there is a empty fixFileOff() now left in code.

grimar updated this revision to Diff 52392.Apr 1 2016, 10:23 AM
grimar edited edge metadata.
  • Rebased
ruiu accepted this revision.Apr 1 2016, 10:27 AM
ruiu edited edge metadata.

LGTM with a few nits.

ELF/Writer.cpp
209

Please move this after

OutputSectionBase<ELFT> ElfHeader("", 0, SHF_ALLOC);
1334–1335
Out<ELFT>::ProgramHeaders->setSize(sizeof(Elf_Phdr) * Phdrs.size());
This revision is now accepted and ready to land.Apr 1 2016, 10:27 AM
In D18691#389604, @ruiu wrote:

LGTM with a few nits.

Ok, thanks for review. I am planning to rebase/update D18499 now with this all changes.

grimar closed this revision.Apr 1 2016, 10:38 AM
grimar marked 2 inline comments as done.

r265159