public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11331] New: [Regression 3.4] ld: BFD 2.14.90 20030602 internal error
@ 2003-06-26 16:38 danglin at gcc dot gnu dot org
  2003-06-26 19:49 ` [Bug c++/11331] " pinskia at physics dot uc dot edu
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: danglin at gcc dot gnu dot org @ 2003-06-26 16:38 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2003-08-11 15:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-26 16:38 [Bug c++/11331] New: [Regression 3.4] ld: BFD 2.14.90 20030602 internal error danglin at gcc dot gnu dot org
2003-06-26 19:49 ` [Bug c++/11331] " pinskia at physics dot uc dot edu
2003-06-26 20:14 ` dave at hiauly1 dot hia dot nrc dot ca
2003-06-26 20:32 ` jakub at gcc dot gnu dot org
2003-06-27  1:00 ` dave at hiauly1 dot hia dot nrc dot ca
2003-06-27  9:36 ` jakub at gcc dot gnu dot org
2003-06-27 16:40 ` dave at hiauly1 dot hia dot nrc dot ca
2003-07-20 13:20 ` [Bug target/11331] " pinskia at physics dot uc dot edu
2003-08-04  0:45 ` pinskia at physics dot uc dot edu
2003-08-09 16:51 ` [Bug target/11331] [3.4 Regression] " pinskia at gcc dot gnu dot org
2003-08-09 19:08 ` dave at hiauly1 dot hia dot nrc dot ca
2003-08-09 19:47 ` dave at hiauly1 dot hia dot nrc dot ca
2003-08-11 15:12 ` pinskia at gcc dot gnu dot org
2003-08-11 15:21 ` pinskia at gcc dot gnu dot org

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).