This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11331] New: [Regression 3.4] ld: BFD 2.14.90 20030602 internal error
- From: "danglin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jun 2003 16:38:14 -0000
- Subject: [Bug c++/11331] New: [Regression 3.4] ld: BFD 2.14.90 20030602 internal error
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11331
Summary: [Regression 3.4] ld: BFD 2.14.90 20030602 internal error
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: danglin at gcc dot gnu dot org
CC: dave at hiauly1 dot hia dot nrc dot ca,gcc-bugs at gcc
dot gnu dot org,jakub at redhat dot com
GCC build triplet: hppa-unknown-linux-gnu
GCC host triplet: hppa-unknown-linux-gnu
GCC target triplet: hppa-unknown-linux-gnu
The following error occurs linking libstdc++.so:
/home/dave/gcc-3.4/objdir/gcc/xgcc -shared-libgcc -B/home/dave/gcc-3.4/objdir/gc
c/ -nostdinc++ -L/home/dave/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src -L/home/
dave/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs -B/home/dave/opt/gnu/hppa-
linux/bin/ -B/home/dave/opt/gnu/hppa-linux/lib/ -isystem /home/dave/opt/gnu/hppa
-linux/include -isystem /home/dave/opt/gnu/hppa-linux/sys-include -shared -nostd
lib /home/dave/opt/gnu/lib/crti.o /home/dave/gcc-3.4/objdir/gcc/crtbeginS.o .li
bs/allocator-inst.o .libs/codecvt.o .libs/complex_io.o .libs/concept-inst.o .lib
s/ctype.o .libs/demangle.o .libs/ext-inst.o .libs/fstream-inst.o .libs/functexce
pt.o .libs/globals.o .libs/io-inst.o .libs/ios.o .libs/istream-inst.o .libs/limi
ts.o .libs/locale.o .libs/locale-inst.o .libs/localename.o .libs/misc-inst.o .li
bs/ostream-inst.o .libs/sstream-inst.o .libs/stdexcept.o .libs/streambuf-inst.o
.libs/string-inst.o .libs/strstream.o .libs/valarray-inst.o .libs/wstring-inst.o
.libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/mes
sages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_memb
ers.o .libs/basic_file.o .libs/c++locale.o -Wl,--whole-archive ../libmath/.libs/
libmath.a ../libsupc++/.libs/libsupc++convenience.a -Wl,--no-whole-archive -L/h
ome/dave/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src -L/home/dave/gcc-3.4/objdir/
hppa-linux/libstdc++-v3/src/.libs -lm ../libmath/.libs/libmath.a -lm ../libsupc+
+/.libs/libsupc++convenience.a -lm -L/home/dave/gcc-3.4/objdir/gcc -L/home/dave/
opt/gnu/hppa-linux/bin -L/home/dave/opt/gnu/hppa-linux/lib -L/home/dave/opt/gnu/
lib -L/home/dave/opt/gnu/lib/gcc-lib/hppa-linux/3.4 -L/home/dave/opt/gnu/lib/gcc
-lib/hppa-linux/3.4/../../../../hppa-linux/lib -L/home/dave/opt/gnu/lib/gcc-lib/
hppa-linux/3.4/../../.. -lgcc_s -lgcc -lc -lgcc_s -lm -lgcc_s -lgcc -lc -lgcc_s
/home/dave/gcc-3.4/objdir/gcc/crtendS.o /home/dave/opt/gnu/lib/crtn.o -Wl,-O1
-Wl,--version-script=libstdc++-symbol.ver -Wl,-soname -Wl,libstdc++.so.6 -o .li
bs/libstdc++.so.6.0.0
/home/dave/opt/gnu/bin/ld: BFD 2.14.90 20030602 internal error, aborting at ../.
./src/bfd/elf32-hppa.c line 3864 in elf32_hppa_relocate_section
/home/dave/opt/gnu/bin/ld: Please report this bug.
collect2: ld returned 1 exit status
The regression was introduced by the following patch:
2003-06-23 Jakub Jelinek <jakub@redhat.com>
* method.c (thunk_labelno): New variable.
(make_alias_for_thunk): New function.
(use_thunk): Use it if defined ASM_OUTPUT_DEF. Put the thunk
into the same section as the function it is calling.
Include gt-cp-method.h.
* Make-lang.in (gt-cp-method.h): Depend on s-gtype.
(cp/method.o): Depend on gt-cp-method.h.
* config-lang.in (gtfiles): Add $(srcdir)/cp/method.c.
This patch changes the method by which a thunk branches to the thunk
function. The target of the branch is now effectively a local symbol.
This local symbol lies in a linkonce section.
On the hppa-linux port, the jump to the thunk function is currently
implemented using a function descriptor in the data section. This
provides a branch that is unlimited in length. When a linkonce section
is not used, the the GNU linker does not garbage collect relocations
for symbols in the unused section. The linker aborts when hit hits a
function descriptor with an undefined symbol.
Specifically, the assembly code that causes the problem is:
.section .gnu.linkonce.t._ZNSdD1Ev,"ax",@progbits
.align 4
.weak _ZNSdD1Ev
.type _ZNSdD1Ev, @function
.LFB1804:
_ZNSdD1Ev:
.PROC
...
.PROCEND
...
.set .LTHUNK1,_ZNSdD1Ev
.align 4
.weak _ZThn8_NSdD1Ev
.type _ZThn8_NSdD1Ev, @function
_ZThn8_NSdD1Ev:
.PROC
.CALLINFO FRAME=64,CALLS,SAVE_RP
.ENTRY
addil LT'.LTHN0,%r19
ldw RT'.LTHN0(%r1),%r22
ldw 0(%sr0,%r22),%r22
bb,>=,n %r22,30,.+16
depi 0,31,2,%r22
ldw 4(%sr0,%r22),%r19
ldw 0(%sr0,%r22),%r22
be 0(%sr4,%r22)
ldo -8(%r26),%r26
.EXIT
.PROCEND
.data
.align 4
.LTHN0:
.word P'.LTHUNK1
.section .gnu.linkonce.t._ZNSdD1Ev
.size _ZThn8_NSdD1Ev, .-_ZThn8_NSdD1Ev
What is new is the .set involving .LTHUNK1 and the use .LTHUNK1 in the
function descriptor at .LTHN0. As a result, we have a function descriptor
referring to a local symbol in a linkonce section (.gnu.linkonce.t._ZNSdD1Ev).
Previously, the label _ZNSdD1Ev appeared in the function descriptor and
this didn't cause problems.