This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Tue, 1 Jul 2008 09:29:51 +0930
- Subject: Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o
- References: <200806291221.m5TCLNcR032172@makai.watson.ibm.com> <jeod5k4cdg.fsf@sykes.suse.de> <20080630053020.GA29172@reger.suse.de> <200806301140.m5UBeuVN029620@makai.watson.ibm.com> <ho63rr5a71.fsf@reger.suse.de> <1214834520.4868e7586e307@ssl0.ovh.net> <hofxqv3sq5.fsf@reger.suse.de> <200806301430.m5UEU294029526@makai.watson.ibm.com> <hobq1j3s5n.fsf@reger.suse.de> <200806301504.m5UF4h3x035512@makai.watson.ibm.com>
On Mon, Jun 30, 2008 at 11:04:43AM -0400, David Edelsohn wrote:
> >>>>> Andreas Jaeger writes:
>
> Andreas> So, it means that --relax is not the right solution for the problem.
>
> Andreas> I'll continue with the STAGE1_CFLAG flag but if anybody else wants me to
> Andreas> test something, please tell me,
>
> Maybe Alan will have some insight about --relax not working.
I'm definitely interested in trying to reproduce the problem as it
sounds like there might be a linker bug. Andreas, can you send me
your configure options?
> Otherwise, in the past Alan has had some suggestions for swapping
> around the crt file order or using linker scripts to place those sections
> more effectively.
These tricks would only help the particular case of reloc overflow in
branches to __do_global_{c,d}tors_aux. Something like the following
(untested!) in place of the .text output section description in
ld/scripttempl/elf.sc ought to work.
.text ${RELOCATING-0} :
{
${RELOCATING+${TEXT_START_SYMBOLS}}
*crtend.o(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
*crtend?.o(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o) .text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
*crtbegin.o(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
*crtbegin?.o(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
${RELOCATING+${OTHER_TEXT_SECTIONS}}
} =${NOP-0}
--
Alan Modra
Australia Development Lab, IBM