diff options
| -rw-r--r-- | lld/ELF/Relocations.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/SyntheticSections.cpp | 10 | ||||
| -rw-r--r-- | lld/ELF/SyntheticSections.h | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 9a1da23..84d93e73 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -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 diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 5a7e73b..a804de6 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -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; diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h index c136f35..32bd3db 100644 --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -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: |
