Bug 10474 - relocation truncated to fit: R_PPC_REL24 errors
Summary: relocation truncated to fit: R_PPC_REL24 errors
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.19
: P1 critical
Target Milestone: ---
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-02 17:26 UTC by Jim Gifford
Modified: 2009-08-12 23:32 UTC (History)
2 users (show)

See Also:
Host: powerpc-unknown-linux-gnu
Target:
Build:
Last reconfirmed: 2009-08-08 01:38:14


Attachments
Text File from Latest Test (2.86 KB, text/plain)
2009-08-07 15:37 UTC, Jim Gifford
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Gifford 2009-08-02 17:26:06 UTC
Related to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37739

GCC and Firefox fail to build due to the following errors. At this point my team
at Cross-LFS believes this is related to ld issues for PPC. We have 2 confirmed
reports of problems, with GCC and firefox and lot of other unconfirmed reports.

Here's the error for GCC, which is the most critical in our mind and
demonstrates the error.

gcc -isystem /usr/include -m32   -g -fkeep-inline-functions -DIN_GCC   -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual
-Wold-style-definition -Wc++-compat -Wmissing-format-attribute -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common 
-DHAVE_CONFIG_H -Wl,-rpath-link,/lib -m32  -Wl,--relax -o cc1-dummy c-lang.o
stub-objc.o attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o
c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o
c-ppoutput.o c-cppbuiltin.o c-objc-common.o c-dump.o c-pch.o c-parser.o
rs6000-c.o c-gimplify.o tree-mudflap.o c-pretty-print.o c-omp.o dummy-checksum.o \
          main.o tree-browser.o libbackend.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a ../libcpp/libcpp.a   ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a -Lyes/lib -Lyes/lib -lmpfr -lgmp -ldl
libbackend.a(tree-ssa-ccp.o): In function `VEC_basic_block_gc_safe_grow_cleared':
/var/build_system/work/gcc-4.4.1/gcc/basic-block.h:288: relocation truncated to
fit: R_PPC_REL24 against symbol `memset@@GLIBC_2.0' defined in .plt section in
/usr/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_basic_block_heap_free':
/var/build_system/work/gcc-4.4.1/gcc/basic-block.h:289: relocation truncated to
fit: R_PPC_REL24 against symbol `free@@GLIBC_2.0' defined in .plt section in
/usr/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_basic_block_heap_copy':
/var/build_system/work/gcc-4.4.1/gcc/basic-block.h:289: relocation truncated to
fit: R_PPC_REL24 against symbol `memcpy@@GLIBC_2.0' defined in .plt section in
/usr/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_basic_block_heap_safe_grow_cleared':
/var/build_system/work/gcc-4.4.1/gcc/basic-block.h:289: relocation truncated to
fit: R_PPC_REL24 against symbol `memset@@GLIBC_2.0' defined in .plt section in
/usr/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_base_quick_insert':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:33: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_base_ordered_remove':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:33: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_base_block_remove':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:33: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_heap_free':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:34: relocation truncated to fit:
R_PPC_REL24 against symbol `free@@GLIBC_2.0' defined in .plt section in
/usr/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_heap_copy':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:34: relocation truncated to fit:
R_PPC_REL24 against symbol `memcpy@@GLIBC_2.0' defined in .plt section in
/usr/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_heap_safe_grow_cleared':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:34: relocation truncated to fit:
R_PPC_REL24 against symbol `memset@@GLIBC_2.0' defined in .plt section in
/usr/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_gc_copy':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:35: additional relocation
overflows omitted from the output
collect2: ld returned 1 exit status
make[3]: *** [cc1-dummy] Error 1
make[3]: Leaving directory `/var/build_system/work/gcc-build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/var/build_system/work/gcc-build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/var/build_system/work/gcc-build'
make: *** [all] Error 2

Here's the error from Firefox as reference as well
/opt/firefox-3.5.1/lib/firefox-3.5.1/firefox-bin: error while loading shared
libraries: /opt/firefox-3.5.1/lib/firefox-3.5.1/libxul.so: R_PPC_REL24
relocation at 0x0fcf7254 for symbol `memset' out of range
Comment 1 Alan Modra 2009-08-03 23:38:19 UTC
I committed a patch yesterday as part of the powerpc ifunc support that should
have fixed this bug.  The ChangeLog entry says
	(ppc_elf_relax_section): Relax branches to ifunc plt entries too.
