This is the mail archive of the
mailing list for the glibc project.
Re: undefined reference to `__libc_stack_end@GLIBC_PRIVATE - newbie
- From: Nix <nix at esperi dot org dot uk>
- To: "John Que" <qwejohn at hotmail dot com>
- Cc: mike at navi dot cx, libc-alpha at sources dot redhat dot com
- Date: Fri, 18 Mar 2005 14:17:49 +0000
- Subject: Re: undefined reference to `__libc_stack_end@GLIBC_PRIVATE - newbie
- References: <BAY14-F14FB1E6E1CE1B2011B3EDAAF560@phx.gbl>
On Mon, 14 Mar 2005, John Que suggested tentatively:
> Now I had compiled a little program (named test_printf.c) like thus:
> gcc -I/work/src/glibc-2.3.2-prefix/include -g test_printf.c -nostdlib -nostartfiles
> -Wl,-dynamic-linker=/work/src/glibc-2.3.2-prefix/lib/ld-linux.so.2 /work/src/glibc-2.3.2-prefix/lib/crt1.o
> /work/src/glibc-2.3.2-prefix/lib/crti.o -L/work/src/glibc-2.3.2-prefix/lib /work/src/glibc-2.3.2-prefix/lib/libdl.so.2 -lc
> /work/src/glibc-2.3.2-prefix/lib/ld-linux.so.2 /work/src/glibc-2.3.2-prefix/lib/libc_nonshared.a -lgcc `gcc
> --print-file-name=crtend.o` /work/src/glibc-2.3.2-prefix/lib/crtn.o -o
You've forgotten `gcc --print-file-name=crtbegin.o` after crti.o: lots
of things will break without that (including failures like you see).
Explicitly linking with libdl looks odd, too; printf() shouldn't need that.
> I wrote a script named run.sh with the following 3 lines:
Why are you trying to preload the dynamic linker? That'll never do what
you expect: the dynamic linker's name is read from DT_INTERP in the
binary by the kernel. LD_PRELOAD is interpreted *by* the dynamic linker!
This is a black magic area and you can expect things to go wrong unless
you understand the convolutions that happen between glibc and GCC
involving constructor and destructor registration/invocation and so on
when a process starts and stops.
> ...Hires Root Beer...
What we need these days is a stable, fast, anti-aliased root beer
with dynamic shading. Not that you can let just anybody have root.
--- John M. Ford