This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How to turn a glibc internal variable into an external resolvable symbol?
- From: "Haizhi Xu" <xuhaizhi at hotmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 13 Jan 2005 19:22:48 +0000
- Subject: How to turn a glibc internal variable into an external resolvable symbol?
- Bcc:
Hi, all:
I have a glibc internal variable named "__libc_missing_32bit_uids" declared
in getuid.c
The original delcaration is
int __libc_missing_32bit_uids attribute_hidden = -1;
Now I NEED to turn it into an external symbol. So I changed the above code
to
int __libc_missing_32bit_uids = 1;
weak_extern (__libc_missing_32bit_uids);
After compile, it does not work as I expected.
From getuid.os, it seems right...
00000000 w O .data 00000004 __libc_missing_32bit_uids
But in libc.so, it is changed to a local variable..
001166d8 l O .data 00000004 __libc_missing_32bit_uids
Can anybody tell me what I need to do? what does the 'O' mean in the 3rd
column output of objdump?
Thanks a lot.
Haizhi