mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-01 12:43:47 +00:00
[ELF] Simplify Symbol::includeInDynsym
This commit is contained in:
parent
3736d0854a
commit
7330fd236e
@ -461,8 +461,9 @@ template <class ELFT> void ICF<ELFT>::run() {
|
||||
// Compute isPreemptible early. We may add more symbols later, so this loop
|
||||
// cannot be merged with the later computeIsPreemptible() pass which is used
|
||||
// by scanRelocations().
|
||||
for (Symbol *sym : symtab->symbols())
|
||||
sym->isPreemptible = computeIsPreemptible(*sym);
|
||||
if (config->hasDynSymTab)
|
||||
for (Symbol *sym : symtab->symbols())
|
||||
sym->isPreemptible = computeIsPreemptible(*sym);
|
||||
|
||||
// Two text sections may have identical content and relocations but different
|
||||
// LSDA, e.g. the two functions may have catch blocks of different types. If a
|
||||
|
@ -279,8 +279,6 @@ uint8_t Symbol::computeBinding() const {
|
||||
}
|
||||
|
||||
bool Symbol::includeInDynsym() const {
|
||||
if (!config->hasDynSymTab)
|
||||
return false;
|
||||
if (computeBinding() == STB_LOCAL)
|
||||
return false;
|
||||
if (!isDefined() && !isCommon())
|
||||
|
@ -1912,8 +1912,9 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
|
||||
finalizeSynthetic(part.ehFrame.get());
|
||||
}
|
||||
|
||||
for (Symbol *sym : symtab->symbols())
|
||||
sym->isPreemptible = computeIsPreemptible(*sym);
|
||||
if (config->hasDynSymTab)
|
||||
for (Symbol *sym : symtab->symbols())
|
||||
sym->isPreemptible = computeIsPreemptible(*sym);
|
||||
|
||||
// Change values of linker-script-defined symbols from placeholders (assigned
|
||||
// by declareSymbols) to actual definitions.
|
||||
|
Loading…
x
Reference in New Issue
Block a user