aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-07-26 12:11:11 +0930
committerAlan Modra <amodra@gmail.com>2018-07-26 12:53:50 +0930
commit33cb30a1f932b5a211aa319a01783d4957ae5d57 (patch)
treea3f75b30d87e0e461c47f3e1c786eaa67ad760b3 /include
parent6cf212b445b4222bef4f74544896a3be332d5a12 (diff)
downloadgdb-33cb30a1f932b5a211aa319a01783d4957ae5d57.zip
gdb-33cb30a1f932b5a211aa319a01783d4957ae5d57.tar.gz
gdb-33cb30a1f932b5a211aa319a01783d4957ae5d57.tar.bz2
Implement PowerPC64 .localentry for value 1
This adds support for ".localentry 1", a new st_other STO_PPC64_LOCAL_MASK encoding that signifies a function with a single entry point like ".localentry 0", but unlike a ".localentry 0" function does not preserve r2. include/ * elf/ppc64.h: Specify byte offset to local entry for values of two to six in STO_PPC64_LOCAL_MASK. Clarify r2 return value for such functions when entering via global entry point. Specify meaning of a value of one in STO_PPC64_LOCAL_MASK. bfd/ * elf64-ppc.c (ppc64_elf_size_stubs): Use a ppc_stub_long_branch_r2off for calls to symbols with STO_PPC64_LOCAL_MASK bits set to 1. gas/ * config/tc-ppc.c (ppc_elf_localentry): Allow .localentry values of 1 and 7 to directly set value into STO_PPC64_LOCAL_MASK bits. ld/testsuite/ * ld-powerpc/elfv2.s: Add .localentry f5,1 testcase. * ld-powerpc/elfv2exe.d: Update. * ld-powerpc/elfv2so.d: Update.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog7
-rw-r--r--include/elf/ppc64.h12
2 files changed, 15 insertions, 4 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index c408eb7..8558368 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,10 @@
+2018-07-26 Alan Modra <amodra@gmail.com>
+
+ * elf/ppc64.h: Specify byte offset to local entry for values
+ of two to six in STO_PPC64_LOCAL_MASK. Clarify r2 return
+ value for such functions when entering via global entry point.
+ Specify meaning of a value of one in STO_PPC64_LOCAL_MASK.
+
2018-07-24 Alan Modra <amodra@gmail.com>
PR 23430
diff --git a/include/elf/ppc64.h b/include/elf/ppc64.h
index 501aebc..387c1d6 100644
--- a/include/elf/ppc64.h
+++ b/include/elf/ppc64.h
@@ -198,13 +198,15 @@ END_RELOC_NUMBERS (R_PPC64_max)
#define EF_PPC64_ABI 3
/* The ELFv2 ABI uses three bits in the symbol st_other field of a
- function definition to specify the number of instructions between a
+ function definition to specify the number of bytes between a
function's global entry point and local entry point.
+ Values of two to six specify powers of two from four to sixty four
+ bytes. For such functions:
The global entry point is used when it is necessary to set up the
toc pointer (r2) for the function. Callers must enter the global
entry point with r12 set to the global entry point address. On
- return from the function, r2 may have a different value to that
- which it had on entry.
+ return from the function r2 will contain the toc pointer for the
+ function.
The local entry point is used when r2 is known to already be valid
for the function. There is no requirement on r12 when using the
local entry point, and on return r2 will contain the same value as
@@ -212,7 +214,9 @@ END_RELOC_NUMBERS (R_PPC64_max)
A value of zero in these bits means that the function has a single
entry point with no requirement on r12 or r2, and that on return r2
will contain the same value as at entry.
- Values of one and seven are reserved. */
+ A value of one means that the function has a single entry point
+ with no requirement on r12 or r2, and that r2 is *not* preserved.
+ A value of seven is reserved. */
#define STO_PPC64_LOCAL_BIT 5
#define STO_PPC64_LOCAL_MASK (7 << STO_PPC64_LOCAL_BIT)