GNU Binutils with patches for OS216
修訂 | b468caefb6767850023aaa1ce90d1ee6ec9c8829 (tree) |
---|---|
時間 | 2016-03-02 06:18:00 |
作者 | H.J. Lu <hjl.tools@gmai...> |
Commiter | H.J. Lu |
Update PR ld/12365 test for GCC 6
PR ld/12365 test is to verify that linker catches the reference to
undefined symbol error caused by a GCC bug. Since the GCC bug has
been fixed in GCC 6, update the test to verify that there is no
reference to undefined symbol in executable
Backport from master
* testsuite/ld-plugin/lto.exp: Update PR ld/12365 test for GCC 6.
@@ -1,3 +1,10 @@ | ||
1 | +2016-03-01 H.J. Lu <hongjiu.lu@intel.com> | |
2 | + | |
3 | + Backport from master | |
4 | + 2016-03-01 H.J. Lu <hongjiu.lu@intel.com> | |
5 | + | |
6 | + * testsuite/ld-plugin/lto.exp: Update PR ld/12365 test for GCC 6. | |
7 | + | |
1 | 8 | 2016-02-26 H.J. Lu <hongjiu.lu@intel.com> |
2 | 9 | |
3 | 10 | Backport from master |
@@ -400,9 +400,20 @@ if { [at_least_gcc_version 4 7] } { | ||
400 | 400 | || [istarget "x86_64-*-linux*"] |
401 | 401 | || [istarget "amd64-*-linux*"]) } { |
402 | 402 | set testname "PR ld/12365" |
403 | - set exec_output [run_host_cmd "$CC" "-O2 -flto -flto-partition=none -fuse-linker-plugin tmpdir/pr12365a.o tmpdir/pr12365b.o tmpdir/pr12365c.o"] | |
403 | + 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"] | |
404 | 404 | if { [ regexp "undefined reference to `my_bcopy'" $exec_output ] } { |
405 | + # Linker should catch the reference to undefined `my_bcopy' | |
406 | + # error caused by a GCC bug. | |
405 | 407 | pass $testname |
408 | + } elseif { [ string match "" $exec_output ] } { | |
409 | + global READELF | |
410 | + set exec_output [run_host_cmd "$READELF" "-s -W tmpdir/pr12365"] | |
411 | + if { [ regexp "my_bcopy" $exec_output ] } { | |
412 | + # Verify that there is no `my_bcopy' symbol in executable. | |
413 | + fail $testname | |
414 | + } { | |
415 | + pass $testname | |
416 | + } | |
406 | 417 | } { |
407 | 418 | fail $testname |
408 | 419 | } |