HomePhabricator

[PPC64] Long branch thunks.

Authored by sfertile on Nov 14 2018, 9:56 AM.

Description

[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

Details

Committed
sfertileNov 14 2018, 9:56 AM
Differential Revision
D53408: [PPC64] Long branch thunks.
Parents
rG36eef925c0f1: [NFC] Change address __tls_getaddr is defined at so it does not need a thunk.
Branches
Unknown
Tags
Unknown