Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 754246 - sys-devel/binutils-2.35.1: 9 ld tests fail on ppc
Summary: sys-devel/binutils-2.35.1: 9 ld tests fail on ppc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: Normal normal (vote)
Assignee: PPC Porters
URL: https://sourceware.org/PR26882
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2020-11-13 12:56 UTC by ernsteiswuerfel
Modified: 2021-04-10 01:32 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_754246.txt,5.90 KB, text/plain)
2020-11-13 12:56 UTC, ernsteiswuerfel
Details
build.log.xz (binutils-2.35.1:20201113-112012.log.xz,45.04 KB, application/x-xz)
2020-11-13 12:58 UTC, ernsteiswuerfel
Details
ld.log.xz (ld.log.xz,90.65 KB, application/x-xz)
2020-11-13 12:58 UTC, ernsteiswuerfel
Details
test-suite.log (test-suite.log,200 bytes, text/plain)
2020-11-13 12:58 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2020-11-13 12:56:26 UTC
Created attachment 671200 [details]
emerge --info

3 more test failures than 2.34 (bug #714922) and different ones as it seems:

[...]
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
FAIL: weak undefined function symbols in shared lib

                === ld Summary ===

# of expected passes            1499
# of unexpected failures        9
# of unexpected successes       1
# of expected failures          4
# of untested testcases         1
# of unsupported tests          134
./ld-new 2.35.1
Comment 1 ernsteiswuerfel archtester 2020-11-13 12:58:10 UTC
Created attachment 671203 [details]
build.log.xz
Comment 2 ernsteiswuerfel archtester 2020-11-13 12:58:25 UTC
Created attachment 671206 [details]
ld.log.xz
Comment 3 ernsteiswuerfel archtester 2020-11-13 12:58:50 UTC
Created attachment 671209 [details]
test-suite.log
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2020-11-14 09:14:59 UTC
Let's try to address at least some of failures. I ran tests on 2.35.1 and can see the same failures:

Running /var/tmp/portage/sys-devel/binutils-2.35.1/work/binutils-2.35.1/ld/testsuite/ld-powerpc/powerpc.exp ...
FAIL: Reloc section order
...

build/ld/ls.log contains failure details:

/var/tmp/portage/sys-devel/binutils-2.35.1/work/build/ld/../gas/as-new   -I/var/tmp/portage/sys-devel/binutils-2.35.1/work/binutils-2.35.1/ld/testsuite/ld-powerpc   -o tmpdir/reloc.o -a32 /var
/tmp/portage/sys-devel/binutils-2.35.1/work/binutils-2.35.1/ld/testsuite/ld-powerpc/reloc.s
Executing on host: sh -c {/var/tmp/portage/sys-devel/binutils-2.35.1/work/build/ld/../gas/as-new   -I/var/tmp/portage/sys-devel/binutils-2.35.1/work/binutils-2.35.1/ld/testsuite/ld-powerpc   -
o tmpdir/reloc.o -a32 /var/tmp/portage/sys-devel/binutils-2.35.1/work/binutils-2.35.1/ld/testsuite/ld-powerpc/reloc.s 2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
/var/tmp/portage/sys-devel/binutils-2.35.1/work/build/ld/ld-new  --hash-style=sysv  -o tmpdir/reloc.so -z norelro -L/var/tmp/portage/sys-devel/binutils-2.35.1/work/binutils-2.35.1/ld/testsuite
/ld-powerpc -melf32ppc -shared -z nocombreloc tmpdir/reloc.o
Executing on host: sh -c {/var/tmp/portage/sys-devel/binutils-2.35.1/work/build/ld/ld-new  --hash-style=sysv  -o tmpdir/reloc.so -z norelro -L/var/tmp/portage/sys-devel/binutils-2.35.1/work/bi
nutils-2.35.1/ld/testsuite/ld-powerpc -melf32ppc -shared -z nocombreloc tmpdir/reloc.o  2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
/var/tmp/portage/sys-devel/binutils-2.35.1/work/build/ld/.libs/ld-new: warning: creating DT_TEXTREL in a shared object
/var/tmp/portage/sys-devel/binutils-2.35.1/work/build/ld/.libs/ld-new: warning: creating DT_TEXTREL in a shared object
FAIL: Reloc section order

The test itself does not seem to have space for TEXTRELs:

ld/testsuite/ld-powerpc/reloc.s

 .section echidna
 .long .text

 .section platypus,"ax"
 .long .text

 .text
 b _start@plt
 nop

Let's see where it comes from.

The test itself:

  # Actions:
  # objdump: Apply objdump options on result.  Compare with regex (last arg).
  # nm: Apply nm options on result.  Compare with regex (last arg).
  # readelf: Apply readelf options on result.  Compare with regex (last arg)
  set ppcelftests {
      {"Reloc section order" "-melf32ppc -shared -z nocombreloc" "" "-a32" {reloc.s}
       {{objdump -hw reloc.d}} "reloc.so"}
      ...

  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
  ld $ LANG=C ../binutils/objdump -hw reloc.so

  reloc.so:     file format elf32-powerpc

  Sections:
  Idx Name          Size      VMA       LMA       File off  Algn  Flags
    0 .hash         00000018  00000094  00000094  00000094  2**2  CONTENTS, ALLOC, LOAD, READONLY, DATA
    1 .dynsym       00000030  000000ac  000000ac  000000ac  2**2  CONTENTS, ALLOC, LOAD, READONLY, DATA
    2 .dynstr       00000008  000000dc  000000dc  000000dc  2**0  CONTENTS, ALLOC, LOAD, READONLY, DATA
    3 .relaplatypus 0000000c  000000e4  000000e4  000000e4  2**2  CONTENTS, ALLOC, LOAD, READONLY, DATA
    4 .rela.plt     0000000c  000000f0  000000f0  000000f0  2**2  CONTENTS, ALLOC, LOAD, READONLY, DATA
    5 .text         00000008  000000fc  000000fc  000000fc  2**0  CONTENTS, ALLOC, LOAD, READONLY, CODE
    6 platypus      00000004  00000104  00000104  00000104  2**0  CONTENTS, ALLOC, LOAD, READONLY, CODE
    7 .eh_frame     00000000  00000108  00000108  00000108  2**2  CONTENTS, ALLOC, LOAD, READONLY, DATA
    8 .dynamic      000000a0  00010108  00010108  00000108  2**2  CONTENTS, ALLOC, LOAD, DATA
    9 .got          00000010  000101a8  000101a8  000001a8  2**2  CONTENTS, ALLOC, LOAD, CODE
   10 .plt          00000054  000101b8  000101b8  000001b8  2**2  ALLOC, CODE
   11 echidna       00000004  00000000  00000000  000001b8  2**0  CONTENTS, READONLY

I'm not sure whar 'reloc.d' regexp corresponds to.
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2020-11-14 09:18:50 UTC
Ah, 'reloc.d' is actually a complex regex script on it's own:

"""
# Test that orphan reloc sections are placed before .rela.plt even when
# .rela.plt is the only reloc section.

#source: reloc.s
#ld: -shared -z nocombreloc
#objdump: -hw

.*: +file format elf.*
#...
.*\.relaplatypus.*
#...
.*\.rela\.plt.*
#pass
"""
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2020-11-14 10:00:46 UTC
It's an effect of '--enable-textrel-check=warning' option. On upstream binutils it's enough to trigger it as:

$ ../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

I think the errors are real as TEXTRELs are present in section:

"""
# LANG=C objdump -d -R reloc.so
reloc.so:     file format elf32-powerpc
Disassembly of section .text:
000000fc <.text>:
  fc:   48 01 01 04     b       10200 <_start@plt>
 100:   60 00 00 00     nop
Disassembly of section platypus:
00000104 <platypus>:
 104:   00 00 00 00     .long 0x0
                        104: R_PPC_RELATIVE     *ABS*+0xfc
"""

The warnings are expected.
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2020-11-14 10:05:35 UTC
Filed https://sourceware.org/PR26882 upstream.
Comment 8 ernsteiswuerfel archtester 2021-04-10 01:32:06 UTC
Fixed upstream in 2.36: https://sourceware.org/bugzilla/show_bug.cgi?id=26882