Comment 2 Alan Modra 2009-08-04 02:52:01 UTC
No cancel that comment.  On looking at the code more carefully it looks like it
should have been OK.  In fact the patch I committed was buggy..

I can't reproduce this bug on my system, which suggest you are running something
other than FSF ld.  ie. a distro ld or have your own patches applied to
binutils.  Is this the case?
Comment 3 Jim Gifford 2009-08-04 04:33:24 UTC
I'm one of the developers of cross-lfs. We are using standard builds with no 
patches on this architecture, due to these errors. Trying to localize where 
they are coming from.

The lastest 2.19.51 on 8/3/2009 from 
ftp://sourceware.org/pub/binutils/snapshots. I have not applied any patchs to 
GCC or binutils during these builds.
Comment 4 Sourceware Commits 2009-08-04 08:15:41 UTC
Subject: Bug 10474

CVSROOT:	/cvs/src
Module name:	src
Changes by:	amodra@sourceware.org	2009-08-04 08:15:24

Modified files:
	ld             : ChangeLog 
	ld/emultempl   : ppc32elf.em 

Log message:
	PR 10474
	* emultempl/ppc32elf.em (ppc_before_allocation): Test rawsize,
	not size, after lang_reset_memory_regions.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&r1=1.2016&r2=1.2017
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/ppc32elf.em.diff?cvsroot=src&r1=1.19&r2=1.20

Comment 5 Alan Modra 2009-08-04 08:18:01 UTC
.
Comment 6 Jim Gifford 2009-08-06 15:57:30 UTC
Still having the same issue. Rebuilt the entire toolchain.

gcc -isystem /usr/include -m32   -g -fkeep-inline-functions -DIN_GCC   -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual
-Wold-style-definition -Wc++-compat -Wmissing-format-attribute -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common 
-DHAVE_CONFIG_H -Wl,-rpath-link,/lib -m32  -Wl,--relax -o cc1-dummy c-lang.o
stub-objc.o attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o
c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o
c-ppoutput.o c-cppbuiltin.o c-objc-common.o c-dump.o c-pch.o c-parser.o
rs6000-c.o c-gimplify.o tree-mudflap.o c-pretty-print.o c-omp.o dummy-checksum.o \
          main.o tree-browser.o libbackend.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a ../libcpp/libcpp.a   ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a -Lyes/lib -Lyes/lib -lmpfr -lgmp -ldl
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_base_quick_insert':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:33: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_base_ordered_remove':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:33: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_base_block_remove':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:33: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_heap_free':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:34: relocation truncated to fit:
R_PPC_REL24 against symbol `free@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_heap_copy':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:34: relocation truncated to fit:
R_PPC_REL24 against symbol `memcpy@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_heap_safe_grow_cleared':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:34: relocation truncated to fit:
R_PPC_REL24 against symbol `memset@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_gc_copy':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:35: relocation truncated to fit:
R_PPC_REL24 against symbol `memcpy@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_gc_safe_grow_cleared':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:35: relocation truncated to fit:
R_PPC_REL24 against symbol `memset@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_seq_base_quick_insert':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:37: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_seq_base_ordered_remove':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:37: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_seq_base_block_remove':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:37: additional relocation
overflows omitted from the output
collect2: ld returned 1 exit status
make[3]: *** [cc1-dummy] Error 1
make[3]: Leaving directory `/var/build_system/work/gcc-build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/var/build_system/work/gcc-build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/var/build_system/work/gcc-build'

