From 45965137bee4946dca3cd99285f2a7afe6b99aeb Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 5 Mar 2014 19:57:39 +1030 Subject: 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. --- include/elf/ChangeLog | 4 ++++ include/elf/ppc64.h | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'include/elf') diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index bd18469..bf7a370 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,7 @@ +2014-03-05 Alan Modra + + * ppc64.h (R_PPC64_REL24_NOTOC, R_PPC64_ADDR64_LOCAL): Define. + 2014-02-06 Andrew Pinski * mips.h (E_MIPS_MACH_OCTEON3): New machine flag. diff --git a/include/elf/ppc64.h b/include/elf/ppc64.h index 78d947b..30ed8bc 100644 --- a/include/elf/ppc64.h +++ b/include/elf/ppc64.h @@ -149,6 +149,10 @@ START_RELOC_NUMBERS (elf_ppc64_reloc_type) RELOC_NUMBER (R_PPC64_DTPREL16_HIGH, 114) RELOC_NUMBER (R_PPC64_DTPREL16_HIGHA, 115) +/* Added for ELFv2. */ + RELOC_NUMBER (R_PPC64_REL24_NOTOC, 116) + RELOC_NUMBER (R_PPC64_ADDR64_LOCAL, 117) + #ifndef RELOC_MACROS_GEN_FUNC /* Fake relocation only used internally by ld. */ RELOC_NUMBER (R_PPC64_LO_DS_OPT, 128) -- cgit v1.1