Help: building ELF libc, trouble with libdl

Help: building ELF libc, trouble with libdl

Post by Philippe McLe » Wed, 12 Apr 1995 04:00:00



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

 
 
 

1. Trouble building a new libc

We are running 2.1.5-RELEASE on our boxes, and I want to rebuild the
libraries to include a patch for the locale security bug.  Whenever I
try and install the libraries I've built, though, I get errors from
send-mail saying that _res_init is not found.

I'm cd-ing to the /usr/src/lib directory and typing "make;make
install" and then running "ldconfig /usr/lib /usr/local/lib".  Is
there something that I'm being boneheaded and not doing that would
cause it to miss the res_init?  I've used nm on the shared libraries,
and it tells me that while the 2.1.5 distributed library has _res_init
defined, my library defines ___res_init.

Thanks,

Nat

2. Getting PPP to work..almost there....BUT

3. ldconfig: libdl.so appears to be for multiple libc's error

4. Network configurator

5. Problems with libdl and libc

6. Reading is much more interesting than TV (0087/1704)

7. static linking, libc, and libdl (sigh)

8. Mandrake 7, XFree 4, Fixed Font Problem

9. Is there a libdl.a on ELF systems?

10. ELF and libdl

11. Help: building ELF shared libs

12. libc.a and libc.so, libc.so.1libc.so.2, where is my library?

13. libc 2.x, libc 5, libc 6