aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-target.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-03-30 04:40:33 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-03-30 04:40:49 -0700
commitbd53a53af486c6e5ab88b7f64342244392be1f1f (patch)
treebb7d41577e217ff63481159f9bd65dca1a510ded /bfd/elfxx-target.h
parent457983e3a30212740a599ffa7cbf5142ffe67367 (diff)
downloadgdb-bd53a53af486c6e5ab88b7f64342244392be1f1f.zip
gdb-bd53a53af486c6e5ab88b7f64342244392be1f1f.tar.gz
gdb-bd53a53af486c6e5ab88b7f64342244392be1f1f.tar.bz2
Properly set sh_info for .rela.plt/rel.plt section
Since .rela.plt/rel.plt section may contain relocations against .got.plt section, we set sh_info for .rela.plt/rel.plt section to .got.plt section index if target has .got.plt section. bfd/ PR ld/18169 * elf-bfd.h (elf_backend_data): Add get_reloc_section. (_bfd_elf_get_reloc_section): New. * elf.c (_bfd_elf_get_reloc_section): Likewise. (assign_section_numbers): Call get_reloc_section to look up the section the relocs apply. * elfxx-target.h (elf_backend_get_reloc_section): Likewise. (elfNN_bed): Initialize get_reloc_section with elf_backend_get_reloc_section. ld/testsuite/ PR ld/18169 * ld-elf/linkinfo1a.d: Updated. * ld-elf/linkinfo1b.d: Likewise.
Diffstat (limited to 'bfd/elfxx-target.h')
-rw-r--r--bfd/elfxx-target.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 9760db4..5623662 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -672,6 +672,10 @@
#define elf_backend_maybe_function_sym _bfd_elf_maybe_function_sym
#endif
+#ifndef elf_backend_get_reloc_section
+#define elf_backend_get_reloc_section _bfd_elf_get_reloc_section
+#endif
+
#ifndef elf_match_priority
#define elf_match_priority \
(ELF_ARCH == bfd_arch_unknown ? 2 : ELF_OSABI == ELFOSABI_NONE ? 1 : 0)
@@ -769,6 +773,7 @@ static struct elf_backend_data elfNN_bed =
elf_backend_hash_symbol,
elf_backend_is_function_type,
elf_backend_maybe_function_sym,
+ elf_backend_get_reloc_section,
elf_backend_link_order_error_handler,
elf_backend_relplt_name,
ELF_MACHINE_ALT1,