mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 10:55:58 +08:00
[PPC64] Long branch thunks.
On PowerPC64, when a function call offset is too large to encode in a call instruction the address is stored in a table in the data segment. A thunk is used to load the branch target address from the table relative to the TOC-pointer and indirectly branch to the callee. When linking position-dependent code the addresses are stored directly in the table, for position-independent code the table is allocated and filled in at load time by the dynamic linker. For position-independent code the branch targets could have gone in the .got.plt but using the .branch_lt section for both position dependent and position independent binaries keeps it consitent and helps keep this PPC64 specific logic seperated from the target-independent code handling the .got.plt. Differential Revision: https://reviews.llvm.org/D53408 llvm-svn: 346877
This commit is contained in:
@@ -489,6 +489,7 @@ static void replaceWithDefined(Symbol &Sym, SectionBase *Sec, uint64_t Value,
|
||||
Sym.PltIndex = Old.PltIndex;
|
||||
Sym.GotIndex = Old.GotIndex;
|
||||
Sym.VerdefIndex = Old.VerdefIndex;
|
||||
Sym.PPC64BranchltIndex = Old.PPC64BranchltIndex;
|
||||
Sym.IsPreemptible = true;
|
||||
Sym.ExportDynamic = true;
|
||||
Sym.IsUsedInRegularObj = true;
|
||||
|
||||
Reference in New Issue
Block a user