diff options
author | Alan Modra <amodra@gmail.com> | 2017-04-10 15:11:35 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-04-10 15:11:35 +0930 |
commit | 6f9dbcd42f2cf034a9a21f46842c08d2e88449db (patch) | |
tree | 620f68fd9cb1a6d263110bebafbc44d1ba46a7d1 /bfd/elf.c | |
parent | 37095d07b470ea94d578cd5ca2da032617200c52 (diff) | |
download | gdb-6f9dbcd42f2cf034a9a21f46842c08d2e88449db.zip gdb-6f9dbcd42f2cf034a9a21f46842c08d2e88449db.tar.gz gdb-6f9dbcd42f2cf034a9a21f46842c08d2e88449db.tar.bz2 |
PR21287, Inconsistent section type for .init_array and .init_array.42
PR21287 notes that .init_array is correctly given a type of
SHT_INIT_ARRAY while .init_array.nnn gets SHT_PROGBITS. This patch
fixes that problem, and properly drops warnings from the compiler that
would cause the testsuite to fail. My a44d0bd78 change to check
ld_compile status, necessary to pick up compile errors, also meant
warnings were not ignored.
bfd/
PR 21287
* elf.c (special_sections_f): Match .fini_array and .fini_array.*.
(special_sections_i): Likewise for .init_array.
(special_sections_p): Likewise for .preinit_array.
ld/
PR 21287
* testsuite/ld-elf/init-fini-arrays.d: Match INIT_ARRAY and FINI_ARRAY.
* testsuite/ld-elf/init-fini-arrays.s: Use %init_array and %fini_array
section types.
* testsuite/lib/ld-lib.exp (default_ld_compile): Trim assembler
warnings about "ignoring incorrect section type".
(run_ld_link_exec_tests, run_cc_link_tests): Delete old comment.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -2601,9 +2601,9 @@ static const struct bfd_elf_special_section special_sections_d[] = static const struct bfd_elf_special_section special_sections_f[] = { - { STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { STRING_COMMA_LEN (".fini_array"), 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".fini_array"), -2, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE }, + { NULL, 0 , 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_g[] = @@ -2628,10 +2628,10 @@ static const struct bfd_elf_special_section special_sections_h[] = static const struct bfd_elf_special_section special_sections_i[] = { - { STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { STRING_COMMA_LEN (".init_array"), 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE }, - { STRING_COMMA_LEN (".interp"), 0, SHT_PROGBITS, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".init_array"), -2, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".interp"), 0, SHT_PROGBITS, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_l[] = @@ -2649,9 +2649,9 @@ static const struct bfd_elf_special_section special_sections_n[] = static const struct bfd_elf_special_section special_sections_p[] = { - { STRING_COMMA_LEN (".preinit_array"), 0, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE }, - { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".preinit_array"), -2, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_r[] = |