This is the mail archive of the binutils@sourceware.org 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: [committed, PATCH] Update PR ld/12365 test for GCC 6


On Tue, Mar 1, 2016 at 12:49 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Feb 29, 2016 at 2:54 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Mon, Feb 29, 2016 at 2:22 PM, Paul Sturm <psturm@computervoice.com> wrote:
>>> H.J:
>>>
>>> Sorry to bother you.
>>>
>>> I am building Linux from sources and I am getting an error in the binutils
>>> 2.26 test suite:
>>>
>>> FAIL: PR ld/12365
>>>
>>> My platform is a Broadwell 1540 CPU.
>>>
>>> Using GCC 6 weekly snapshot from yesterday, glibc 2.23 and binutils 2.26,
>>> both the release and the 2.26 branch I pulled on Saturday.
>>>
>>> I see you closed out this PR last year, but I am seeing it now in 2.26.
>>>
>>> Any ideas? In what way would this failure manifest?
>>>
>>
>> I can reproduce it with GCC 6 on master branch.  I will
>> look into it.
>
> 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
>
> * testsuite/ld-plugin/lto.exp: Update PR ld/12365 test for GCC 6.
> ---
>  ld/ChangeLog                   |  4 ++++
>  ld/testsuite/ld-plugin/lto.exp | 13 ++++++++++++-
>  2 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/ld/ChangeLog b/ld/ChangeLog
> index 472ffa9..51061a8 100644
> --- a/ld/ChangeLog
> +++ b/ld/ChangeLog
> @@ -1,5 +1,9 @@
>  2016-03-01  H.J. Lu  <hongjiu.lu@intel.com>
>
> + * testsuite/ld-plugin/lto.exp: Update PR ld/12365 test for GCC 6.
> +
> +2016-03-01  H.J. Lu  <hongjiu.lu@intel.com>
> +
>   * testsuite/ld-elf/pr19162.d: Skip arc target.
>
>  2016-02-29  H.J. Lu  <hongjiu.lu@intel.com>
> diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
> index 7bf67ec..6330a17 100644
> --- a/ld/testsuite/ld-plugin/lto.exp
> +++ b/ld/testsuite/ld-plugin/lto.exp
> @@ -408,9 +408,20 @@ if { [at_least_gcc_version 4 7] } {
>     || [istarget "x86_64-*-linux*"]
>     || [istarget "amd64-*-linux*"]) } {
>   set testname "PR ld/12365"
> - set exec_output [run_host_cmd "$CC" "-O2 -flto -flto-partition=none
> -fuse-linker-plugin tmpdir/pr12365a.o tmpdir/pr12365b.o
> tmpdir/pr12365c.o"]
> + 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"]
>   if { [ regexp "undefined reference to `my_bcopy'" $exec_output ] } {
> +    # Linker should catch the reference to undefined `my_bcopy'
> +    # error caused by a GCC bug.
>      pass $testname
> + } elseif { [ string match "" $exec_output ] } {
> +    global READELF
> +    set exec_output [run_host_cmd "$READELF" "-s -W tmpdir/pr12365"]
> +    if { [ regexp "my_bcopy" $exec_output ] } {
> + # Verify that there is no `my_bcopy' symbol in executable.
> + fail $testname
> +    } {
> + pass $testname
> +    }
>   } {
>      fail $testname
>   }
> --
> 2.5.0

Backported to binutils-2_26-branch.

-- 
H.J.


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