Hello,

On Wed, 19 Jul 2017 18:01:56 +0200, Denys Vlasenko wrote:

> > It builds only Busybox, so it's very quick to reach the build failure.
> > This time, I got:
> >
> > libbb/lib.a(appletlib.o): In function `find_applet_by_name':
> > appletlib.c:(.text.find_applet_by_name+0x14): relocation truncated to fit: 
> > R_SPARC_GOT13 against symbol `applet_nameofs' defined in 
> > .rodata.applet_nameofs section in libbb/lib.a(appletlib.o)
> > appletlib.c:(.text.find_applet_by_name+0x18): relocation truncated to fit: 
> > R_SPARC_GOT13 against symbol `applet_names' defined in .rodata.applet_names 
> > section in libbb/lib.a(appletlib.o)
> > libbb/lib.a(appletlib.o): In function `bb_show_usage':
> > appletlib.c:(.text.bb_show_usage+0x10): relocation truncated to fit: 
> > R_SPARC_GOT13 against symbol `applet_name' defined in COMMON section in 
> > libbb/lib.a(appletlib.o)
> > appletlib.c:(.text.bb_show_usage+0x54): relocation truncated to fit: 
> > R_SPARC_GOT13 against symbol `bb_banner' defined in .rodata.bb_banner 
> > section in libbb/lib.a(messages.o)
> > libbb/lib.a(appletlib.o): In function `lbb_prepare':
> > appletlib.c:(.text.lbb_prepare+0x18): relocation truncated to fit: 
> > R_SPARC_GOT13 against symbol `bb_errno' defined in COMMON section in 
> > libbb/lib.a(ptr_to_globals.o)
> > appletlib.c:(.text.lbb_prepare+0x20): relocation truncated to fit: 
> > R_SPARC_GOT13 against symbol `applet_name' defined in COMMON section in 
> > libbb/lib.a(appletlib.o)
> > libbb/lib.a(appletlib.o): In function `run_applet_no_and_exit':
> > appletlib.c:(.text.run_applet_no_and_exit+0x28): relocation truncated to 
> > fit: R_SPARC_GOT13 against symbol `xfunc_error_retval' defined in 
> > .data.xfunc_error_retval section in libbb/lib.a(default_error_retval.o)
> > appletlib.c:(.text.run_applet_no_and_exit+0x38): relocation truncated to 
> > fit: R_SPARC_GOT13 against symbol `applet_name' defined in COMMON section 
> > in libbb/lib.a(appletlib.o)
> > appletlib.c:(.text.run_applet_no_and_exit+0xb0): relocation truncated to 
> > fit: R_SPARC_GOT13 against symbol `applet_main' defined in 
> > .data.rel.ro.applet_main section in libbb/lib.a(appletlib.o)
> > appletlib.c:(.text.run_applet_no_and_exit+0xcc): relocation truncated to 
> > fit: R_SPARC_GOT13 against symbol `applet_suid' defined in 
> > .rodata.applet_suid section in libbb/lib.a(appletlib.o)
> > appletlib.c:(.text.run_applet_no_and_exit+0x11c): additional relocation 
> > overflows omitted from the output
> > collect2: error: ld returned 1 exit status
> >
> > When I build with my patches (the build is successful), and then look
> > at libbbusybox.so with readelf, the .got section is indeed very small,
> > much smaller than the 8 KB limit detailed in gcc's documentation about
> > -fpic vs. -fPIC:
> >
> > $ ./output/host/usr/bin/sparc-linux-readelf -a 
> > output/target/lib/libbusybox.so.1.26.2 | grep "\.got"
> >   [17] .got              PROGBITS        000dc000 0cc000 00021c 04  WA  0   
> > 0  4
> >
> > So the size is only 0x21c.
> >
> > Any idea on how to investigate this further?  
> 
> I think what happens is compiler does not know where applet_names[] are,
> assumes it's in another library and generates a reloc.
> Then, the "short" fpic reloc does not work at link time.

And so, from there? Is it a compiler bug?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to