PPC64 V2 ABI describes two entry points to a function. The global entry point sets up the TOC base pointer. When calling a local function, the call should branch to the local entry point rather than the global entry point. Section 3.4.1 describes using the 3 most significant bits of the st_other field to find out how many instructions there are between the local and global entry point. This patch adds the correct offset required to branch to the local entry point of a function.
Details
Details
- Reviewers
sfertile ruiu rdhindsa • espindola - Commits
- rG116c0424da83: Fix warning: result of 32-bit shift implicitly converted to 64 bits - NFC
rG82dd99e08ed8: [PPC64] Add offset to local entry point when calling functions without plt
rLLD331181: Fix warning: result of 32-bit shift implicitly converted to 64 bits - NFC
rL331181: Fix warning: result of 32-bit shift implicitly converted to 64 bits - NFC
rL331046: [PPC64] Add offset to local entry point when calling functions without plt
rLLD331046: [PPC64] Add offset to local entry point when calling functions without plt
Diff Detail
Diff Detail
Event Timeline
lld/ELF/Arch/PPC64.cpp | ||
---|---|---|
25–26 ↗ | (On Diff #142804) | Can you please expand the comment to include the explanation that you wrote in the commit message? I found that's very useful. |
35 ↗ | (On Diff #142804) | nit: no else after return |
lld/ELF/InputSection.cpp | ||
591–603 | Perhaps, it is better to inline the function here? I think that getLocalEntryOffset is called only once here and short enough to be inlined. |
ELF/InputSection.cpp | ||
---|---|---|
598 ↗ | (On Diff #144351) | This produces a warning for me now: |
ELF/InputSection.cpp | ||
---|---|---|
598 ↗ | (On Diff #144351) | Should be fixed with https://reviews.llvm.org/rL331181 |
ELF/InputSection.cpp | ||
---|---|---|
598 ↗ | (On Diff #144351) | It`s fixed for me, thanks! |
Perhaps, it is better to inline the function here? I think that getLocalEntryOffset is called only once here and short enough to be inlined.