Changeset View
Changeset View
Standalone View
Standalone View
ELF/SyntheticSections.cpp
Show First 20 Lines • Show All 1,951 Lines • ▼ Show 20 Lines | while (i < e) { | ||||
if (!bitmap) | if (!bitmap) | ||||
break; | break; | ||||
relrRelocs.push_back(Elf_Relr((bitmap << 1) | 1)); | relrRelocs.push_back(Elf_Relr((bitmap << 1) | 1)); | ||||
base += nBits * wordsize; | base += nBits * wordsize; | ||||
} | } | ||||
} | } | ||||
// Don't allow the section to shrink; otherwise the size of the section can | |||||
// oscillate infinitely. Trailing 1s do not decode to more relocations. | |||||
if (relrRelocs.size() < oldSize) { | |||||
log(".relr.dyn needs " + Twine(oldSize - relrRelocs.size()) + | |||||
" padding word(s)"); | |||||
relrRelocs.resize(oldSize, Elf_Relr(1)); | |||||
} | |||||
return relrRelocs.size() != oldSize; | return relrRelocs.size() != oldSize; | ||||
} | } | ||||
SymbolTableBaseSection::SymbolTableBaseSection(StringTableSection &strTabSec) | SymbolTableBaseSection::SymbolTableBaseSection(StringTableSection &strTabSec) | ||||
: SyntheticSection(strTabSec.isDynamic() ? (uint64_t)SHF_ALLOC : 0, | : SyntheticSection(strTabSec.isDynamic() ? (uint64_t)SHF_ALLOC : 0, | ||||
strTabSec.isDynamic() ? SHT_DYNSYM : SHT_SYMTAB, | strTabSec.isDynamic() ? SHT_DYNSYM : SHT_SYMTAB, | ||||
config->wordsize, | config->wordsize, | ||||
strTabSec.isDynamic() ? ".dynsym" : ".symtab"), | strTabSec.isDynamic() ? ".dynsym" : ".symtab"), | ||||
▲ Show 20 Lines • Show All 1,746 Lines • Show Last 20 Lines |