aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-08-23 06:12:37 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-08-23 06:12:50 -0700
commit7dd36a6f1ca92cd4ca4776064c604cda7755bc44 (patch)
tree0e8bd6bf4cc5c2bfcaf2a0052cf6ef5fe91b9ff4 /ld
parent44c2eb66808a928b8101f1b880f3482312cbcc1e (diff)
downloadgdb-7dd36a6f1ca92cd4ca4776064c604cda7755bc44.zip
gdb-7dd36a6f1ca92cd4ca4776064c604cda7755bc44.tar.gz
gdb-7dd36a6f1ca92cd4ca4776064c604cda7755bc44.tar.bz2
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.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog13
-rw-r--r--ld/Makefile.am8
-rw-r--r--ld/Makefile.in9
-rw-r--r--ld/testsuite/ld-bootstrap/bootstrap.exp1
-rw-r--r--ld/testsuite/ld-elf/shared.exp4
-rw-r--r--ld/testsuite/ld-plugin/lto.exp1
-rw-r--r--ld/testsuite/lib/ld-lib.exp23
7 files changed, 31 insertions, 28 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 39f76aa..66f890c 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,16 @@
+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/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.
+
2018-08-21 Nick Clifton <nickc@redhat.com>
PR 23426
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 7ae1c53..9884110 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -1905,6 +1905,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 }' > $@
+#
#
# Build a dummy plugin using libtool.
#
@@ -1952,6 +1956,8 @@ MAINTAINERCLEANFILES = configdoc.texi ld.1
CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \
$(BFDDIR)/development.sh
+EXTRA_DEJAGNU_SITE_CONFIG = development.exp
+
MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
ldemul-list.h crtbegin.@OBJEXT@ crtend.@OBJEXT@ ld.log ld.sum
mostlyclean-local:
@@ -1997,7 +2003,7 @@ diststuff: info $(EXTRA_DIST)
# ld.1 to support parallel build.
info-recursive: ld.1
-DISTCLEANFILES = tdirs site.exp site.bak stringify.sed
+DISTCLEANFILES = tdirs site.exp development.exp site.bak stringify.sed
distclean-local:
rm -rf ldscripts
diff --git a/ld/Makefile.in b/ld/Makefile.in
index bfb5599..3ddd581 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -1008,7 +1008,7 @@ ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) \
$(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP)
ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
-
+#
#
# Build a dummy plugin using libtool.
#
@@ -1034,6 +1034,7 @@ MAINTAINERCLEANFILES = configdoc.texi ld.1 ld.info
CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \
$(BFDDIR)/development.sh
+EXTRA_DEJAGNU_SITE_CONFIG = development.exp
MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
ldemul-list.h crtbegin.@OBJEXT@ crtend.@OBJEXT@ ld.log ld.sum
@@ -1044,7 +1045,7 @@ CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 spu_ovl.s spu_ovl.@OBJEXT@ spu_icache.s
EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.@OBJEXT@_c \
emultempl/spu_icache.@OBJEXT@_c deffilep.c deffilep.h $(man_MANS)
-DISTCLEANFILES = tdirs site.exp site.bak stringify.sed
+DISTCLEANFILES = tdirs site.exp development.exp site.bak stringify.sed
all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -3489,6 +3490,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 }' > $@
+
# DOCUMENTATION TARGETS
# Manual configuration file; not usually attached to normal configuration,
# because almost all configs use "gen" version of manual.
diff --git a/ld/testsuite/ld-bootstrap/bootstrap.exp b/ld/testsuite/ld-bootstrap/bootstrap.exp
index 5c79e03..9c4dbd6 100644
--- a/ld/testsuite/ld-bootstrap/bootstrap.exp
+++ b/ld/testsuite/ld-bootstrap/bootstrap.exp
@@ -168,6 +168,7 @@ foreach flags $test_flags {
if {"$do_strip" == "yes"} {
verbose -log "$strip tmpdir/ld1"
catch "exec $strip tmpdir/ld1" exec_output
+ set exec_output [prune_warnings $exec_output]
if ![string match "" $exec_output] then {
verbose -log "$exec_output"
fail $testname
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 7970fe9..cdb171d 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -513,7 +513,7 @@ set build_tests {
"-shared" "-fPIC"
{beginwarn.c end.c}
{{readelf {-S --wide} libbarw.rd}
- {warning "^.*beginwarn.c:7: warning: function foo is deprecated$"}}
+ {warning "^.*beginwarn.c:7: warning: function foo is deprecated\n?$"}}
"libbarw.so" "c"}
{"Build hidden libbar.so"
"-shared" "-fPIC"
@@ -792,7 +792,7 @@ set run_tests [list \
[list "Run warn with versioned libfoo.so" \
"-Wl,--no-as-needed tmpdir/beginwarn.o tmpdir/libfoov.so" "" \
{main.c} "warn" "warn.out" \
- "" "c" {^.*beginwarn.c:7: warning: function foo is deprecated$} ] \
+ "" "c" {^.*beginwarn.c:7: warning: function foo is deprecated\n?$} ] \
[list "Run protected with versioned libfoo.so" \
"-Wl,--no-as-needed tmpdir/begin.o tmpdir/libfoov.so tmpdir/endprotected.o" "" \
{main.c} "protected" "normal.out" ] \
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 5c581e4..18829fd 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -515,6 +515,7 @@ if { [at_least_gcc_version 4 7] } {
|| [istarget "amd64-*-linux*"]) } {
set testname "PR ld/12365"
set exec_output [run_host_cmd "$CC" "-O2 -flto -flto-partition=none -fuse-linker-plugin -o tmpdir/pr12365 tmpdir/pr12365a.o tmpdir/pr12365b.o tmpdir/pr12365c.o"]
+ set exec_output [prune_warnings $exec_output]
if { [ regexp "undefined reference to `my_bcopy'" $exec_output ] } {
# Linker should catch the reference to undefined `my_bcopy'
# error caused by a GCC bug.
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 2e7d368..1833bdd 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1417,29 +1417,6 @@ proc run_ld_link_tests { ldtests args } {
}
}
-# 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.
- return $text
- }
-}
-
# ldtests contains test-items with 3 items followed by 1 lists, 2 items
# and 3 optional items:
# 0:name