[PATCH] D36256: [ELF] Don't output headers into a segment if there's no space for them
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 18 17:20:32 PDT 2017
phosek added inline comments.
================
Comment at: ELF/LinkerScript.cpp:736
+ Sec->FirstInPtLoad = ActualFirst;
+ }
FirstPTLoad->First = ActualFirst;
----------------
grimar wrote:
> And this one ?
>
> I removed both and had no no any test failtures:
>
> ```
> OutputSection *ActualFirst = nullptr;
> for (OutputSection *Sec : OutputSections) {
> if (Sec->FirstInPtLoad == Out::ElfHeader) {
> ActualFirst = Sec;
> break;
> }
> }
> if (ActualFirst) {
> for (OutputSection *Sec : OutputSections)
> if (Sec->FirstInPtLoad == Out::ElfHeader)
> Sec->FirstInPtLoad = ActualFirst;
> FirstPTLoad->First = ActualFirst;
> } else {
> Phdrs.erase(It);
> }
> ```
You're right, that was a leftover from a previous version of the patch but that's no longer needed.
Repository:
rL LLVM
https://reviews.llvm.org/D36256
More information about the llvm-commits
mailing list