mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 11:39:35 +00:00
Mark .eh_frame sections as live by default. NFC.
This change eliminates a string comparison from the garbage collector. llvm-svn: 256378
This commit is contained in:
parent
b42d9a5f06
commit
da735325fa
@ -253,7 +253,12 @@ SplitInputSection<ELFT>::SplitInputSection(
|
||||
template <class ELFT>
|
||||
EHInputSection<ELFT>::EHInputSection(ObjectFile<ELFT> *F,
|
||||
const Elf_Shdr *Header)
|
||||
: SplitInputSection<ELFT>(F, Header, InputSectionBase<ELFT>::EHFrame) {}
|
||||
: SplitInputSection<ELFT>(F, Header, InputSectionBase<ELFT>::EHFrame) {
|
||||
// Mark .eh_frame sections as live by default because there are
|
||||
// usually no relocations that point to .eh_frames. Otherwise,
|
||||
// the garbage collector would drop all .eh_frame sections.
|
||||
this->Live = true;
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
bool EHInputSection<ELFT>::classof(const InputSectionBase<ELFT> *S) {
|
||||
|
@ -120,10 +120,6 @@ template <class ELFT> void lld::elf2::markLive(SymbolTable<ELFT> *Symtab) {
|
||||
continue;
|
||||
if (isReserved(Sec))
|
||||
Enqueue(Sec);
|
||||
else if (Sec->getSectionName() == ".eh_frame")
|
||||
// .eh_frame is special. It should be marked live so that we don't
|
||||
// drop it, but it should not keep any section alive.
|
||||
Sec->Live = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user