bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/26065] binutils-gdb/ld/testsuite/ld-elf symbolic tests dl4e and


From: amodra at gmail dot com
Subject: [Bug ld/26065] binutils-gdb/ld/testsuite/ld-elf symbolic tests dl4e and dl4f fail
Date: Tue, 09 Jun 2020 06:56:51 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=26065

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
             Target|aarch64-*                   |aarch64-*, powerpc64*-*
            Summary|aarch64:                    |binutils-gdb/ld/testsuite/l
                   |binutils-gdb/ld/testsuite/l |d-elf symbolic tests dl4e
                   |d-elf symbolic tests dl4e   |and dl4f fail
                   |and dl4f fail               |
           Assignee|unassigned at sourceware dot org   |amodra at gmail dot com
   Target Milestone|---                         |2.35

--- Comment #5 from Alan Modra <amodra at gmail dot com> ---
After binutils commit bb68f22c8e the tests fail on powerpc64le-linux too.  As
far as I can tell, the testcase doesn't really have a correct answer.  If
linking against a -Bsymbolic or --dynamic-list library results in two copies of
foo1 and foo2, one in the main program and one in the shared library, then you
get the "OK2, OK4" results.  If linking against such a library only results in
one copy of foo1 and foo2 (just in the library) then you get the "OK1, OK3"
results.  What you get depends on default compiler behaviour for your target. 
On powerpc64le-linux we always generate PIC, and that allows the dl4main.c to
use the shared library foo1 and foo2.

Even on x86_64:
$ gcc -o tmpdir/dl4main.o -fno-PIE -O2 -c dl4main.c
$ gcc -o tmpdir/dl4e -no-pie -B tmpdir/ld/ tmpdir/dl4main.o tmpdir/libdl4e.so
$ tmpdir/dl4e
bar OK2
bar OK4
DSO1
DSO2
OK2
OK4
$ gcc -o tmpdir/dl4main.o -fPIE -O2 -c dl4main.c
$ gcc -o tmpdir/dl4e -pie -B tmpdir/ld/ tmpdir/dl4main.o tmpdir/libdl4e.so
$ tmpdir/dl4e
bar OK2
bar OK4
DSO1
DSO2
OK2
OK4
$ gcc -o tmpdir/dl4main.o -fPIC -O2 -c dl4main.c
$ gcc -o tmpdir/dl4e -pie -B tmpdir/ld/ tmpdir/dl4main.o tmpdir/libdl4e.so
$ tmpdir/dl4e
bar OK1
bar OK3
DSO1
DSO2
OK1
OK3

I'm leaning towards compiling dl4main.c -fPIC to resolve this bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]