This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] PR ld/19645: Properly implement STT_COMMON
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 9 Jan 2017 09:20:19 -0800
- Subject: Re: [PATCH] PR ld/19645: Properly implement STT_COMMON
- Authentication-results: sourceware.org; auth=none
- References: <20160222213825.GA8172@intel.com> <CAMe9rOqb-XQft4YgxMwoOz87=DgJ3H5vfj4K7tHQwX3Qc6=wsA@mail.gmail.com> <874m1g49mr.fsf@linux-m68k.org> <87zij82u83.fsf@linux-m68k.org>
On Tue, Jan 3, 2017 at 4:39 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> On Jan 03 2017, Andreas Schwab <schwab@linux-m68k.org> wrote:
>
>> On Feb 26 2016, "H.J. Lu" <hjl.tools@gmail.com> wrote:
>>
>>> diff --git a/ld/testsuite/ld-elfcomm/elfcomm.exp b/ld/testsuite/ld-elfcomm/elfcomm.exp
>>> index 81fd520..926b98c 100644
>>> --- a/ld/testsuite/ld-elfcomm/elfcomm.exp
>>> +++ b/ld/testsuite/ld-elfcomm/elfcomm.exp
>>
>>> @@ -187,7 +170,9 @@ if [istarget nios2*-*-*] {
>>> # Explicitly use "-fcommon" so that even if $CFLAGS includes
>>> # "-fno-common", these tests are compiled as expected.
>>> if { ![ld_compile "$CC $CFLAGS -fcommon" $srcdir/$subdir/common1a.c tmpdir/common1a.o]
>>> - || ![ld_compile "$CC $CFLAGS -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1b.o] } {
>>> + || ![ld_compile "$CC $CFLAGS -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1b.o]
>>> + || ![ld_compile "$CC $CFLAGS -Wa,--elf-stt-common=yes -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1c.o] } {
>>
>> This is passing --elf-stt-common=yes to the installed assembler, not the
>> newly built one.
>
> Actually, the problem is that -B doesn't override DEFAULT_ASSEMBLER or
> DEFAULT_LINKER. Thus if the compiler was built with --with-as or
> --with-ld then many binutils tests do the wrong thing.
>
> Andreas.
>
True. Many linker tests use -B to select the newly built assembler
and linker. Should we disable linker tests if -B doesn't work?
--
H.J.