Bug 26882 - --enable-textrel-check=warning exposes a few test failures on powerpc and others
Summary: --enable-textrel-check=warning exposes a few test failures on powerpc and others
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.35
: P2 normal
Target Milestone: 2.36
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-14 10:05 UTC by Sergei Trofimovich
Modified: 2022-06-22 06:29 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed: 2020-11-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich 2020-11-14 10:05:11 UTC
It's a forward of test failures observed downstream https://bugs.gentoo.org/754246 by ernsteiswuerfel.

Here is a reproducer:

$ ../binutils-gdb/configure --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=powerpc-unknown-linux-gnu --enable-textrel-check=warning
$ make
$ make -C ld check RUNTESTFLAGS='powerpc.exp'

Running /home/slyfox/dev/git/binutils-gdb/ld/testsuite/ld-powerpc/powerpc.exp ...
FAIL: Reloc section order
FAIL: TLS32 shared
FAIL: TLS shared
FAIL: TLSTOC shared
FAIL: ld-powerpc/dotsym3
FAIL: ld-powerpc/dotsym4
FAIL: ld-powerpc/ppc476-shared
FAIL: ld-powerpc/ppc476-shared2

Test failures happen because tests have textrels that generate warning on stderr.

Here is a 'Reloc section order' example:

ld/testsuite/ld-powerpc/reloc.s

 .section echidna
 .long .text

 .section platypus,"ax"
 .long .text

 .text
 b _start@plt
 nop

ld $ ../gas/as-new -o reloc.o -a32 reloc.s
ld $ ./ld-new --hash-style=sysv -o reloc.so -z norelro -melf32ppc -shared -z nocombreloc reloc.o
ld-new: warning: creating DT_TEXTREL in a shared object

I think the TEXTREL warning is correct here and should be ignored by test.

Removing '--enable-textrel-check=warning' from ./configure makes all tests pass.
Comment 1 Sourceware Commits 2020-11-17 10:30:35 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7cc340055d3993a25ded914aef88f784f16d46bc

commit 7cc340055d3993a25ded914aef88f784f16d46bc
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Nov 17 08:38:05 2020 +1030

    PR26882, --enable-textrel-check=warning test failures on powerpc
    
            PR 26882
            * testsuite/ld-powerpc/dotsym3.d: Add "-z notext" to ld options.
            * testsuite/ld-powerpc/dotsym4.d: Likewise.
            * testsuite/ld-powerpc/ppc476-shared.d: Likewise.
            * testsuite/ld-powerpc/ppc476-shared2.d: Likewise.
            * testsuite/ld-powerpc/powerpc.exp: Likewise for various tests.
            * testsuite/ld-undefined/weak-fundef.s: Add BLPLT variant.
            * testsuite/ld-undefined/weak-undef.exp: Define BLPLT for ppc32.
Comment 2 Alan Modra 2020-11-17 11:23:53 UTC
Fixed for 2.36