This is an archive of the discontinued LLVM Phabricator instance.

Split Header into individual fields
ClosedPublic

Authored by rafael on Nov 8 2016, 2:44 PM.

Details

Reviewers
ruiu
Summary

This is similar to what was done for InputSection.

With this the various fields are stored in host order and only converted to target order when writing.

My objective is to

  • Make OutputSectionBase a class instead of a class template.
  • Make InputSectionBase a class
  • Merge InputSectionBase and InputSectionData

Specialize the storage, for example, we probably don't need 64 bits for Entsize. This will mean that 32 bit ELFs will be a bit bloated as uintX_t will be replaced with uint64_t, but I don't expect that to be a major problem.

In any case, I think this is already an independent cleanup.

Diff Detail

Event Timeline

rafael updated this revision to Diff 77266.Nov 8 2016, 2:44 PM
rafael retitled this revision from to Split Header into individual fields.
rafael updated this object.
rafael added a reviewer: ruiu.
rafael added a subscriber: llvm-commits.
ruiu accepted this revision.Nov 8 2016, 2:53 PM
ruiu edited edge metadata.

LGTM

ELF/OutputSections.cpp
41

Why only Addralign doesn't have this->?

ELF/OutputSections.h
113

Add a comment saying that these fields correspond to Elf_Shdr members.

ELF/Writer.cpp
426–427

It doesn't make much sense to write AFlags instead of A->Flags. Can you remove these variables?

This revision is now accepted and ready to land.Nov 8 2016, 2:53 PM
espindola closed this revision.Mar 14 2018, 4:38 PM
espindola added a subscriber: espindola.

286327