diff options
author | Alan Modra <amodra@gmail.com> | 2014-07-08 15:24:06 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-07-08 19:42:03 +0930 |
commit | bffebb6ba5b4ddbca7353626d682f9f974584dbf (patch) | |
tree | 093877e73fca460e1b1f378024e210b46ddc1f00 /ld/testsuite/ld-powerpc/defsym.s | |
parent | 161ac41e03a819bc34e8c70a3fd1bc26f43858a2 (diff) | |
download | gdb-bffebb6ba5b4ddbca7353626d682f9f974584dbf.zip gdb-bffebb6ba5b4ddbca7353626d682f9f974584dbf.tar.gz gdb-bffebb6ba5b4ddbca7353626d682f9f974584dbf.tar.bz2 |
Copy st_other for linker script symbol assignments
This fixes a problem seen on powerpc64le ELFv2 when creating a
function symbol alias with ld --defsym. st_other needs to be copied
from the source symbol to the alias in order to set up the local entry
offset for the alias. I decided to make this change in the generic
ELF code rather than in elf64-ppc.c since it looks like other targets
that use st_other bits might benefit too.
bfd/
* elflink.c (_bfd_elf_copy_link_hash_symbol_type): Copy st_other
bits from source to dest.
* linker.c (_bfd_generic_copy_link_hash_symbol_type): Update comment.
* targets.c (struct bfd_target <_bfd_copy_link_hash_symbol_type>):
Likewise.
* bfd-in2.h: Regenerate.
ld/testsuite/
* ld-powerpc/defsym.s, * ld-powerpc/defsym.d: New test.
* ld-powerpc/powerpc.exp: Run it.
Diffstat (limited to 'ld/testsuite/ld-powerpc/defsym.s')
-rw-r--r-- | ld/testsuite/ld-powerpc/defsym.s | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ld/testsuite/ld-powerpc/defsym.s b/ld/testsuite/ld-powerpc/defsym.s new file mode 100644 index 0000000..efca072 --- /dev/null +++ b/ld/testsuite/ld-powerpc/defsym.s @@ -0,0 +1,19 @@ + .text + .globl _start +_start: + bl foo + bl bar + nop + + .globl foo + .type foo,@function +foo: + addis 2,12,.TOC.-foo@ha + addi 2,2,.TOC.-foo@l + .localentry foo,.-foo + blr + .size foo,.-foo + + .data + .dc.a foo + .dc.a bar |