Create a vector containing all input sections.
authorRui Ueyama <ruiu@google.com>
Sat, 5 Nov 2016 22:37:59 +0000 (22:37 +0000)
committerRui Ueyama <ruiu@google.com>
Sat, 5 Nov 2016 22:37:59 +0000 (22:37 +0000)
commit8c6a5aaf1575a079e95e67729c486bee2f1f3f1f
treef15b98192e324a34852b5d025f13f23808a2e413
parent16480186f845a6698143d1f1efbebf9ea7e4b89a
Create a vector containing all input sections.

Previously, we do this piece of code to iterate over all input sections.

  for (elf::ObjectFile<ELFT> *F : Symtab.getObjectFiles())
    for (InputSectionBase<ELFT> *S : F->getSections())

It turned out that this mechanisms doesn't work well with synthetic
input sections because synthetic input sections don't belong to any
input file.

This patch defines a vector that contains all input sections including
synthetic ones.

llvm-svn: 286051
lld/ELF/Driver.cpp
lld/ELF/ICF.cpp
lld/ELF/LTO.cpp
lld/ELF/LinkerScript.cpp
lld/ELF/LinkerScript.h
lld/ELF/MarkLive.cpp
lld/ELF/SymbolTable.h
lld/ELF/Writer.cpp
lld/include/lld/Core/Reader.h
lld/lib/Core/Reader.cpp