diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -3527,8 +3527,8 @@ } ThunkSection::ThunkSection(OutputSection *os, uint64_t off) - : SyntheticSection(SHF_ALLOC | SHF_EXECINSTR, SHT_PROGBITS, 4, - ".text.thunk") { + : SyntheticSection(SHF_ALLOC | SHF_EXECINSTR, SHT_PROGBITS, + config->emachine == EM_PPC64 ? 16 : 4, ".text.thunk") { this->parent = os; this->outSecOff = off; } diff --git a/lld/ELF/Thunks.cpp b/lld/ELF/Thunks.cpp --- a/lld/ELF/Thunks.cpp +++ b/lld/ELF/Thunks.cpp @@ -301,7 +301,7 @@ // callee's global entry point into r12 without a save of R2. class PPC64R12SetupStub final : public Thunk { public: - PPC64R12SetupStub(Symbol &dest) : Thunk(dest, 0) {} + PPC64R12SetupStub(Symbol &dest) : Thunk(dest, 0) { alignment = 16; } uint32_t size() override { return 16; } void writeTo(uint8_t *buf) override; void addSymbols(ThunkSection &isec) override; @@ -316,7 +316,7 @@ // 2) Transferring control to the target function through an indirect branch. class PPC64PCRelPLTStub final : public Thunk { public: - PPC64PCRelPLTStub(Symbol &dest) : Thunk(dest, 0) {} + PPC64PCRelPLTStub(Symbol &dest) : Thunk(dest, 0) { alignment = 16; } uint32_t size() override { return 16; } void writeTo(uint8_t *buf) override; void addSymbols(ThunkSection &isec) override;