aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-04-10 15:11:35 +0930
committerAlan Modra <amodra@gmail.com>2017-04-10 15:11:35 +0930
commit6f9dbcd42f2cf034a9a21f46842c08d2e88449db (patch)
tree620f68fd9cb1a6d263110bebafbc44d1ba46a7d1 /ld/testsuite/lib/ld-lib.exp
parentClean elfvsb files left over from previous runs (diff)
downloadbinutils-gdb-6f9dbcd42f2cf034a9a21f46842c08d2e88449db.tar.gz
binutils-gdb-6f9dbcd42f2cf034a9a21f46842c08d2e88449db.tar.bz2
binutils-gdb-6f9dbcd42f2cf034a9a21f46842c08d2e88449db.zip
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 'ld/testsuite/lib/ld-lib.exp')
-rw-r--r--ld/testsuite/lib/ld-lib.exp11
1 files changed, 5 insertions, 6 deletions
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index bdce739b66b..b60fcadf058 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -282,6 +282,11 @@ proc default_ld_compile { cc source object } {
remote_file build delete "ld.tmp"
remote_file host delete "ld.tmp"
set exec_output [prune_warnings $exec_output]
+ # Versions of gcc up to and including pre-release gcc-7, at least on
+ # some targets, generate .section directives with incorrect type.
+ # Ignore warnings from the assembler about this.
+ regsub -all "(^|\n)\[^\n\]*: ignoring incorrect section type \[^\n\]*" $exec_output "" exec_output
+ regsub -all "^\[^\n\]*: Assembler messages:\n" $exec_output "" exec_output
if [string match "" $exec_output] then {
if {![file exists $object]} then {
regexp ".*/(\[^/\]*)$" $source all dobj
@@ -1421,9 +1426,6 @@ proc run_ld_link_exec_tests { ldtests args } {
set objfile "tmpdir/$fileroot.o"
lappend objfiles $objfile
- # We ignore warnings since some compilers may generate
- # incorrect section attributes and the assembler will warn
- # them.
if { [ string match "c++" $lang ] } {
set cmd "$CXX -c $CXXFLAGS $cflags"
} else {
@@ -1598,9 +1600,6 @@ proc run_cc_link_tests { ldtests } {
set objfile "tmpdir/$fileroot.o"
lappend objfiles $objfile
- # We ignore warnings since some compilers may generate
- # incorrect section attributes and the assembler will warn
- # them.
if { [ string match "c++" $lang ] } {
set cmd "$CXX -c $CXXFLAGS $cflags"
} else {