diff options
author | Alan Modra <amodra@gmail.com> | 2014-03-05 19:57:39 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-03-05 19:57:39 +1030 |
commit | 45965137bee4946dca3cd99285f2a7afe6b99aeb (patch) | |
tree | 7b7808e61693fd88c2234cce50114a6666e706d6 /gold | |
parent | a0593ad95626fddd6777a418feb3dd3722e1ef66 (diff) | |
download | fsf-binutils-gdb-45965137bee4946dca3cd99285f2a7afe6b99aeb.zip fsf-binutils-gdb-45965137bee4946dca3cd99285f2a7afe6b99aeb.tar.gz fsf-binutils-gdb-45965137bee4946dca3cd99285f2a7afe6b99aeb.tar.bz2 |
Support R_PPC64_ADDR64_LOCAL
This adds support for "func@localentry", an expression that returns the
ELFv2 local entry point address of function "func". I've excluded
dynamic relocation support because that obviously would require glibc
changes.
include/elf/
* ppc64.h (R_PPC64_REL24_NOTOC, R_PPC64_ADDR64_LOCAL): Define.
bfd/
* elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_ADDR64_LOCAL entry.
(ppc64_elf_reloc_type_lookup): Support R_PPC64_ADDR64_LOCAL.
(ppc64_elf_check_relocs): Likewise.
(ppc64_elf_relocate_section): Likewise.
* Add BFD_RELOC_PPC64_ADDR64_LOCAL.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
gas/
* config/tc-ppc.c (ppc_elf_suffix): Support @localentry.
(md_apply_fix): Support R_PPC64_ADDR64_LOCAL.
ld/testsuite/
* ld-powerpc/elfv2-2a.s, ld-powerpc/elfv2-2b.s: New files.
* ld-powerpc/elfv2-2exe.d, ld-powerpc/elfv2-2so.d: New files.
* ld-powerpc/powerpc.exp: Run new test.
elfcpp/
* powerpc.h (R_PPC64_REL24_NOTOC, R_PPC64_ADDR64_LOCAL): Define.
gold/
* powerpc.cc (Target_powerpc::Scan::local, global): Support
R_PPC64_ADDR64_LOCAL.
(Target_powerpc::Relocate::relocate): Likewise.
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 6 | ||||
-rw-r--r-- | gold/powerpc.cc | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index f600b84..8ccb431 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2014-03-05 Alan Modra <amodra@gmail.com> + + * powerpc.cc (Target_powerpc::Scan::local, global): Support + R_PPC64_ADDR64_LOCAL. + (Target_powerpc::Relocate::relocate): Likewise. + 2014-03-03 Alan Modra <amodra@gmail.com> * dwp.cc (print_version): Update copyright year to current. diff --git a/gold/powerpc.cc b/gold/powerpc.cc index 1aa4791..8130149 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -5482,6 +5482,7 @@ Target_powerpc<size, big_endian>::Scan::local( case elfcpp::R_PPC64_DTPREL16_HIGHESTA: case elfcpp::R_PPC64_TLSGD: case elfcpp::R_PPC64_TLSLD: + case elfcpp::R_PPC64_ADDR64_LOCAL: break; case elfcpp::R_POWERPC_GOT16: @@ -5928,6 +5929,7 @@ Target_powerpc<size, big_endian>::Scan::global( case elfcpp::R_PPC64_DTPREL16_HIGHESTA: case elfcpp::R_PPC64_TLSGD: case elfcpp::R_PPC64_TLSLD: + case elfcpp::R_PPC64_ADDR64_LOCAL: break; case elfcpp::R_POWERPC_GOT16: @@ -7137,6 +7139,13 @@ Target_powerpc<size, big_endian>::Relocate::relocate( value -= dtp_offset; break; + case elfcpp::R_PPC64_ADDR64_LOCAL: + if (gsym != NULL) + value += object->ppc64_local_entry_offset(gsym); + else + value += object->ppc64_local_entry_offset(r_sym); + break; + default: break; } @@ -7339,6 +7348,7 @@ Target_powerpc<size, big_endian>::Relocate::relocate( case elfcpp::R_PPC64_ADDR64: case elfcpp::R_PPC64_REL64: case elfcpp::R_PPC64_TOC: + case elfcpp::R_PPC64_ADDR64_LOCAL: Reloc::addr64(view, value); break; |