[PATCH] D30319: [ELF] Make __ehdr_start point to ELF file headers

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 20:05:34 PST 2017


pcc added a comment.

These symbols don't really belong to a section, so there's no appropriate section index for them. Nor do they participate in dynamic loading (as they have hidden visibility). A section index of 1 would probably be appropriate (it doesn't matter what value it is, as long as it is not `SHN_UNDEF` or `SHN_ABS`).

Anyway, I think the problem is that we do not initialize `Out<ELFT>::ElfHeader->SectionIndex`, and the fix is to change the code here: http://llvm-cs.pcc.me.uk/tools/lld/ELF/Writer.cpp#1137


Repository:
  rL LLVM

https://reviews.llvm.org/D30319





More information about the llvm-commits mailing list