public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Haizhi Xu" <xuhaizhi@hotmail.com>
To: gcc-help@gcc.gnu.org
Subject: Question on glibc customization--exporting errno and __errno_location
Date: Sun, 02 Jan 2005 03:12:00 -0000	[thread overview]
Message-ID: <BAY14-F316047DEA5519C0BD41318D99F0@phx.gbl> (raw)

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


             reply	other threads:[~2005-01-02  3:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-02  3:12 Haizhi Xu [this message]
2005-01-02 23:54 ` Sohail Somani
2005-01-03  2:23   ` Question on glibc customization--exporting errno and__errno_location Haizhi Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY14-F316047DEA5519C0BD41318D99F0@phx.gbl \
    --to=xuhaizhi@hotmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).