mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 17:18:24 +08:00
Prune BFD warnings for unknown GNU properties
When glibc is enabled with the new GNU_PROPERTY_X86_XXX bits: https://groups.google.com/forum/#!topic/x86-64-abi/-D05GQ3kWrA BFD will issue an unknown GNU property warning like warning: tmpdir/ld1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001 and ignore such GNU properties. This patch adds prune_warnings_extra to prune such warnings on release branches and updates prune_warnings to call prune_warnings_extra. binutils/ PR ld/23536 * Makefile.am (development.exp): New target. (EXTRA_DEJAGNU_SITE_CONFIG): New. (DISTCLEANFILES): Add development.exp. * Makefile.in: Regenerated. * testsuite/binutils-all/objcopy.exp (strip_test): Call prune_warnings to prune BFD output. (strip_test_with_saving_a_symbol): Likewise. (objcopy_test_without_global_symbol): Likewise. * testsuite/lib/binutils-common.exp (prune_warnings_extra): New proc. (prune_warnings): Likewise. gas/ PR ld/23536 * Makefile.am (development.exp): New target. (EXTRA_DEJAGNU_SITE_CONFIG): New. (DISTCLEANFILES): Add development.exp. * Makefile.in: Regenerated. ld/ PR ld/23536 * Makefile.am (development.exp): New target. (EXTRA_DEJAGNU_SITE_CONFIG): New. (DISTCLEANFILES): Add development.exp. * Makefile.in: Regenerated. * testsuite/ld-bootstrap/bootstrap.exp: Call prune_warnings to prune BFD output. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/lib/ld-lib.exp (prune_warnings): Removed. * testsuite/ld-elf/shared.exp: Allow "\n" in linker warnings.
This commit is contained in:
@ -1,3 +1,18 @@
|
||||
2018-08-23 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/23536
|
||||
* Makefile.am (development.exp): New target.
|
||||
(EXTRA_DEJAGNU_SITE_CONFIG): New.
|
||||
(DISTCLEANFILES): Add development.exp.
|
||||
* Makefile.in: Regenerated.
|
||||
* testsuite/binutils-all/objcopy.exp (strip_test): Call
|
||||
prune_warnings to prune BFD output.
|
||||
(strip_test_with_saving_a_symbol): Likewise.
|
||||
(objcopy_test_without_global_symbol): Likewise.
|
||||
* testsuite/lib/binutils-common.exp (prune_warnings_extra):
|
||||
New proc.
|
||||
(prune_warnings): Likewise.
|
||||
|
||||
2018-08-23 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* README-how-to-make-a-release: Document setting "experimental"
|
||||
|
@ -200,6 +200,10 @@ check-DEJAGNU: site.exp
|
||||
else echo "WARNING: could not find \`runtest'" 1>&2; :;\
|
||||
fi
|
||||
|
||||
development.exp: $(BFDDIR)/development.sh
|
||||
$(EGREP) "[development|experimental]=" $(BFDDIR)/development.sh \
|
||||
| $(AWK) -F= '{ print "set " $$1 " " $$2 }' > $@
|
||||
|
||||
installcheck-local:
|
||||
/bin/sh $(srcdir)/sanity.sh $(bindir)
|
||||
|
||||
@ -491,7 +495,10 @@ all: info
|
||||
# development.sh is used to determine -Werror default.
|
||||
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
|
||||
|
||||
DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak embedspu
|
||||
EXTRA_DEJAGNU_SITE_CONFIG = development.exp
|
||||
|
||||
DISTCLEANFILES = sysroff.c sysroff.h site.exp development.exp \
|
||||
site.bak embedspu
|
||||
|
||||
MOSTLYCLEANFILES = sysinfo$(EXEEXT_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD) \
|
||||
binutils.log binutils.sum abcdefgh*
|
||||
|
@ -737,7 +737,10 @@ EXTRA_DIST = arparse.c arparse.h arlex.c sysinfo.c sysinfo.h \
|
||||
|
||||
# development.sh is used to determine -Werror default.
|
||||
CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
|
||||
DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak embedspu
|
||||
EXTRA_DEJAGNU_SITE_CONFIG = development.exp
|
||||
DISTCLEANFILES = sysroff.c sysroff.h site.exp development.exp \
|
||||
site.bak embedspu
|
||||
|
||||
MOSTLYCLEANFILES = sysinfo$(EXEEXT_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD) \
|
||||
binutils.log binutils.sum abcdefgh*
|
||||
|
||||
@ -1399,6 +1402,10 @@ check-DEJAGNU: site.exp
|
||||
else echo "WARNING: could not find \`runtest'" 1>&2; :;\
|
||||
fi
|
||||
|
||||
development.exp: $(BFDDIR)/development.sh
|
||||
$(EGREP) "[development|experimental]=" $(BFDDIR)/development.sh \
|
||||
| $(AWK) -F= '{ print "set " $$1 " " $$2 }' > $@
|
||||
|
||||
installcheck-local:
|
||||
/bin/sh $(srcdir)/sanity.sh $(bindir)
|
||||
|
||||
|
@ -440,6 +440,7 @@ proc strip_test { } {
|
||||
remote_file build delete tmpdir/libstrip.a
|
||||
|
||||
set exec_output [binutils_run $AR "rc $archive ${objfile}"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string equal "" $exec_output] {
|
||||
fail $test
|
||||
unresolved "$test preserving OS/ABI"
|
||||
@ -447,6 +448,7 @@ proc strip_test { } {
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $STRIP "-g $archive"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string equal "" $exec_output] {
|
||||
fail $test
|
||||
unresolved "$test preserving OS/ABI"
|
||||
@ -454,6 +456,7 @@ proc strip_test { } {
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $STRIP "$STRIPFLAGS $archive"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string equal "" $exec_output] {
|
||||
fail $test
|
||||
unresolved "$test preserving OS/ABI"
|
||||
@ -488,12 +491,14 @@ proc strip_test { } {
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $STRIP "$STRIPFLAGS $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string equal "" $exec_output] {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $NM "-a $NMFLAGS $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string match "*: no symbols*" $exec_output] {
|
||||
fail $test
|
||||
return
|
||||
@ -529,12 +534,14 @@ proc strip_test_with_saving_a_symbol { } {
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $STRIP "$STRIPFLAGS -K main -K _main $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string equal "" $exec_output] {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $NM "$NMFLAGS $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if {![regexp {^([0-9a-fA-F]+)?[ ]+[TD] main} $exec_output] \
|
||||
&& ![regexp {^([0-9a-fA-F]+)?[ ]+T _main} $exec_output]} {
|
||||
fail $test
|
||||
@ -1195,12 +1202,14 @@ proc objcopy_test_without_global_symbol { } {
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $OBJCOPY "$OBJCOPYFLAGS --strip-unneeded $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string equal "" $exec_output] {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $OBJDUMP "$OBJDUMPFLAGS -t $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if {![regexp "no symbols" $exec_output]} {
|
||||
fail $test
|
||||
return
|
||||
|
@ -397,3 +397,50 @@ proc regexp_diff { file_1 file_2 args } {
|
||||
|
||||
return $differences
|
||||
}
|
||||
|
||||
# prune_warnings_extra -- delete extra warnings from TEXT.
|
||||
#
|
||||
# An example is:
|
||||
# ld: warning: /lib64/ld-linux-x86-64.so.2: unsupported GNU_PROPERTY_TYPE (5) type : 0xc0010001
|
||||
proc prune_warnings_extra { text } {
|
||||
global experimental
|
||||
# Warnings are only pruned from non-experimental code (ie code not
|
||||
# on a release branch). For experimental code we want the warnings
|
||||
# as they indicate that the sources need to be updated to recognise
|
||||
# the new properties.
|
||||
if { "$experimental" == "false" } {
|
||||
# The "\\1" is to try to preserve a "\n" but only if necessary.
|
||||
regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*unsupported GNU_PROPERTY_TYPE\[^\n\]*\n?)+" $text "\\1" text
|
||||
}
|
||||
return $text
|
||||
}
|
||||
|
||||
# This definition is taken from an unreleased version of DejaGnu. Once
|
||||
# that version gets released, and has been out in the world for a few
|
||||
# months at least, it may be safe to delete this copy.
|
||||
if ![string length [info proc prune_warnings]] {
|
||||
#
|
||||
# prune_warnings -- delete various system verbosities from TEXT
|
||||
#
|
||||
# An example is:
|
||||
# ld.so: warning: /usr/lib/libc.so.1.8.1 has older revision than expected 9
|
||||
#
|
||||
# Sites with particular verbose os's may wish to override this in site.exp.
|
||||
#
|
||||
proc prune_warnings { text } {
|
||||
# This is from sun4's. Do it for all machines for now.
|
||||
# The "\\1" is to try to preserve a "\n" but only if necessary.
|
||||
regsub -all "(^|\n)(ld.so: warning:\[^\n\]*\n?)+" $text "\\1" text
|
||||
# It might be tempting to get carried away and delete blank lines, etc.
|
||||
# Just delete *exactly* what we're ask to, and that's it.
|
||||
set text [prune_warnings_extra $text]
|
||||
return $text
|
||||
}
|
||||
} elseif { [info procs saved-prune_warnings] == [list] } {
|
||||
rename prune_warnings saved-prune_warnings
|
||||
proc prune_warnings { text } {
|
||||
set text [saved-prune_warnings $text]
|
||||
set text [prune_warnings_extra $text]
|
||||
return $text
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user