Question on glibc customization--exporting errno and __errno_location

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, all:
I need to customize the glibc to export 'errno' and 'errno_location' as external symbol. Now I modified the include/errno.h and the following is what I have changed.
--------- Original --------------
extern int errno attribute_hidden;


--------cusotmized as---------
extern int errno;


-----------Original------------ libc_hidden_proto(__errno_location)

-----------customized as----
//libc_hidden_proto(__errno_location)


Before my modifications, my glibc compiles. After my modification, I have the following errors:


gcc -shared -static-libgcc -Wl,-O1 -Wl,-z,defs -Wl,-dynamic-linker=/home/hxu02/glibc/lib/ld-linux.so.2 -B/home/hxu02/libc/glibccompile/csu/ -Wl,--version-script=/home/hxu02/libc/glibccompile/libc.map -Wl,-soname=libc.so.6 -Wl,-z,combreloc -nostdlib -nostartfiles -e __libc_main -u __register_frame -L/home/hxu02/libc/glibccompile -L/home/hxu02/libc/glibccompile/math -L/home/hxu02/libc/glibccompile/elf -L/home/hxu02/libc/glibccompile/dlfcn -L/home/hxu02/libc/glibccompile/nss -L/home/hxu02/libc/glibccompile/nis -L/home/hxu02/libc/glibccompile/rt -L/home/hxu02/libc/glibccompile/resolv -L/home/hxu02/libc/glibccompile/crypt -L/home/hxu02/libc/glibccompile/linuxthreads -Wl,-rpath-link=/home/hxu02/libc/glibccompile:/home/hxu02/libc/glibccompile/math:/home/hxu02/libc/glibccompile/elf:/home/hxu02/libc/glibccompile/dlfcn:/home/hxu02/libc/glibccompile/nss:/home/hxu02/libc/glibccompile/nis:/home/hxu02/libc/glibccompile/rt:/home/hxu02/libc/glibccompile/resolv:/home/hxu02/libc/glibccompile/crypt:/home/hxu02/libc/glibccompile/linuxthreads -o /home/hxu02/libc/glibccompile/libc.so -T /home/hxu02/libc/glibccompile/libc.so.lds /home/hxu02/libc/glibccompile/csu/abi-note.o /home/hxu02/libc/glibccompile/elf/soinit.os /home/hxu02/libc/glibccompile/libc_pic.os /home/hxu02/libc/gli
bccompile/elf/sofini.os /home/hxu02/libc/glibccompile/elf/interp.os /home/hxu02/libc/glibccompile/elf/ld.so -lgcc
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x235): In function `check_one_fd':
../sysdeps/generic/check_fds.c:71: undefined reference to `__errno_location'
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x6cc): In function `iconv_open':
/home/hxu02/libc/glibc-2.3.2/iconv/iconv_open.c:60: undefined reference to `__errno_location'
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x889): In function `iconv':
/home/hxu02/libc/glibc-2.3.2/iconv/iconv.c:67: undefined reference to `__errno_location'
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x8b5):/home/hxu02/libc/glibc-2.3.2/iconv/iconv.c:77: undefined reference to `__errno_location'
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x8c5):/home/hxu02/libc/glibc-2.3.2/iconv/iconv.c:72: undefined reference to `__errno_location'
/home/hxu02/libc/glibccompile/libc_pic.os(.text+0x8d5):/home/hxu02/libc/glibc-2.3.2/iconv/iconv.c:82: more undefined references to `__errno_location' follow
collect2: ld returned 1 exit status
make[1]: *** [/home/hxu02/libc/glibccompile/libc.so] Error 1
make[1]: Leaving directory `/home/hxu02/libc/glibc-2.3.2'
make: *** [all] Error 2
[hxu02@future glibccompile]$



Thank you for your help.

Haizhi



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux