aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-05-20 11:42:42 +0930
committerAlan Modra <amodra@gmail.com>2014-05-20 13:13:23 +0930
commit93d1b056cb396d6468781fe0e40dd769891bed32 (patch)
treea84a041d4dbad13cb0c3947f2a1bd93c99524365 /bfd/elf32-ppc.h
parentab2f2ff937b25a8ee2ff902fd0bf08299d1dae2e (diff)
downloadgdb-93d1b056cb396d6468781fe0e40dd769891bed32.zip
gdb-93d1b056cb396d6468781fe0e40dd769891bed32.tar.gz
gdb-93d1b056cb396d6468781fe0e40dd769891bed32.tar.bz2
Rewrite ppc32 backend .sdata and .sdata2 handling
1) _SDA_BASE_ and _SDA2_BASE_ and defined automatically, in a similar manner to the way _GLOBAL_OFFSET_TABLE_ is handled. It's a little more complicated to remove the symbols because _SDA_BASE_ needs to be there if either .sdata or .sbss is present, and similarly for _SDA2_BASE. 2) The linker created .sdata and .sdata2 sections used for R_PPC_EMB_SDAI16 and R_PPC_EMB_SDA2I16 pointers are created early. Nowadays we strip unneeded sections from the output, so it isn't necessary to delay creating the sections. 3) The output section for targets of various SDA relocs is now checked as per the ABI(s). We previously allowed .sdata.foo and similar, most likely because at some stage we were checking input sections. Also, the patch fixes a long-standing bug in size_input_sections that affects the values of symbols defined in stripped input sections. PR 16952 bfd/ * elf32-ppc.c (ppc_elf_create_linker_section): Move earlier. Remove redundant setting of htab->elf.dynobj. Don't align. Define .sdata symbols using _bfd_elf_define_linkage_sym. (ppc_elf_create_glink): Call ppc_elf_create_linker_section. (create_sdata_sym): Delete. (elf_allocate_pointer_linker_section): Rename from elf_create_pointer_linker_section. Align section. (ppc_elf_check_relocs): Don't call ppc_elf_creat_linker_section directly here, or create_sdata_sym. Set ref_regular on _SDA_BASE_ and _SDA2_BASE_. (ppc_elf_size_dynamic_sections): Remove ATTRIBUTE_UNUSED on param. Remove unnecessary tests on _SDA_BASE_ sym. (maybe_strip_sdasym, ppc_elf_maybe_strip_sdata_syms): New functions. (ppc_elf_relocate_section): Tighten SDA reloc symbol section checks. * elf32-ppc.h (ppc_elf_set_sdata_syms): Delete. (ppc_elf_maybe_strip_sdata_syms): Declare. ld/ * emulparams/elf32ppccommon.sh (_SDA_BASE_, _SDA2_BASE_): Delete. * emultempl/ppc32elf.em (ppc_before_allocation): Call ppc_elf_maybe_strip_sdata_syms. * ldlang.c (size_input_section): Correct output_offset value for excluded input sections.
Diffstat (limited to 'bfd/elf32-ppc.h')
-rw-r--r--bfd/elf32-ppc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elf32-ppc.h b/bfd/elf32-ppc.h
index e8d19ec..07dc4c8 100644
--- a/bfd/elf32-ppc.h
+++ b/bfd/elf32-ppc.h
@@ -50,7 +50,7 @@ void ppc_elf_link_params (struct bfd_link_info *, struct ppc_elf_params *);
int ppc_elf_select_plt_layout (bfd *, struct bfd_link_info *);
asection *ppc_elf_tls_setup (bfd *, struct bfd_link_info *);
bfd_boolean ppc_elf_tls_optimize (bfd *, struct bfd_link_info *);
-void ppc_elf_set_sdata_syms (bfd *, struct bfd_link_info *);
+void ppc_elf_maybe_strip_sdata_syms (struct bfd_link_info *);
extern bfd_boolean ppc_elf_modify_segment_map (bfd *,
struct bfd_link_info * ATTRIBUTE_UNUSED);
extern bfd_boolean ppc_elf_section_processing (bfd *, Elf_Internal_Shdr *);