From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4905 invoked by alias); 2 Jan 2005 03:12:10 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 4892 invoked from network); 2 Jan 2005 03:12:02 -0000 Received: from unknown (HELO hotmail.com) (64.4.49.31) by sourceware.org with SMTP; 2 Jan 2005 03:12:02 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 1 Jan 2005 19:12:01 -0800 Message-ID: Received: from 128.230.14.118 by by14fd.bay14.hotmail.msn.com with HTTP; Sun, 02 Jan 2005 03:11:18 GMT X-Originating-Email: [xuhaizhi@hotmail.com] X-Sender: xuhaizhi@hotmail.com From: "Haizhi Xu" To: gcc-help@gcc.gnu.org Bcc: Subject: Question on glibc customization--exporting errno and __errno_location Date: Sun, 02 Jan 2005 03:12:00 -0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 02 Jan 2005 03:12:01.0819 (UTC) FILETIME=[D4164EB0:01C4F078] X-SW-Source: 2005-01/txt/msg00000.txt.bz2 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