[PATCH] PR ld/19645: Properly implement STT_COMMON
Andreas Schwab
schwab@linux-m68k.org
Tue Jan 3 12:39:00 GMT 2017
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.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
More information about the Binutils
mailing list