summaryrefslogtreecommitdiffstats
path: root/lld/ELF/OutputSections.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
-rw-r--r--lld/ELF/OutputSections.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index a3d228c0b22..7c7ec0a05c8 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -47,7 +47,7 @@ void OutputSectionBase<ELFT>::writeHeaderTo(Elf_Shdr *Shdr) {
template <class ELFT>
GotPltSection<ELFT>::GotPltSection()
: OutputSectionBase<ELFT>(".got.plt", SHT_PROGBITS, SHF_ALLOC | SHF_WRITE) {
- this->Header.sh_addralign = sizeof(uintX_t);
+ this->Header.sh_addralign = Target->GotPltEntrySize;
}
template <class ELFT> void GotPltSection<ELFT>::addEntry(SymbolBody &Sym) {
@@ -60,13 +60,13 @@ template <class ELFT> bool GotPltSection<ELFT>::empty() const {
}
template <class ELFT> void GotPltSection<ELFT>::finalize() {
- this->Header.sh_size =
- (Target->GotPltHeaderEntriesNum + Entries.size()) * sizeof(uintX_t);
+ this->Header.sh_size = (Target->GotPltHeaderEntriesNum + Entries.size()) *
+ Target->GotPltEntrySize;
}
template <class ELFT> void GotPltSection<ELFT>::writeTo(uint8_t *Buf) {
Target->writeGotPltHeader(Buf);
- Buf += Target->GotPltHeaderEntriesNum * sizeof(uintX_t);
+ Buf += Target->GotPltHeaderEntriesNum * Target->GotPltEntrySize;
for (const SymbolBody *B : Entries) {
Target->writeGotPlt(Buf, *B);
Buf += sizeof(uintX_t);
@@ -78,7 +78,7 @@ GotSection<ELFT>::GotSection()
: OutputSectionBase<ELFT>(".got", SHT_PROGBITS, SHF_ALLOC | SHF_WRITE) {
if (Config->EMachine == EM_MIPS)
this->Header.sh_flags |= SHF_MIPS_GPREL;
- this->Header.sh_addralign = sizeof(uintX_t);
+ this->Header.sh_addralign = Target->GotEntrySize;
}
template <class ELFT>
OpenPOWER on IntegriCloud