Hello,
I carefully followed the ELF-HOWTO instructions for building an ELF
bootstrap development system. I am using Slackware 2.2, Linux 1.2.4,
and gcc 2.6.3 (not 2.6.2 as described in the HOWTO). However, I have
not managed to compile libc correctly and was hoping someone could
help me out.
Binutils 2.5.2.6 and an ELF version of gcc-2.6.3 compiled
correctly. Minor problems were encountered in the bfd subdirectory of
binutils when configure.in did not substitute some variables
correctly.
When building libc, I received the errors listed below. Can
someone tell me why this library isn't linking correctly? Do the
standard library symbols need to be weak? I fiddled randomly for some
time, to no avail.
Thanks!
Philippe McLean
Errors from
make -k ELF=true
make[3]: Entering directory
`/home/philippe/dl/libc-linux/elf/d-link/libdl'
gcc-elf -m486 -fPIC -O2 -D__PIC__ -I.. -I../i386 -DNO_UNDERSCORE
-DVERBOSE_DLINKER -I../../../libio -I../../../libio/stdio -DNLS
-I../../../nls -DYP -DNO_SHADOW -D_GNU_SOURCE -DSTDC_HEADERS -DUSG
-DDIRENT -DSYSV -DUSE_BSD_REGEX -D_LIBC
-Wall -Wstrict-prototypes -Wmissing-prototypes -funsigned-char -c
dlib.c
[... spurious warnings removed ...]
gcc-elf -m486 -Wl,-shared -nostdlib -o
../../../elfshared/libdl.so.1.0.14 -Wl,-soname -Wl,libdl.so.1 *.o
dlib.o(.text+0xd): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x51): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x81): undefined reference to `atexit'
dlib.o(.text+0xc0): undefined reference to `malloc'
dlib.o(.text+0x14c): undefined reference to `malloc'
dlib.o(.text+0x25e): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x31c): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x381): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x4c8): undefined reference to `munmap'
dlib.o(.text+0x51d): undefined reference to `free'
dlib.o(.text+0x529): undefined reference to `free'
dlib.o(.text+0x55c): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x59c): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x5a9): undefined reference to `IO_stderr_'
dlib.o(.text+0x5af): undefined reference to `fprintf'
dlib.o(.text+0x5b6): undefined reference to `exit'
dlib.o(.text+0x5ce): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x5db): undefined reference to `IO_stderr_'
dlib.o(.text+0x5e1): undefined reference to `fprintf'
dlib.o(.text+0x61b): undefined reference to `IO_stderr_'
dlib.o(.text+0x621): undefined reference to `fprintf'
dlib.o(.text+0x641): undefined reference to `IO_stderr_'
dlib.o(.text+0x647): undefined reference to `fprintf'
dlib.o(.text+0x66c): undefined reference to `IO_stderr_'
dlib.o(.text+0x672): undefined reference to `fprintf'
dlib.o(.text+0x696): undefined reference to `IO_stderr_'
dlib.o(.text+0x69c): undefined reference to `fprintf'
dlib.o(.text+0x6bc): undefined reference to `IO_stderr_'
dlib.o(.text+0x6c2): undefined reference to `fprintf'
dlib.o(.text+0x6fc): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x70e): undefined reference to `malloc'
make[3]: *** [lib] Error 1
make[3]: Leaving directory
`/home/philippe/dl/libc-linux/elf/d-link/libdl'
make[2]: *** [lib] Error 2
[...]
make[3]: Entering directory
`/home/philippe/dl/libc-linux/elf/d-link/libdl'
gcc-elf -m486 -Wl,-shared -nostdlib -o
../../../elfshared/libdl.so.1.0.14 -Wl,-soname -Wl,libdl.so.1 *.o
dlib.o(.text+0xd): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x51): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x81): undefined reference to `atexit'
dlib.o(.text+0xc0): undefined reference to `malloc'
dlib.o(.text+0x14c): undefined reference to `malloc'
dlib.o(.text+0x25e): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x31c): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x381): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x4c8): undefined reference to `munmap'
dlib.o(.text+0x51d): undefined reference to `free'
dlib.o(.text+0x529): undefined reference to `free'
dlib.o(.text+0x55c): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x59c): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x5a9): undefined reference to `IO_stderr_'
dlib.o(.text+0x5af): undefined reference to `fprintf'
dlib.o(.text+0x5b6): undefined reference to `exit'
dlib.o(.text+0x5ce): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x5db): undefined reference to `IO_stderr_'
dlib.o(.text+0x5e1): undefined reference to `fprintf'
dlib.o(.text+0x61b): undefined reference to `IO_stderr_'
dlib.o(.text+0x621): undefined reference to `fprintf'
dlib.o(.text+0x641): undefined reference to `IO_stderr_'
dlib.o(.text+0x647): undefined reference to `fprintf'
dlib.o(.text+0x66c): undefined reference to `IO_stderr_'
dlib.o(.text+0x672): undefined reference to `fprintf'
dlib.o(.text+0x696): undefined reference to `IO_stderr_'
dlib.o(.text+0x69c): undefined reference to `fprintf'
dlib.o(.text+0x6bc): undefined reference to `IO_stderr_'
dlib.o(.text+0x6c2): undefined reference to `fprintf'
dlib.o(.text+0x6fc): undefined reference to `GLOBAL_OFFSET_TABLE_'
dlib.o(.text+0x70e): undefined reference to `malloc'
make[3]: *** [lib] Error 1
make[3]: Leaving directory
`/home/philippe/dl/libc-linux/elf/d-link/libdl'
make[2]: *** [lib] Error 2