[uClibc] weak links

Konrad Eisele eiselekd at web.de
Fri May 14 08:00:12 UTC 2004


Hi,
I am using sparc-linux-gcc (GCC) 3.2.2, GNU ld version 2.13.1, elf2flt-20020218 and
uClibc.0.9.26 in the snapgear linux distro. I encountr a weak link error here:
1: uClibc/libc/misc/internals/__uClibc_main.c defines weak_const_function __h_errno_location
2: sparc-linux-ld -nodefaultlibs -nostartfiles -z weakextract --start-group /home/eiselekd/snapgear/snapgear-patch/lib/uClibc/lib/crt0.o /home/eiselekd/snapgear/snapgear-patch/lib/uClibc/lib/crti.o -L/opt/sparc-linux/lib/gcc-lib/sparc-linux/3.2.2/ -L/home/eiselekd/snapgear/snapgear-patch/lib/uClibc/lib -o sh sash.o -lc -lgcc /home/eiselekd/snapgear/snapgear-patch/lib/uClibc/lib/crtn.o --end-group -M

3: The weak link to __h_errno_location in __uClibc_main.c doesn't trigger extraction of
libc.a:__h_errno_location.o.
4: elf2flt uses the unlinked reference. So
if (likely(__h_errno_location!=NULL))
in __uClibc_main.c is != 0 and then a jump to 0 is done


I could trigger extraction of __errno_location.o by removing weak_const_function from
extern int *weak_const_function __h_errno_location(void);
(__errno_location.o is extracted because error.o references it.)

Is this a error of uClibc or elf2flt or both?

-- Greetings Konrad




More information about the uClibc mailing list