diff options
| author | Rui Ueyama <ruiu@google.com> | 2016-10-04 00:46:36 +0000 | 
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2016-10-04 00:46:36 +0000 | 
| commit | ad9268a7b496a794c34b14afa589c58e01307d7b (patch) | |
| tree | 18a44093dbf49a75e7b42dc192d8e4a283fb8134 | |
| parent | 3ffb8529bc78db1b0a7d3d782fd972eea802d649 (diff) | |
| download | bcm5719-llvm-ad9268a7b496a794c34b14afa589c58e01307d7b.tar.gz bcm5719-llvm-ad9268a7b496a794c34b14afa589c58e01307d7b.zip  | |
Early return. NFC.
llvm-svn: 283173
| -rw-r--r-- | lld/ELF/MarkLive.cpp | 11 | 
1 files changed, 6 insertions, 5 deletions
diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp index 4fadd034c96..d450b3046ae 100644 --- a/lld/ELF/MarkLive.cpp +++ b/lld/ELF/MarkLive.cpp @@ -160,8 +160,8 @@ scanEhFrameSection(EhInputSection<ELFT> &EH,  }  // We do not garbage-collect two types of sections: -// 1) Sections used by the loader (.init, .fini, .ctors, .dtors, .jcr) -// 2) Not allocatable sections which typically contain debugging information +// 1) Sections used by the loader (.init, .fini, .ctors, .dtors or .jcr) +// 2) Non-allocatable sections which typically contain debugging information  template <class ELFT> static bool isReserved(InputSectionBase<ELFT> *Sec) {    switch (Sec->getSectionHdr()->sh_type) {    case SHT_FINI_ARRAY: @@ -170,15 +170,16 @@ template <class ELFT> static bool isReserved(InputSectionBase<ELFT> *Sec) {    case SHT_PREINIT_ARRAY:      return true;    default: -    StringRef S = Sec->Name; +    if (!(Sec->getSectionHdr()->sh_flags & SHF_ALLOC)) +      return true;      // We do not want to reclaim sections if they can be referred      // by __start_* and __stop_* symbols. +    StringRef S = Sec->Name;      if (isValidCIdentifier(S))        return true; -    bool IsAllocSec = Sec->getSectionHdr()->sh_flags & SHF_ALLOC; -    return !IsAllocSec || S.startswith(".ctors") || S.startswith(".dtors") || +    return S.startswith(".ctors") || S.startswith(".dtors") ||             S.startswith(".init") || S.startswith(".fini") ||             S.startswith(".jcr");    }  | 

