bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/22626] New: [bisected] ld -pie produces invalid relocations on p


From: slyfox at inbox dot ru
Subject: [Bug ld/22626] New: [bisected] ld -pie produces invalid relocations on powerpc-unknown-linux-gnu-gcc
Date: Sun, 17 Dec 2017 20:38:17 +0000

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

            Bug ID: 22626
           Summary: [bisected] ld -pie produces invalid relocations on
                    powerpc-unknown-linux-gnu-gcc
           Product: binutils
           Version: 2.30 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: slyfox at inbox dot ru
  Target Milestone: ---

Original bug:
    https://bugs.gentoo.org/641474#c4

The issue manifests as non-working binary when gcc is built with
--enable-default-pie.

$ powerpc-unknown-linux-gnu-gcc a.c -o a
/usr/libexec/gcc/powerpc-unknown-linux-gnu/ld: warning: creating a DT_TEXTREL
in a shared object.

$ ./a
Segmentation fault

$ readelf -a a
Relocation section '.rela.dyn' at offset 0x2a0 contains 33 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
...
000004e2  00000906 R_PPC_ADDR16_HA  readelf: Error:  bad symbol index: 00000009
in reloc
000004ea  00000904 R_PPC_ADDR16_LO  readelf: Error:  bad symbol index: 00000009
in reloc
00000512  00000906 R_PPC_ADDR16_HA  readelf: Error:  bad symbol index: 00000009
in reloc
0000051a  00000904 R_PPC_ADDR16_LO  readelf: Error:  bad symbol index: 00000009
in reloc

It looks like .rela.dyn refer to already garbage-collected symbols.

I've bisected it down to the following commit:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=6b3b0ab89663306d17927d630304dbbd36e84570

"""Linker assigned symbols should be made dynamic by default only when
creating shared object or relocatable executable."""

Last working: 2.26.1
Tested broken: 2.27, 2.28.1

-- 
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]