forked from OSchip/llvm-project
Change the order of parameters. NFC.
If a function takes a size and an alignment, we usually pass them in that order instead of the reverse order. llvm-svn: 298968
This commit is contained in:
parent
abbef0ef07
commit
c95671bd78
|
|
@ -455,7 +455,7 @@ template <class ELFT> static void addCopyRelSymbol(SharedSymbol *SS) {
|
|||
// memory protection by reserving space in the .bss.rel.ro section.
|
||||
bool IsReadOnly = isReadOnly<ELFT>(SS);
|
||||
BssSection *Sec = IsReadOnly ? In<ELFT>::BssRelRo : In<ELFT>::Bss;
|
||||
uintX_t Off = Sec->reserveSpace(SS->getAlignment<ELFT>(), SymSize);
|
||||
uintX_t Off = Sec->reserveSpace(SymSize, SS->getAlignment<ELFT>());
|
||||
|
||||
// Look through the DSO's dynamic symbol table for aliases and create a
|
||||
// dynamic symbol for each one. This causes the copy relocation to correctly
|
||||
|
|
|
|||
|
|
@ -75,11 +75,11 @@ template <class ELFT> InputSection *elf::createCommonSection() {
|
|||
[](const DefinedCommon *A, const DefinedCommon *B) {
|
||||
return A->Alignment > B->Alignment;
|
||||
});
|
||||
BssSection *Ret = make<BssSection>("COMMON");
|
||||
for (DefinedCommon *Sym : Syms)
|
||||
Sym->Offset = Ret->reserveSpace(Sym->Alignment, Sym->Size);
|
||||
|
||||
return Ret;
|
||||
BssSection *Sec = make<BssSection>("COMMON");
|
||||
for (DefinedCommon *Sym : Syms)
|
||||
Sym->Offset = Sec->reserveSpace(Sym->Size, Sym->Alignment);
|
||||
return Sec;
|
||||
}
|
||||
|
||||
// Returns an LLD version string.
|
||||
|
|
@ -367,7 +367,7 @@ void BuildIdSection::computeHash(
|
|||
BssSection::BssSection(StringRef Name)
|
||||
: SyntheticSection(SHF_ALLOC | SHF_WRITE, SHT_NOBITS, 0, Name) {}
|
||||
|
||||
size_t BssSection::reserveSpace(uint32_t Alignment, size_t Size) {
|
||||
size_t BssSection::reserveSpace(size_t Size, uint32_t Alignment) {
|
||||
if (OutSec)
|
||||
OutSec->updateAlignment(Alignment);
|
||||
this->Size = alignTo(this->Size, Alignment) + Size;
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ public:
|
|||
BssSection(StringRef Name);
|
||||
void writeTo(uint8_t *) override {}
|
||||
bool empty() const override { return getSize() == 0; }
|
||||
size_t reserveSpace(uint32_t Alignment, size_t Size);
|
||||
size_t reserveSpace(size_t Size, uint32_t Alignment);
|
||||
size_t getSize() const override { return Size; }
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Reference in New Issue