Used the 8/3/2009 snapshot of binutils. Unmodified GCC 4.4.1. Eglibc 2.10.1
Comment 7 Alan Modra 2009-08-06 23:17:27 UTC
Are you absolutely certain that gcc is invoking the new ld?  (Add -v -Wl,-v to
gcc flags.)  I think you are still using an old ld.
Comment 8 Jim Gifford 2009-08-07 02:08:59 UTC
Just did a build complete from Scratch, it's using the new ld. I also tried the
latest binutils snapshot from 8/4/2009 and 8/5/2009. Some result. It takes me
about 12 hours to build the complete toolchain through our CLFS build process.

There is cross-compiled version of the same thing in /tools/ld, I renamed that
to ld.old and re-did the build from scratch to the same result. The PATH during
these builds are /bin:/sbin:/usr/bin:/usr/sbin:/tools/bin.

The build process works on x86, x86_64, mips, and sparc. The only one giving us
this issue right now is ppc.

Comment 9 Alan Modra 2009-08-07 03:06:42 UTC
How do you know it is using the new ld (with the patch in comment #4!!)?  I
specified -v -Wl,-v for a good reason.  Please run (from your build dir) the
single gcc command you show in comment #6 with these flags added.  It is all too
easy to be running some other ld on your system, as I've found from experience..
 gcc encodes paths to as and ld in the driver.  You may well be using something
outside of $PATH.

Note that I did in fact manage to reproduce this problem with a gcc build, found
that the automatic ld --relax code didn't work properly, and cured that.  My gcc
builds then succeeded.
Comment 10 Jim Gifford 2009-08-07 07:50:42 UTC
This build has using Binutils from CVS 8/4/2009 (No Additional Patches), with
GCC 4.4.1 branded with CLFS date tags.

root:/var/build_system/work/gcc-build/gcc$ gcc -isystem /usr/include -m32   -g
-fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wcast-qual -Wold-style-definition -Wc++-compat
-Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -Wl,-rpath-link,/lib -m32 
-Wl,--relax -o cc1-dummy c-lang.o stub-objc.o attribs.o c-errors.o c-lex.o
c-pragma.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-opts.o
c-format.o c-semantics.o c-ppoutput.o c-cppbuiltin.o c-objc-common.o c-dump.o
c-pch.o c-parser.o rs6000-c.o c-gimplify.o tree-mudflap.o c-pretty-print.o
c-omp.o dummy-checksum.o           main.o tree-browser.o libbackend.a
../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a  
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -Lyes/lib -Lyes/lib
-lmpfr -lgmp -ldl -v -Wl,-v
Reading specs from /tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/specs
Target: powerpc-unknown-linux-gnu
Configured with: /mnt/clfs/var/build_system/work/gcc-4.4.1/configure
--prefix=/tools --build=x86_64-unknown-linux-gnu
--host=powerpc-unknown-linux-gnu --target=powerpc-unknown-linux-gnu
--with-local-prefix=/tools --enable-long-long --enable-c99 --enable-shared
--enable-threads=posix --enable-__cxa_atexit --disable-nls
--enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib
--with-long-double-128
Thread model: posix
gcc version 4.4.1 (GCC for Cross-LFS 4.4.1.20090802)
COMPILER_PATH=/tools/libexec/gcc/powerpc-unknown-linux-gnu/4.4.1/:/tools/libexec/gcc/powerpc-unknown-linux-gnu/4.4.1/:/tools/libexec/gcc/powerpc-unknown-linux-gnu/:/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/:/tools/lib/gcc/powerpc-unknown-linux-gnu/:/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../../powerpc-unknown-linux-gnu/bin/
LIBRARY_PATH=/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/:/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../../powerpc-unknown-linux-gnu/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-isystem' '/usr/include' '-g' '-fkeep-inline-functions'
'-DIN_GCC' '-W' '-Wall' '-Wwrite-strings' '-Wstrict-prototypes'
'-Wmissing-prototypes' '-Wcast-qual' '-Wold-style-definition' '-Wc++-compat'
'-Wmissing-format-attribute' '-pedantic' '-Wno-long-long' '-Wno-variadic-macros'
'-Wno-overlength-strings' '-fno-common' '-DHAVE_CONFIG_H' '-m32' '-o'
'cc1-dummy' '-Lyes/lib' '-Lyes/lib' '-v'
 /tools/libexec/gcc/powerpc-unknown-linux-gnu/4.4.1/collect2 --eh-frame-hdr -V
-Qy -m elf32ppclinux --hash-style=both -dynamic-linker /lib/ld.so.1 -o cc1-dummy
/usr/lib/crt1.o /usr/lib/crti.o
/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/crtbegin.o -Lyes/lib -Lyes/lib
-L/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1
-L/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../../powerpc-unknown-linux-gnu/lib
-rpath-link /lib --relax c-lang.o stub-objc.o attribs.o c-errors.o c-lex.o
c-pragma.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-opts.o
c-format.o c-semantics.o c-ppoutput.o c-cppbuiltin.o c-objc-common.o c-dump.o
c-pch.o c-parser.o rs6000-c.o c-gimplify.o tree-mudflap.o c-pretty-print.o
c-omp.o dummy-checksum.o main.o tree-browser.o libbackend.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a ../libcpp/libcpp.a ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a -lmpfr -lgmp -ldl -v -lgcc --as-needed -lgcc_s
--no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/crtend.o /usr/lib/crtn.o
collect2 version 4.4.1 (PowerPC GNU/Linux)
/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../../powerpc-unknown-linux-gnu/bin/ld
--eh-frame-hdr -V -Qy -m elf32ppclinux --hash-style=both -dynamic-linker
/lib/ld.so.1 -o cc1-dummy /usr/lib/crt1.o /usr/lib/crti.o
/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/crtbegin.o -Lyes/lib -Lyes/lib
-L/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1
-L/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/../../../../powerpc-unknown-linux-gnu/lib
-rpath-link /lib --relax c-lang.o stub-objc.o attribs.o c-errors.o c-lex.o
c-pragma.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-opts.o
c-format.o c-semantics.o c-ppoutput.o c-cppbuiltin.o c-objc-common.o c-dump.o
c-pch.o c-parser.o rs6000-c.o c-gimplify.o tree-mudflap.o c-pretty-print.o
c-omp.o dummy-checksum.o main.o tree-browser.o libbackend.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a ../libcpp/libcpp.a ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a -lmpfr -lgmp -ldl -v -lgcc --as-needed -lgcc_s
--no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/tools/lib/gcc/powerpc-unknown-linux-gnu/4.4.1/crtend.o /usr/lib/crtn.o
GNU ld (GNU Binutils for Cross-LFS - Retrieved on 20090804) 2.19.51.20090804
  Supported emulations:
   elf32ppclinux
   elf32ppc
   elf32ppcsim
   elf32_spu
GNU ld (GNU Binutils for Cross-LFS - Retrieved on 20090804) 2.19.51.20090804
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_base_quick_insert':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:33: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_base_ordered_remove':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:33: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_base_block_remove':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:33: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_heap_free':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:34: relocation truncated to fit:
R_PPC_REL24 against symbol `free@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_heap_copy':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:34: relocation truncated to fit:
R_PPC_REL24 against symbol `memcpy@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_heap_safe_grow_cleared':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:34: relocation truncated to fit:
R_PPC_REL24 against symbol `memset@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_gc_copy':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:35: relocation truncated to fit:
R_PPC_REL24 against symbol `memcpy@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_gc_safe_grow_cleared':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:35: relocation truncated to fit:
R_PPC_REL24 against symbol `memset@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_seq_base_quick_insert':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:37: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_seq_base_ordered_remove':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:37: relocation truncated to fit:
R_PPC_REL24 against symbol `memmove@@GLIBC_2.0' defined in .plt section in
/usr/lib/crt1.o
libbackend.a(tree-ssa-ccp.o): In function `VEC_gimple_seq_base_block_remove':
/var/build_system/work/gcc-4.4.1/gcc/gimple.h:37: additional relocation
overflows omitted from the output
collect2: ld returned 1 exit status
root:/var/build_system/work/gcc-build/gcc$

Comment 11 Alan Modra 2009-08-07 10:06:37 UTC
Thanks, I'm now convinced you are using a new ld.  :)  Hmm, the -v output also
shows that gcc is passing --relax to ld anyway, so the automatic --relax code
isn't even a factor.  I don't know what else to suggest.  I know --relax works
for me.  If you make all the objects and libraries used by the failing link
available to me, I'll try linking them here.  (Add -Wl,-t and the linker will
tell you exactly which libraries.)  If that fails then finding the linker bug
will be easy.
Comment 12 Jim Gifford 2009-08-07 15:37:54 UTC
Created attachment 4122 [details]
Text File from Latest Test

Output with the last command suggested
Comment 13 Jim Gifford 2009-08-07 16:56:02 UTC
Wasn't able to attach the file, put it's available through this link.

http://svn.jg555.com/build/alan.tar.bz2
Comment 14 Jim Gifford 2009-08-07 23:53:17 UTC
http://svn.jg555.com/build/binutils-2.19.51.tar.xz is a tarball of the binary I
created for binutils that I'm using for my build.
Comment 15 Alan Modra 2009-08-07 23:57:02 UTC
$ wget http://svn.jg555.com/build/alan.tar.bz2
--09:24:01--  http://svn.jg555.com/build/alan.tar.bz2
           => `alan.tar.bz2'
Resolving svn.jg555.com... 64.183.102.12
Connecting to svn.jg555.com|64.183.102.12|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
09:24:02 ERROR 404: Not Found.
Comment 16 Jim Gifford 2009-08-08 00:18:55 UTC
Opened up the firewall, you should be able to get in now.
Comment 17 Alan Modra 2009-08-08 01:38:01 UTC
Thanks, got it.  Reproduced here too, and looks like file sizes are such that
second relax pass wants to add more stubs, and something is going wrong.  Looking..
Comment 18 Alan Modra 2009-08-08 08:06:45 UTC
You are using the old-style plt and got rather than the new secure plt (forced
by old startup files even if all the other code is capable of using the new
secure plt).  The old-style plt is a bss section, located towards the end of the
image.  Calls branch into the plt, then bounce from there to their final
destination.  At the time code is relaxed some data sections, located between
.text and .plt, have not yet been sized.  In particular, .eh_frame_hdr is still
zero size.  When this section is properly sized, some of the branches will no
longer reach.

This is a horrible bug.  To fix it I'll need to change quite a lot of code in
the linker, for all elf targets.
Comment 19 Sourceware Commits 2009-08-10 07:51:11 UTC
Subject: Bug 10474

CVSROOT:	/cvs/src
Module name:	src
Changes by:	amodra@sourceware.org	2009-08-10 07:50:57

Modified files:
	ld             : ChangeLog ldemul.c ldlang.h ldlang.c 
	ld/emultempl   : alphaelf.em armelf.em avrelf.em elf-generic.em 
	                 elf32.em genelf.em hppaelf.em m68hc1xelf.em 
	                 m68kelf.em mmix-elfnmmo.em mmo.em ppc64elf.em 
	                 sh64elf.em spuelf.em 

Log message:
	PR 10474
	* ldemul.c (after_allocation_default): Run lang_relax_sections.
	* ldlang.h (lang_relax_sections): Declare.
	* ldlang.c (relax_sections): Delete.
	(lang_relax_sections): New function.
	(lang_process): Don't relax directly from here.
	* emultempl/alphaelf.em (alpha_finish): Call finish_default.
	* emultempl/armelf.em (arm_elf_after_allocation): Delete.  Move body..
	(gld${EMULATION_NAME}_finish): ..to here.  Move existing code..
	(gld${EMULATION_NAME}_after_allocation): ..to here.  New function.
	(LDEMUL_AFTER_ALLOCATION): Update.
	* emultempl/avrelf.em (avr_elf_finish, LDEMUL_FINISH): Delete.
	(avr_elf_after_allocation): New function.
	(LDEMUL_AFTER_ALLOCATION): Define.
	* emultempl/elf-generic.em (gld${EMULATION_NAME}_map_segments): Call
	lang_relax_sections.
	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Delete.  Move..
	(gld${EMULATION_NAME}_after_allocation): ..code to here.  New function.
	(LDEMUL_AFTER_ALLOCATION, LDEMUL_FINISH): Update.
	* emultempl/genelf.em (gld${EMULATION_NAME}_finish): Delete.  Move..
	(gld${EMULATION_NAME}_after_allocation): ..code to here.  New function.
	(LDEMUL_FINISH): Delete.
	(LDEMUL_AFTER_ALLOCATION): Define.
	* emultempl/hppaelf.em (gld${EMULATION_NAME}_finish): Delete.  Move..
	(gld${EMULATION_NAME}_after_allocation): ..to here.  New function.
	(LDEMUL_FINISH): Delete.
	(LDEMUL_AFTER_ALLOCATION): Define.
	* emultempl/m68hc1xelf.em (m68hc11elf_finish): Delete.  Move..
	(m68hc11elf_after_allocation): ..to here.  New function.
	(LDEMUL_FINISH): Delete.
	(LDEMUL_AFTER_ALLOCATION): Define.
	* emultempl/m68kelf.em (m68k_elf_after_allocation): Call
	gld${EMULATION_NAME}_after_allocation.
	* emultempl/mmix-elfnmmo.em (mmix_after_allocation): Call
	gld${EMULATION_NAME}_after_allocation.
	* emultempl/mmo.em (mmo_finish): Delete.  Move body..
	(gld${EMULATION_NAME}_after_allocation): ..to here.  New function.
	(LDEMUL_FINISH): Define.
	* emultempl/ppc64elf.em (ppc_layout_sections_again): Set elf_gp.
	(gld${EMULATION_NAME}_finish): Move code sizing sections..
	(gld${EMULATION_NAME}_after_allocation): ..to here.
	* emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation):
	Call gld${EMULATION_NAME}_after_allocation.
	* emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Delete
	bfd_elf_discard_info and map_segments call.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&r1=1.2019&r2=1.2020
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ldemul.c.diff?cvsroot=src&r1=1.30&r2=1.31
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ldlang.h.diff?cvsroot=src&r1=1.83&r2=1.84
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ldlang.c.diff?cvsroot=src&r1=1.313&r2=1.314
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/alphaelf.em.diff?cvsroot=src&r1=1.12&r2=1.13
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/armelf.em.diff?cvsroot=src&r1=1.74&r2=1.75
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/avrelf.em.diff?cvsroot=src&r1=1.7&r2=1.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/elf-generic.em.diff?cvsroot=src&r1=1.7&r2=1.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/elf32.em.diff?cvsroot=src&r1=1.197&r2=1.198
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/genelf.em.diff?cvsroot=src&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/hppaelf.em.diff?cvsroot=src&r1=1.52&r2=1.53
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/m68hc1xelf.em.diff?cvsroot=src&r1=1.12&r2=1.13
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/m68kelf.em.diff?cvsroot=src&r1=1.12&r2=1.13
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/mmix-elfnmmo.em.diff?cvsroot=src&r1=1.15&r2=1.16
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/mmo.em.diff?cvsroot=src&r1=1.24&r2=1.25
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/ppc64elf.em.diff?cvsroot=src&r1=1.61&r2=1.62
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/sh64elf.em.diff?cvsroot=src&r1=1.14&r2=1.15
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/spuelf.em.diff?cvsroot=src&r1=1.40&r2=1.41

Comment 20 Jim Gifford 2009-08-12 16:59:02 UTC
Alan all appears to be working on our build again. Thank you.
Comment 21 Alan Modra 2009-08-12 23:32:54 UTC
.