This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR ld/15146: Reference from dummy plugin symbol isn't removed

HJ's recently added testcases fail on my Ubuntu x86_64 box, because
the system compiler invokes ld with --as-needed.  Also, two older
testcases are now failing, likely due to PR 15146 change to
elflink.c.  The LTO 7 failure is easy to fix, it's a simple case of not being seen as needed when --as-needed is in effect.
More on the LTO 9 failure later.

	* ld-plugin/lto.exp (Build Add -Wl,--no-as-needed.
	(PR ld/15146 (1), (2)): Likewise.
	(LTO 7): Likewise.

Index: ld/testsuite/ld-plugin/lto.exp
RCS file: /cvs/src/src/ld/testsuite/ld-plugin/lto.exp,v
retrieving revision 1.4
diff -u -p -r1.4 lto.exp
--- ld/testsuite/ld-plugin/lto.exp	16 Feb 2013 17:54:35 -0000	1.4
+++ ld/testsuite/ld-plugin/lto.exp	18 Feb 2013 08:31:43 -0000
@@ -187,10 +187,10 @@ set lto_link_elf_tests {
    "-shared" "-O2 -fpic"
    {pr15146b.c} {} "" "c"}
-   "-shared tmpdir/" "-O2 -fpic"
+   "-shared -Wl,--no-as-needed tmpdir/" "-O2 -fpic"
    {pr15146c.c} {} "" "c"}
   {"PR ld/15146 (1)"
-   "-O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries tmpdir/pr15146a.o tmpdir/" ""
+   "-O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries -Wl,--no-as-needed tmpdir/pr15146a.o tmpdir/" ""
    {dummy.c} {{"readelf" {-d} "pr15146.d"}} "pr15146a.exe"}
   {"Build libpr15146d.a"
    "" "-flto -O2"
@@ -271,7 +271,7 @@ set lto_run_tests {
 # LTO run-time tests for ELF
 set lto_run_elf_tests {
   {"LTO 7"
-   "-O2 -flto -fuse-linker-plugin tmpdir/lto-7b.o tmpdir/lto-7c.o tmpdir/lto-7a.o tmpdir/" ""
+   "-O2 -flto -fuse-linker-plugin tmpdir/lto-7b.o tmpdir/lto-7c.o tmpdir/lto-7a.o -Wl,--no-as-needed tmpdir/" ""
    {dummy.c} "lto-7.exe" "lto-7.out" "" "c"}
   {"LTO 8"
    "-O2 -flto -fuse-linker-plugin tmpdir/lto-8b.o tmpdir/lto-8a.o" ""
@@ -288,7 +288,7 @@ if { [is_elf_format]
      && [run_host_cmd_yesno $CC "-shared -fPIC $srcdir/$subdir/dummy.c -o tmpdir/"] } {
     run_cc_link_tests $lto_link_elf_tests
     set testname "PR ld/15146 (2)"
-    set exec_output [run_host_cmd "$CC" "$gcc_gas_flag $gcc_ld_flag -O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries tmpdir/pr15146d.o tmpdir/"]
+    set exec_output [run_host_cmd "$CC" "$gcc_gas_flag $gcc_ld_flag -O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries -Wl,--no-as-needed tmpdir/pr15146d.o tmpdir/"]
     if { [ regexp "ltrans.o: undefined reference to symbol 'xxx'" $exec_output ] } {
 	pass $testname
     } {

Alan Modra
Australia Development Lab, IBM

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]