Changeset View
Changeset View
Standalone View
Standalone View
lld/ELF/MarkLive.cpp
Show First 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | |||||
template <class ELFT> static bool isReserved(InputSectionBase<ELFT> *Sec) { | template <class ELFT> static bool isReserved(InputSectionBase<ELFT> *Sec) { | ||||
switch (Sec->Type) { | switch (Sec->Type) { | ||||
case SHT_FINI_ARRAY: | case SHT_FINI_ARRAY: | ||||
case SHT_INIT_ARRAY: | case SHT_INIT_ARRAY: | ||||
case SHT_NOTE: | case SHT_NOTE: | ||||
case SHT_PREINIT_ARRAY: | case SHT_PREINIT_ARRAY: | ||||
return true; | return true; | ||||
default: | default: | ||||
if (Sec->Flags & SHF_LINK_ORDER) | |||||
rnk: Do we already have the dependency from the associated section? It looks like LLD has some logic… | |||||
return false; | |||||
if (!(Sec->Flags & SHF_ALLOC)) | if (!(Sec->Flags & SHF_ALLOC)) | ||||
return true; | return true; | ||||
// We do not want to reclaim sections if they can be referred | // We do not want to reclaim sections if they can be referred | ||||
// by __start_* and __stop_* symbols. | // by __start_* and __stop_* symbols. | ||||
StringRef S = Sec->Name; | StringRef S = Sec->Name; | ||||
if (isValidCIdentifier(S)) | if (isValidCIdentifier(S)) | ||||
return true; | return true; | ||||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |
Do we already have the dependency from the associated section? It looks like LLD has some logic for it, but I can't tell if it's enough.