diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-03-30 04:40:33 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-03-30 04:40:49 -0700 |
commit | bd53a53af486c6e5ab88b7f64342244392be1f1f (patch) | |
tree | bb7d41577e217ff63481159f9bd65dca1a510ded /bfd/elf-bfd.h | |
parent | 457983e3a30212740a599ffa7cbf5142ffe67367 (diff) | |
download | gdb-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/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 53ef9d8..e435e52 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1239,6 +1239,9 @@ struct elf_backend_data bfd_size_type (*maybe_function_sym) (const asymbol *sym, asection *sec, bfd_vma *code_off); + /* Return the section which RELOC_SEC applies to. */ + asection *(*get_reloc_section) (asection *reloc_sec); + /* Used to handle bad SHF_LINK_ORDER input. */ bfd_error_handler_type link_order_error_handler; @@ -2247,6 +2250,8 @@ extern bfd_boolean _bfd_elf_is_function_type (unsigned int); extern bfd_size_type _bfd_elf_maybe_function_sym (const asymbol *, asection *, bfd_vma *); +extern asection *_bfd_elf_get_reloc_section (asection *); + extern int bfd_elf_get_default_section_type (flagword); extern bfd_boolean bfd_elf_lookup_section_flags |