summaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-08-08 21:00:04 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-08-08 21:00:18 -0700
commit6404ab993797d1d6cd3d9e97cc281e3cb6226c12 (patch)
treeeee63602c3e8fdeca481656be671146ad4bbbaf1 /bfd/elf-bfd.h
parentf40f4a11d12025d18be2b0f9072f6ddcc94d3cdb (diff)
downloadbinutils-gdb-6404ab993797d1d6cd3d9e97cc281e3cb6226c12.tar.gz
Convert .note.gnu.property section between ELF32 and ELF64
.note.gnu.property section has different alignments and section sizes for 32-bit and 64-bit ELF binaries. This patch updated bfd_convert_section_size and bfd_convert_section_contents to properly convert .note.gnu.property section between 32-bit and 64-bit ELF binaries. bfd/ PR binutils/23494 * bfd.c (bfd_convert_section_size): Check BFD_DECOMPRESS after calling _bfd_elf_convert_gnu_property_size to convert .note.gnu.property section size. (bfd_convert_section_contents): Check BFD_DECOMPRESS after calling _bfd_elf_convert_gnu_properties to convert .note.gnu.property section. * elf-bfd.h (_bfd_elf_convert_gnu_property_size): New prototype. (_bfd_elf_convert_gnu_properties): Likewise. * elf-properties.c (elf_get_gnu_property_section_size): New function. (elf_write_gnu_properties): Likewise. (_bfd_elf_convert_gnu_property_size): Likewise. (_bfd_elf_convert_gnu_properties): Likewise. (_bfd_elf_link_setup_gnu_properties): Use elf_get_gnu_property_section_size and elf_write_gnu_properties. binutils/ PR binutils/23494 * testsuite/binutils-all/x86-64/pr23494a-x32.d: New file. * testsuite/binutils-all/x86-64/pr23494a.d: Likewise. * testsuite/binutils-all/x86-64/pr23494a.s: Likewise. * testsuite/binutils-all/x86-64/pr23494b-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494b.d: Likewise. * testsuite/binutils-all/x86-64/pr23494b.s: Likewise. * testsuite/binutils-all/x86-64/pr23494c-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494c.d: Likewise. * testsuite/binutils-all/x86-64/pr23494d-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494d.d: Likewise.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index ba1b495a09b..530679f9c8e 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2705,6 +2705,10 @@ extern elf_property * _bfd_elf_get_property
(bfd *, unsigned int, unsigned int);
extern bfd *_bfd_elf_link_setup_gnu_properties
(struct bfd_link_info *);
+extern bfd_size_type _bfd_elf_convert_gnu_property_size
+ (bfd *, bfd *);
+extern bfd_boolean _bfd_elf_convert_gnu_properties
+ (bfd *, asection *, bfd *, bfd_byte **, bfd_size_type *);
/* The linker may need to keep track of the number of relocs that it
decides to copy as dynamic relocs in check_relocs for each symbol.