]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - bfd/elf.c
PR 21412, get_reloc_section assumes .rel/.rela name for SHT_REL/RELA.
authorAlan Modra <amodra@gmail.com>
Sun, 23 Apr 2017 01:33:34 +0000 (11:03 +0930)
committerAlan Modra <amodra@gmail.com>
Sun, 23 Apr 2017 11:03:34 +0000 (20:33 +0930)
commitbce964aa6c777d236fbd641f2bc7bb931cfe4bf3
tree0766f8772604e3f7b4df1f2dffb9ee456b9fc6f9
parent97e83a100aa8250be783304bfe0429761c6e6b6b
PR 21412, get_reloc_section assumes .rel/.rela name for SHT_REL/RELA.

This patch fixes an assumption made by code that runs for objcopy and
strip, that SHT_REL/SHR_RELA sections are always named starting with a
.rel/.rela prefix.  I'm also modifying the interface for
elf_backend_get_reloc_section, so any backend function just needs to
handle name mapping.

PR 21412
* elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
parameters and comment.
(_bfd_elf_get_reloc_section): Delete.
(_bfd_elf_plt_get_reloc_section): Declare.
* elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
New functions.  Don't blindly skip over assumed .rel/.rela prefix.
Extracted from..
(_bfd_elf_get_reloc_section): ..here.  Delete.
(assign_section_numbers): Call elf_get_reloc_section.
* elf64-ppc.c (elf_backend_get_reloc_section): Define.
* elfxx-target.h (elf_backend_get_reloc_section): Update.
bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf.c
bfd/elf64-ppc.c
bfd/elfxx-target.h