What are __NR_(socket,connect et all) symbols refering too in GLIBC?
Alex Bennee
alex@braddahead.com
Tue Dec 10 06:13:00 GMT 2002
Having built my bootstrap gcc and going through the process of building
the beast that is glibc I finally come to a linker error complaining
about some __NR_(socket function) symbols:
/home/alex/src/src/glibc/../../host/sh4-linux/bin/gcc -nostdlib
-nostartfiles -o
/home/alex/src/src/glibc/glibc-2.2.4/objdir/iconv/iconvconfig
-Wl,-dynamic-linker=/home/alex/src/src/glibc/../../target//lib/ld-linux.so.2 /home/alex/src/src/glibc/glibc-2.2.4/objdir/csu/crt1.o /home/alex/src/src/glibc/glibc-2.2.4/objdir/csu/crti.o `/home/alex/src/src/glibc/../../host/sh4-linux/bin/gcc --print-file-name=crtbegin.o` /home/alex/src/src/glibc/glibc-2.2.4/objdir/iconv/iconvconfig.o /home/alex/src/src/glibc/glibc-2.2.4/objdir/iconv/strtab.o /home/alex/src/src/glibc/glibc-2.2.4/objdir/iconv/xmalloc.o -Wl,-rpath-link=/home/alex/src/src/glibc/glibc-2.2.4/objdir:/home/alex/src/src/glibc/glibc-2.2.4/objdir/math:/home/alex/src/src/glibc/glibc-2.2.4/objdir/elf:/home/alex/src/src/glibc/glibc-2.2.4/objdir/dlfcn:/home/alex/src/src/glibc/glibc-2.2.4/objdir/nss:/home/alex/src/src/glibc/glibc-2.2.4/objdir/nis:/home/alex/src/src/glibc/glibc-2.2.4/objdir/rt:/home/alex/src/src/glibc/glibc-2.2.4/objdir/resolv:/home/alex/src/src/glibc/glibc-2.2.4/objdir/crypt:/home/alex/src/src/glibc/glibc-2.2.4/objdir/linuxthreads /home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6 /home/alex/src/src/glibc/glibc-2.2.4/objdir/libc_nonshared.a -lgcc `/home/alex/src/src/glibc/../../host/sh4-linux/bin/gcc --print-file-name=crtend.o` /home/alex/src/src/glibc/glibc-2.2.4/objdir/csu/crtn.o
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_connect'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_shutdown'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_recvfrom'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_getsockopt'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_setsockopt'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_send'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_socket'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_accept'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_recv'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_recvmsg'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_sendto'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_listen'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_getpeername'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_socketpair'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_getsockname'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_sendmsg'
/home/alex/src/src/glibc/glibc-2.2.4/objdir/libc.so.6: undefined
reference to `__NR_bind'
collect2: ld returned 1 exit status
However when I do a search though the code I can't find any references
to these functions in the code, only in the object files. For example;
[alex@cambridge objdir]$ sh4-linux-objdump -x socket/connect.o
socket/connect.o: file format elf32-sh-linux
socket/connect.o
architecture: sh3, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x00000000
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000040 00000000 00000000 00000040 2**5
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000000 00000000 00000000 00000080 2**0
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 00000080 2**0
ALLOC
SYMBOL TABLE:
00000000 l df *ABS* 00000000
/home/alex/st40/src/linux-2.4.17_st1.2/include/asm/errno.h
00000000 l df *ABS* 00000000
/home/alex/st40/src/linux-2.4.17_st1.2/include/asm/unistd.h
00000000 l df *ABS* 00000000
/home/alex/src/src/glibc/glibc-2.2.4/objdir/config.h
00000000 l d .text 00000000
00000000 l d .data 00000000
00000000 l d .bss 00000000
00000000 l *ABS* 00000000 *ABS*
00000000 g F .text 00000040 __libc_connect
00000000 *UND* 00000000 __NR_connect
00000000 *UND* 00000000 __syscall_error
00000000 w F .text 00000040 connect
00000000 w F .text 00000040 __connect
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
00000008 R_SH_DIR32 __NR_connect
0000003c R_SH_DIR32 __syscall_error
What are these symbols meant to be referring too?
--
Alex Bennee
Senior Hacker, Braddahead Ltd
The above is probably my personal opinion and may not be that of my
employer
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list