public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Alan Modra <amodra@gmail.com>
Cc: binutils@sourceware.org
Subject: binutils causes GLIBC ifunc breakage on PowerPC64 ELFv2
Date: Sun, 17 Aug 2014 14:10:00 -0000	[thread overview]
Message-ID: <20140817141005.GA8158@hall.aurel32.net> (raw)

Hi,

Building GNU libc using binutils HEAD, I have noticed that the following
tests fails on PowerPC64 ELFv2:

| FAIL: elf/ifuncmain1staticpic
| FAIL: elf/ifuncmain4
| FAIL: elf/ifuncmain5staticpic

The last one segfault, while two first ones actually fails to build:

| gcc -nostdlib -nostartfiles -o /build/glibc/glibc-build/elf/ifuncmain4    -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both /build/glibc/glibc-build/csu/crt1.o /build/glibc/glibc-build/csu/crti.o `gcc  --print-file-name=crtbegin.o` /build/glibc/glibc-build/elf/ifuncmain4.o  -Wl,-dynamic-linker=/lib64/ld64.so.2 -Wl,-rpath-link=/build/glibc/glibc-build:/build/glibc/glibc-build/math:/build/glibc/glibc-build/elf:/build/glibc/glibc-build/dlfcn:/build/glibc/glibc-build/nss:/build/glibc/glibc-build/nis:/build/glibc/glibc-build/rt:/build/glibc/glibc-build/resolv:/build/glibc/glibc-build/crypt:/build/glibc/glibc-build/nptl /build/glibc/glibc-build/libc.so.6 /build/glibc/glibc-build/libc_nonshared.a -Wl,--as-needed /build/glibc/glibc-build/elf/ld.so -Wl,--no-as-needed -lgcc -Wl,--as-needed -lgcc_s  -Wl,--no-as-needed `gcc  --print-file-name=crtend.o` /build/glibc/glibc-build/csu/crtn.o
| /build/glibc/toolchain/bin/ld: BFD (GNU Binutils) 2.24.51.20140817 internal error, aborting at elf64-ppc.c line 14483 in ppc64_elf_relocate_section
| 
| /build/glibc/toolchain/bin/ld: Please report this bug.
| 
| collect2: error: ld returned 1 exit status

| gcc -pie -Wl,-O1 -nostdlib -nostartfiles -o /build/glibc/glibc-build/elf/ifuncmain1vispie    -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both /build/glibc/glibc-build/csu/Scrt1.o /build/glibc/glibc-build/csu/crti.o `gcc  --print-file-name=crtbeginS.o` /build/glibc/glibc-build/elf/ifuncmain1vispie.o /build/glibc/glibc-build/elf/ifuncmod1.so  -Wl,-dynamic-linker=/lib64/ld64.so.2 -Wl,-rpath-link=/build/glibc/glibc-build:/build/glibc/glibc-build/math:/build/glibc/glibc-build/elf:/build/glibc/glibc-build/dlfcn:/build/glibc/glibc-build/nss:/build/glibc/glibc-build/nis:/build/glibc/glibc-build/rt:/build/glibc/glibc-build/resolv:/build/glibc/glibc-build/crypt:/build/glibc/glibc-build/nptl /build/glibc/glibc-build/libc.so.6 /build/glibc/glibc-build/libc_nonshared.a -Wl,--as-needed /build/glibc/glibc-build/elf/ld.so -Wl,--no-as-needed -lgcc -Wl,--as-needed -lgcc_s  -Wl,--no-as-needed `gcc  --print-file-name=crtendS.o` /build/glibc/glibc-build/csu/crtn.o
| /build/glibc/toolchain/bin/ld: BFD (GNU Binutils) 2.24.51.20140817 internal error, aborting at elf64-ppc.c line 14483 in ppc64_elf_relocate_section
|
| /build/glibc/toolchain/bin/ld: Please report this bug.
| 
| collect2: error: ld returned 1 exit status

Bisecting the issue I have found the problem has been introduced by this
commit:

| commit d1eca1e41ddae8c3cd925be827640de919301432
| Author: Alan Modra <amodra@gmail.com>
| Date:   Wed Jul 2 15:07:18 2014 +0930
| 
|     Taking an undefined function's address in an executable
| 
|     doesn't always mean you need to define a function symbol on plt code.
|     If all references are in read-write sections, then using dynamic relocs
|     is OK.
| 
|     bfd/
|         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Clear
|         pointer_equality_needed when !readonly_dynrelocs.
|         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
|     ld/testsuite/
|         * ld-powerpc/ambiguousv1.d: Match symbol table too.
|         * ld-powerpc/ambiguousv2.d: Likewise.
|         * ld-powerpc/ambiguousv1b.d: New.
|         * ld-powerpc/ambiguousv2b.d: New.
|         * ld-powerpc/powerpc.exp: Run new tests.

Reverting this commit on top on current binutils HEAD makes the GNU libc
testsuite to pass. Do you have an idea what could be the problem? I
guess you will be able to reproduce by yourself, if not don't hesitate
to ask for more details.

Thanks,
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

             reply	other threads:[~2014-08-17 14:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-17 14:10 Aurelien Jarno [this message]
2014-08-18 11:28 ` Alan Modra
2014-08-18 12:05   ` Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140817141005.GA8158@hall.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).