* Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o @ 2008-06-16 11:28 Laurent GUERBY 2008-06-16 14:07 ` Alan Modra 0 siblings, 1 reply; 16+ messages in thread From: Laurent GUERBY @ 2008-06-16 11:28 UTC (permalink / raw) To: gcc, Peter Bergner Hi, When linking a very large (> 100MB executable) application on powerpc-linux with trunk we get linker errors: .../lib/gcc/powerpc-unknown-linux-gnu/4.4.0/crtbegin.o:(.fini+0x0): relocation truncated to fit: R_PPC_REL24 against `.text' .../lib/gcc/powerpc-unknown-linux-gnu/4.4.0/crtend.o:(.init+0x0): relocation truncated to fit: R_PPC_REL24 against `.text' The application itself is compiled with -mlongcall, would adding -mlongcall to crtstuff.c Makefile rule help here? If no, what is the proper solution GCC-wise? Thanks in advance, Laurent ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-16 11:28 Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o Laurent GUERBY @ 2008-06-16 14:07 ` Alan Modra 2008-06-16 17:51 ` Laurent GUERBY 0 siblings, 1 reply; 16+ messages in thread From: Alan Modra @ 2008-06-16 14:07 UTC (permalink / raw) To: Laurent GUERBY; +Cc: gcc, Peter Bergner On Mon, Jun 16, 2008 at 01:27:58PM +0200, Laurent GUERBY wrote: > Hi, > > When linking a very large (> 100MB executable) application on > powerpc-linux with trunk we get linker errors: > > .../lib/gcc/powerpc-unknown-linux-gnu/4.4.0/crtbegin.o:(.fini+0x0): > relocation truncated to fit: R_PPC_REL24 against `.text' > .../lib/gcc/powerpc-unknown-linux-gnu/4.4.0/crtend.o:(.init+0x0): > relocation truncated to fit: R_PPC_REL24 against `.text' > > The application itself is compiled with -mlongcall, > would adding -mlongcall to crtstuff.c Makefile rule help here? It ought to. You could also try GNU ld's --relax option, which might also allow you to dispense with -mlongcall for your app. > If no, what is the proper solution GCC-wise? I'll note that this problem is exacerbated by the fact that crtbegin.o defines the destructor function run from .fini and crtend.o defines the constructor run from .init. It really should be the other way around, since this arrangement results in maximmum offset branches, from the .init section located before .text to a function at the end of .text, and from the .fini section located after .text to a function at the beginning of .text. -- Alan Modra Australia Development Lab, IBM ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-16 14:07 ` Alan Modra @ 2008-06-16 17:51 ` Laurent GUERBY 2008-06-29 11:37 ` Andreas Jaeger 0 siblings, 1 reply; 16+ messages in thread From: Laurent GUERBY @ 2008-06-16 17:51 UTC (permalink / raw) To: Alan Modra; +Cc: gcc, Peter Bergner, geoffk, dje On Mon, 2008-06-16 at 23:36 +0930, Alan Modra wrote: > On Mon, Jun 16, 2008 at 01:27:58PM +0200, Laurent GUERBY wrote: > > Hi, > > > > When linking a very large (> 100MB executable) application on > > powerpc-linux with trunk we get linker errors: > > > > .../lib/gcc/powerpc-unknown-linux-gnu/4.4.0/crtbegin.o:(.fini+0x0): > > relocation truncated to fit: R_PPC_REL24 against `.text' > > .../lib/gcc/powerpc-unknown-linux-gnu/4.4.0/crtend.o:(.init+0x0): > > relocation truncated to fit: R_PPC_REL24 against `.text' > > > > The application itself is compiled with -mlongcall, > > would adding -mlongcall to crtstuff.c Makefile rule help here? > > It ought to. You could also try GNU ld's --relax option, which might > also allow you to dispense with -mlongcall for your app. You mean adding to config/rs6000/t-linux64 and create config/rs6000/t-linux with: CRTSTUFF_T_CFLAGS += -mlongcalls CRTSTUFF_T_CFLAGS_S += -mlongcalls Would a patch with this be approved on trunk? I noticed another target config/xtensa/t-elf which has something very close: # Build CRT files and libgcc with the "longcalls" option CRTSTUFF_T_CFLAGS += -mlongcalls CRTSTUFF_T_CFLAGS_S += -mlongcalls TARGET_LIBGCC2_CFLAGS += -mlongcalls Is the "TARGET_LIBGCC2_CFLAGS" necessary as well? > > If no, what is the proper solution GCC-wise? > > I'll note that this problem is exacerbated by the fact that crtbegin.o > defines the destructor function run from .fini and crtend.o defines > the constructor run from .init. It really should be the other way > around, since this arrangement results in maximmum offset branches, > from the .init section located before .text to a function at the end > of .text, and from the .fini section located after .text to a function > at the beginning of .text. Too arcane for me :). Let's hope someone else can comment on this. Thanks for your help, I'll get some results tomorrow. Laurent ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-16 17:51 ` Laurent GUERBY @ 2008-06-29 11:37 ` Andreas Jaeger 2008-06-29 12:24 ` David Edelsohn 0 siblings, 1 reply; 16+ messages in thread From: Andreas Jaeger @ 2008-06-29 11:37 UTC (permalink / raw) To: laurent; +Cc: Alan Modra, gcc, Peter Bergner, geoffk, dje [-- Attachment #1: Type: text/plain, Size: 813 bytes --] I had the same problem on my PowerPC Linux machine and the workaround I'm using now is to run make with the additional flag STAGE1_CFLAGS=-O. The problem (thanks to Andreas Schwab and Michael Matz for help) is that .glink and .text is too far away from each other (> 32 MB in the non-optimized case) and therefore building of e.g. cc1-dummy fails. Adding -Wl,--relax to the cc1-dummy build helped for that binary but I found no way to get this properly into the Makefiles (and make LDFLAGS="-Wl,--relax" gave an error in configure later on), Andreas -- Andreas Jaeger, Director Platform / openSUSE, aj@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 [-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-29 11:37 ` Andreas Jaeger @ 2008-06-29 12:24 ` David Edelsohn 2008-06-29 13:09 ` Andreas Schwab 0 siblings, 1 reply; 16+ messages in thread From: David Edelsohn @ 2008-06-29 12:24 UTC (permalink / raw) To: laurent, Alan Modra, gcc, Peter Bergner, geoffk >>>>> Andreas Jaeger writes: Andreas> I had the same problem on my PowerPC Linux machine and the workaround Andreas> I'm using now is to run make with the additional flag STAGE1_CFLAGS=3D-O. Andreas> The problem (thanks to Andreas Schwab and Michael Matz for help) is that Andreas> .glink and .text is too far away from each other (> 32 MB in the Andreas> non-optimized case) and therefore building of e.g. cc1-dummy fails. Andreas> Adding -Wl,--relax to the cc1-dummy build helped for that binary but I Andreas> found no way to get this properly into the Makefiles (and make Andreas> LDFLAGS=3D"-Wl,--relax" gave an error in configure later on), Can you add cc1-dummy$(exeext) : override LDFLAGS += -Wl,--relax to an appropriate tmake_file in gcc/config/rs6000 ? David ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-29 12:24 ` David Edelsohn @ 2008-06-29 13:09 ` Andreas Schwab 2008-06-30 5:30 ` Andreas Jaeger 0 siblings, 1 reply; 16+ messages in thread From: Andreas Schwab @ 2008-06-29 13:09 UTC (permalink / raw) To: David Edelsohn; +Cc: laurent, Alan Modra, gcc, Peter Bergner, geoffk David Edelsohn <dje@watson.ibm.com> writes: >>>>>> Andreas Jaeger writes: > > Andreas> I had the same problem on my PowerPC Linux machine and the workaround > Andreas> I'm using now is to run make with the additional flag STAGE1_CFLAGS=3D-O. > Andreas> The problem (thanks to Andreas Schwab and Michael Matz for help) is that > Andreas> .glink and .text is too far away from each other (> 32 MB in the > Andreas> non-optimized case) and therefore building of e.g. cc1-dummy fails. > Andreas> Adding -Wl,--relax to the cc1-dummy build helped for that binary but I > Andreas> found no way to get this properly into the Makefiles (and make > Andreas> LDFLAGS=3D"-Wl,--relax" gave an error in configure later on), > > Can you add > > cc1-dummy$(exeext) : override LDFLAGS += -Wl,--relax > > to an appropriate tmake_file in gcc/config/rs6000 ? It should be put in a host_xmake_file fragment. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-29 13:09 ` Andreas Schwab @ 2008-06-30 5:30 ` Andreas Jaeger 2008-06-30 11:45 ` David Edelsohn 0 siblings, 1 reply; 16+ messages in thread From: Andreas Jaeger @ 2008-06-30 5:30 UTC (permalink / raw) To: Andreas Schwab Cc: David Edelsohn, laurent, Alan Modra, gcc, Peter Bergner, geoffk On Sun, Jun 29, 2008 at 03:08:43PM +0200, Andreas Schwab wrote: > David Edelsohn <dje@watson.ibm.com> writes: > > >>>>>> Andreas Jaeger writes: > > > > Andreas> I had the same problem on my PowerPC Linux machine and the workaround > > Andreas> I'm using now is to run make with the additional flag STAGE1_CFLAGS=3D-O. > > Andreas> The problem (thanks to Andreas Schwab and Michael Matz for help) is that > > Andreas> .glink and .text is too far away from each other (> 32 MB in the > > Andreas> non-optimized case) and therefore building of e.g. cc1-dummy fails. > > Andreas> Adding -Wl,--relax to the cc1-dummy build helped for that binary but I > > Andreas> found no way to get this properly into the Makefiles (and make > > Andreas> LDFLAGS=3D"-Wl,--relax" gave an error in configure later on), > > > > Can you add > > > > cc1-dummy$(exeext) : override LDFLAGS += -Wl,--relax > > > > to an appropriate tmake_file in gcc/config/rs6000 ? > > It should be put in a host_xmake_file fragment. I'm not a build machinery expert - if anybody has a patch, I'll happily test it, I'm building on Linux/Powerpc64. Adding the above line to rs6000/x-linux64 did not help me. Btw. we would need it for other files - like gnat1 - as well, Andreas -- Andreas Jaeger, Director Platform / openSUSE, aj@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-30 5:30 ` Andreas Jaeger @ 2008-06-30 11:45 ` David Edelsohn 2008-06-30 13:23 ` Andreas Jaeger 0 siblings, 1 reply; 16+ messages in thread From: David Edelsohn @ 2008-06-30 11:45 UTC (permalink / raw) To: Andreas Jaeger Cc: Andreas Schwab, laurent, Alan Modra, gcc, Peter Bergner, geoffk >>>>> Andreas Jaeger writes: Andreas> I'm not a build machinery expert - if anybody has a patch, I'll happily test it, Andreas> I'm building on Linux/Powerpc64. Andreas> Adding the above line to rs6000/x-linux64 did not help me. Btw. Andreas> we would need it for other files - like gnat1 - as well, Andreas Schwab removed x-linux64 yesterday because it was not referenced by any configuration. I know that the tmake_files are the wrong place, but just to test that it works, try adding the line to t-linux64, which is included in the powerpc64-linux configuration. Once we confirm the command is appended to LDFLAGS for executables that need it, we can figure out the correct Makefile fragment. David ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-30 11:45 ` David Edelsohn @ 2008-06-30 13:23 ` Andreas Jaeger 2008-06-30 14:02 ` laurent 0 siblings, 1 reply; 16+ messages in thread From: Andreas Jaeger @ 2008-06-30 13:23 UTC (permalink / raw) To: David Edelsohn Cc: Andreas Schwab, laurent, Alan Modra, gcc, Peter Bergner, geoffk [-- Attachment #1: Type: text/plain, Size: 2052 bytes --] David Edelsohn <dje@watson.ibm.com> writes: >>>>>> Andreas Jaeger writes: > > Andreas> I'm not a build machinery expert - if anybody has a patch, I'll happily test it, > Andreas> I'm building on Linux/Powerpc64. > > Andreas> Adding the above line to rs6000/x-linux64 did not help me. Btw. > Andreas> we would need it for other files - like gnat1 - as well, > > Andreas Schwab removed x-linux64 yesterday because it was not > referenced by any configuration. Ah, that explains it. > > I know that the tmake_files are the wrong place, but just to test > that it works, try adding the line to t-linux64, which is included in the > powerpc64-linux configuration. > > Once we confirm the command is appended to LDFLAGS for executables > that need it, we can figure out the correct Makefile fragment. I added now to t-linux64: cc1-dummy$(exeext) : override LDFLAGS += -Wl,--relax cc1$(exeext) : override LDFLAGS += -Wl,--relax gnat1$(exeext) : override LDFLAGS += -Wl,--relax This gets me a bit further but I do get later a build failure in configure: checking for powerpc64-suse-linux-gnu-strip... strip checking whether ln -s works... yes checking for powerpc64-suse-linux-gnu-gcc... /abuild/aj/gcc-tst/./gcc/xgcc -B/abuild/aj/gcc-tst/./gcc/ -B/opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/bin/ -B/opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/lib/ -isystem /opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/include -isystem /opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/sys-include checking for suffix of object files... configure: error: in `/abuild/aj/gcc-tst/powerpc64-suse-linux-gnu/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. make[2]: *** [configure-stage1-target-libgcc] Error 1 Andreas -- Andreas Jaeger, Director Platform / openSUSE, aj@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 [-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-30 13:23 ` Andreas Jaeger @ 2008-06-30 14:02 ` laurent 2008-06-30 14:26 ` Andreas Jaeger 0 siblings, 1 reply; 16+ messages in thread From: laurent @ 2008-06-30 14:02 UTC (permalink / raw) To: Andreas Jaeger Cc: David Edelsohn, Andreas Schwab, Alan Modra, gcc, Peter Bergner, geoffk, laurent Selon Andreas Jaeger <aj@suse.de>: > This gets me a bit further but I do get later a build failure in > configure: > > checking for powerpc64-suse-linux-gnu-strip... strip > checking whether ln -s works... yes > checking for powerpc64-suse-linux-gnu-gcc... /abuild/aj/gcc-tst/./gcc/xgcc > -B/abuild/aj/gcc-tst/./gcc/ > -B/opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/bin/ > -B/opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/lib/ -isystem > /opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/include -isystem > /opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/sys-include > checking for suffix of object files... configure: error: in > `/abuild/aj/gcc-tst/powerpc64-suse-linux-gnu/libgcc': > configure: error: cannot compute suffix of object files: cannot compile > See `config.log' for more details. > make[2]: *** [configure-stage1-target-libgcc] Error 1 If you've run configure even once by mistake in the source directory this is usually what you get as error when you configure and build in a build dir later on. The solution is to restart from a clean source dir. Other possibility is that you linked a base compiler with mpfr as dynamic library and you don't have them anymore in your LD_LIBRARY_PATH so it doesn't work. There's a configure flag --disable-shared or some such for MPFR, otherwise you can move the lib/*mpfr.so* somewhere else. Hope this helps, Laurent ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-30 14:02 ` laurent @ 2008-06-30 14:26 ` Andreas Jaeger 2008-06-30 14:32 ` David Edelsohn 0 siblings, 1 reply; 16+ messages in thread From: Andreas Jaeger @ 2008-06-30 14:26 UTC (permalink / raw) To: laurent Cc: David Edelsohn, Andreas Schwab, Alan Modra, gcc, Peter Bergner, geoffk [-- Attachment #1: Type: text/plain, Size: 1995 bytes --] laurent@guerby.net writes: > Selon Andreas Jaeger <aj@suse.de>: > >> This gets me a bit further but I do get later a build failure in >> configure: >> >> checking for powerpc64-suse-linux-gnu-strip... strip >> checking whether ln -s works... yes >> checking for powerpc64-suse-linux-gnu-gcc... /abuild/aj/gcc-tst/./gcc/xgcc >> -B/abuild/aj/gcc-tst/./gcc/ >> -B/opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/bin/ >> -B/opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/lib/ -isystem >> /opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/include -isystem >> /opt/gcc/4.4-devel/powerpc64-suse-linux-gnu/sys-include >> checking for suffix of object files... configure: error: in >> `/abuild/aj/gcc-tst/powerpc64-suse-linux-gnu/libgcc': >> configure: error: cannot compute suffix of object files: cannot compile >> See `config.log' for more details. >> make[2]: *** [configure-stage1-target-libgcc] Error 1 > > If you've run configure even once by mistake in the source directory this is > usually what you get as error when you configure and build in a build dir later > on. The solution is to restart from a clean source dir. I'm not building inside the source directory. > Other possibility is that you linked a base compiler with mpfr as dynamic > library and you don't have them anymore in your LD_LIBRARY_PATH so it doesn't > work. There's a configure flag --disable-shared or some such for MPFR, > otherwise you can move the lib/*mpfr.so* somewhere else. > > Hope this helps, The bootstrap works with make STAGE1_CFLAGS but fails when I add the LDFLAGS lines to t-linux64, so this looks different. config.log has: xgcc: Internal error: Segmentation fault (program cc1) Please submit a full bug report. Andreas -- Andreas Jaeger, Director Platform / openSUSE, aj@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 [-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-30 14:26 ` Andreas Jaeger @ 2008-06-30 14:32 ` David Edelsohn 2008-06-30 14:38 ` Andreas Jaeger 0 siblings, 1 reply; 16+ messages in thread From: David Edelsohn @ 2008-06-30 14:32 UTC (permalink / raw) To: laurent, Andreas Schwab, Alan Modra, gcc, Peter Bergner, geoffk >> checking for suffix of object files... configure: error: in >> `/abuild/aj/gcc-tst/powerpc64-suse-linux-gnu/libgcc': >> configure: error: cannot compute suffix of object files: cannot compile >> See `config.log' for more details. This is the friendly way the GCC build process reports that the compiler built during the previous stage does not work. In other words, -Wl,--relax allowed cc1 to link, but the resulting executable does not run. David ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-30 14:32 ` David Edelsohn @ 2008-06-30 14:38 ` Andreas Jaeger 2008-06-30 15:07 ` David Edelsohn 0 siblings, 1 reply; 16+ messages in thread From: Andreas Jaeger @ 2008-06-30 14:38 UTC (permalink / raw) To: David Edelsohn Cc: laurent, Andreas Schwab, Alan Modra, gcc, Peter Bergner, geoffk [-- Attachment #1: Type: text/plain, Size: 959 bytes --] David Edelsohn <dje@watson.ibm.com> writes: >>> checking for suffix of object files... configure: error: in >>> `/abuild/aj/gcc-tst/powerpc64-suse-linux-gnu/libgcc': >>> configure: error: cannot compute suffix of object files: cannot compile >>> See `config.log' for more details. > > This is the friendly way the GCC build process reports that the > compiler built during the previous stage does not work. In other words, > -Wl,--relax allowed cc1 to link, but the resulting executable does not > run. So, it means that --relax is not the right solution for the problem. I'll continue with the STAGE1_CFLAG flag but if anybody else wants me to test something, please tell me, Andreas -- Andreas Jaeger, Director Platform / openSUSE, aj@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 [-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-30 14:38 ` Andreas Jaeger @ 2008-06-30 15:07 ` David Edelsohn 2008-07-01 0:00 ` Alan Modra 0 siblings, 1 reply; 16+ messages in thread From: David Edelsohn @ 2008-06-30 15:07 UTC (permalink / raw) To: laurent, Andreas Schwab, Alan Modra, gcc, Peter Bergner, geoffk >>>>> 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. 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. David ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-06-30 15:07 ` David Edelsohn @ 2008-07-01 0:00 ` Alan Modra 2008-08-06 7:41 ` Alan Modra 0 siblings, 1 reply; 16+ messages in thread From: Alan Modra @ 2008-07-01 0:00 UTC (permalink / raw) To: Andreas Jaeger; +Cc: gcc 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 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o 2008-07-01 0:00 ` Alan Modra @ 2008-08-06 7:41 ` Alan Modra 0 siblings, 0 replies; 16+ messages in thread From: Alan Modra @ 2008-08-06 7:41 UTC (permalink / raw) To: Andreas Jaeger, gcc; +Cc: matz, schwab Found it, finally. powerpc ld --relax had a bug affecting -fPIC code. See http://sourceware.org/ml/binutils/2008-08/msg00040.html -- Alan Modra Australia Development Lab, IBM ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2008-08-06 7:41 UTC | newest] Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-06-16 11:28 Linking very large application with GCC trunk on powerpc-linux leads to relocation error of crtbegin/end.o Laurent GUERBY 2008-06-16 14:07 ` Alan Modra 2008-06-16 17:51 ` Laurent GUERBY 2008-06-29 11:37 ` Andreas Jaeger 2008-06-29 12:24 ` David Edelsohn 2008-06-29 13:09 ` Andreas Schwab 2008-06-30 5:30 ` Andreas Jaeger 2008-06-30 11:45 ` David Edelsohn 2008-06-30 13:23 ` Andreas Jaeger 2008-06-30 14:02 ` laurent 2008-06-30 14:26 ` Andreas Jaeger 2008-06-30 14:32 ` David Edelsohn 2008-06-30 14:38 ` Andreas Jaeger 2008-06-30 15:07 ` David Edelsohn 2008-07-01 0:00 ` Alan Modra 2008-08-06 7:41 ` Alan Modra
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).