During review of D18499 was requested to improve way how
we deal with dummies sections.
This patch does that. Now they are not part of OutputSections list,
but still keeping them as sections helps to simplify the code.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Generally looks good. A few nits.
ELF/Writer.cpp | ||
---|---|---|
103 ↗ | (On Diff #52502) | Why +1? |
1346 ↗ | (On Diff #52502) | This function needs a comment. |
1347–1349 ↗ | (On Diff #52502) | "Off" is always zero, so please do this. Out<ELFT>::ElfHeader->setVA(Target->getVAStart()); Out<ELFT>::ElfHeader->setFileOffset(0); |
Comment Actions
Please change the title of this patch to something like "Do not handle ELF and program header as dummy sections", since what you are doing here is not improving the dummy sections but instead removing the concept of that.
Comment Actions
- Addressed Rui's review comments.
ELF/Writer.cpp | ||
---|---|---|
103 ↗ | (On Diff #52502) | Because we have one "dummy-zero" section: Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 |
1346 ↗ | (On Diff #52502) | Done. |
1347–1349 ↗ | (On Diff #52502) | Done. |
ELF/Writer.cpp | ||
---|---|---|
103 ↗ | (On Diff #52511) | It's a bit weird to count the first null entry of the section table as a section. You can just remove this function, no? |
Comment Actions
- Addressed review comments.
ELF/Writer.cpp | ||
---|---|---|
103 ↗ | (On Diff #52511) | Removed, but there was 2 places where it was called, I put (OutputSections.size() + 1) there instead: EHdr->e_shnum = OutputSections.size() + 1; FileSize = SectionHeaderOff + (OutputSections.size() + 1) * sizeof(Elf_Shdr); |