aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-11-06 05:18:03 +0000
committerAlan Modra <amodra@gmail.com>2012-11-06 05:18:03 +0000
commita38a07e07c75f3d498fb9187a7924d159be6326c (patch)
tree7aade350a33eb2d73734332cbf7e52d57af4d37e /bfd/elf64-ppc.c
parent53d8967a8594639334bfd928268e0857b2e72732 (diff)
downloadgdb-a38a07e07c75f3d498fb9187a7924d159be6326c.zip
gdb-a38a07e07c75f3d498fb9187a7924d159be6326c.tar.gz
gdb-a38a07e07c75f3d498fb9187a7924d159be6326c.tar.bz2
bfd/
* elf64-ppc.c (struct ppc_link_hash_table): Add dot_toc_dot. (ppc64_elf_size_stubs): Lookup ".TOC.". (ppc64_elf_relocate_section): Resolve special symbol ".TOC.". gas/ * config/tc-ppc.c (ppc_elf_adjust_symtab): New function, split out.. (ppc_frob_file_before_adjust): ..from here. (md_apply_fix): Set BSF_KEEP on .TOC. if not @tocbase. * config/tc-ppc.h (ppc_elf_adjust_symtab): Declare. (tc_adjust_symtab): Define.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 6bdc701..94f3c42 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -3757,6 +3757,9 @@ struct ppc_link_hash_table
struct ppc_link_hash_entry *tls_get_addr;
struct ppc_link_hash_entry *tls_get_addr_fd;
+ /* The special .TOC. symbol. */
+ struct ppc_link_hash_entry *dot_toc_dot;
+
/* The size of reliplt used by got entry relocs. */
bfd_size_type got_reli_size;
@@ -11364,6 +11367,9 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size,
}
}
htab->plt_thread_safe = plt_thread_safe;
+ htab->dot_toc_dot = ((struct ppc_link_hash_entry *)
+ elf_link_hash_lookup (&htab->elf, ".TOC.",
+ FALSE, FALSE, TRUE));
stubs_always_before_branch = group_size < 0;
if (group_size < 0)
stub_group_size = -group_size;
@@ -12362,6 +12368,13 @@ ppc64_elf_relocate_section (bfd *output_bfd,
}
}
}
+ if (h_elf == &htab->dot_toc_dot->elf)
+ {
+ relocation = (TOCstart
+ + htab->stub_group[input_section->id].toc_off);
+ sec = bfd_abs_section_ptr;
+ unresolved_reloc = FALSE;
+ }
}
h = (struct ppc_link_hash_entry *) h_elf;