This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18849] New: -m64 yields: relocation truncated to fit: R_SPARC_DISP32
- From: "visbeattie at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Dec 2004 19:50:52 -0000
- Subject: [Bug c++/18849] New: -m64 yields: relocation truncated to fit: R_SPARC_DISP32
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Teeny test program compiles, links OK with -m32. Compile/link with -m64
yields error as follows:
TestClass.o(.eh_frame+0x30):/usr/local/gcc-3.4.3/lib/gcc/sparc-sun-
solaris2.8/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.h:217:
relocation truncated to fit:
R_SPARC_DISP32 .gnu.linkonce.t._ZN13TestExceptionD1Ev
The problem is resolved when the main program does not throw test exception, or
when TestClass is omitted and main() does throw the exception.
The csh script "build" rebuilds all three files and makes an executable called
bdb. The files are TestException.[cpp,h] a minimal exception class, TestClass.
[cpp,h] a minimal class, and test.cpp - the main program. .ii's included in
the attached tar.bz2 file
Here's the build output:
245 brianb@techrad02:/home/brianb/work *> build
g++ -save-temps -m64 -g -O2 -I. TestException.cpp -c -o TestException.o
g++ -save-temps -m64 -g -O2 -I. TestClass.cpp -c -o TestClass.o
g++ -v -save-temps -m64 -g -O2 -Wl,-v -I. test.cpp TestException.o TestClass.o -
o bdb
Reading specs from /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/specs
Configured with: /export/gnu/gcc-3.4.3/configure --prefix=/usr/local/gcc-3.4.3 -
-with-ld=/usr/local/bin/ld --with-gnu-ld --with-as=/usr/local/bin/as --with-gnu-
as
Thread model: posix
gcc version 3.4.3
/usr/local/gcc-3.4.3/libexec/gcc/sparc-sun-solaris2.8/3.4.3/cc1plus -E -quiet -
v -I. -D__arch64__ -D__sparcv9 test.cpp -mptr64 -mstack-bias -mno-v8plus -
mcpu=v9 -m64 -fworking-directory -O2 -o test.ii
ignoring nonexistent directory "/usr/local/gcc-3.4.3/lib/gcc/sparc-sun-
solaris2.8/3.4.3/../../../../sparc-sun-solaris2.8/include"
#include "..." search starts here:
#include <...> search starts here:
.
/usr/local/gcc-3.4.3/lib/gcc/sparc-sun-
solaris2.8/3.4.3/../../../../include/c++/3.4.3
/usr/local/gcc-3.4.3/lib/gcc/sparc-sun-
solaris2.8/3.4.3/../../../../include/c++/3.4.3/sparc-sun-solaris2.8
/usr/local/gcc-3.4.3/lib/gcc/sparc-sun-
solaris2.8/3.4.3/../../../../include/c++/3.4.3/backward
/usr/local/include
/usr/local/gcc-3.4.3/include
/usr/local/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/include
/usr/include
End of search list.
/usr/local/gcc-3.4.3/libexec/gcc/sparc-sun-solaris2.8/3.4.3/cc1plus -
fpreprocessed test.ii -mptr64 -mstack-bias -mno-v8plus -mcpu=v9 -quiet -
dumpbase test.cpp -m64 -auxbase test -g -O2 -version -o test.s
GNU C++ version 3.4.3 (sparc-sun-solaris2.8)
compiled by GNU C version 3.4.3.
GGC heuristics: --param ggc-min-expand=65 --param ggc-min-heapsize=65536
/usr/local/bin/as -V -Qy -s -TSO -64 -Av9 -o test.o test.s
GNU assembler version 2.14 (sparc-sun-solaris2.8) using BFD version 2.14
20030612
rcv9 -v test.o TestException.o TestClass.o -lstdc++ -lm -lgcc_s_sparcv9 -lgcc -
lc -lgcc_s_sparcv9 -lgcc -lc /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-
solaris2.8/3.4.3/sparcv9/crtend.o /usr/local/gcc-3.4.3/lib/gcc/sparc-sun-
solaris2.8/3.4.3/sparcv9/crtn.o
collect2 version 3.4.3 (sparc ELF)
-lm -lgcc_s_sparcv9 -lgcc -lc -lgcc_s_sparcv9 -lgcc -lc /usr/local/gcc-
3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/sparcv9/crtend.o /usr/local/gcc-
3.4.3/lib/gcc/sparc-sun-solaris2.8/3.4.3/sparcv9/crtn.o
TestClass.o(.eh_frame+0x30):/usr/local/gcc-3.4.3/lib/gcc/sparc-sun-
solaris2.8/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.h:217:
relocation truncated to fit:
R_SPARC_DISP32 .gnu.linkonce.t._ZN13TestExceptionD1Ev
GNU ld version 2.14 20030612
Supported emulations:
elf32_sparc
elf64_sparc
GNU ld version 2.14 20030612
collect2: ld returned 1 exit status
--
Summary: -m64 yields: relocation truncated to fit: R_SPARC_DISP32
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: visbeattie at yahoo dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: sparc-sun-solaris2.8
GCC host triplet: sparc-sun-solaris2.8
GCC target triplet: sparc-sun-solaris2.8
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18849