This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Add a strong symbol observable by dynamic linker
- From: wuxi <wuxi at fudan dot edu dot cn>
- To: glibc-help <libc-help at sourceware dot org>
- Date: Sat, 30 Aug 2008 23:18:08 +0800
- Subject: Add a strong symbol observable by dynamic linker
Hi,
I am doing a research project and need to add a new function, say
shift_sigaction, into glibc, and make it observable by the dynamic
linker (ld.so).
I have added entries in Versions file, to export the strong symbol. But
when building ld.so, it still cannot find the shift_sigaction:
=====================
/home/wuxi/shift/install/compiler-4.1.1/bin/gcc -nostdlib
-nostartfiles -shared \
-Wl,-z,combreloc -Wl,-z,defs -Wl,--verbose 2>&1 | \
LC_ALL=C \
sed -e '/^=========/,/^=========/!d;/^=========/d' \
-e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . -
SIZEOF_HEADERS;/' \
> /home/wuxi/shift/build/elf/ld.so.lds
/home/wuxi/shift/install/compiler-4.1.1/bin/gcc -nostdlib
-nostartfiles -shared -o
/home/wuxi/shift/build/elf/ld.so \
-Wl,-z,combreloc -Wl,-z,defs \
/home/wuxi/shift/build/elf/librtld.os
-Wl,--version-script=/home/wuxi/shift/build/ld.map \
-Wl,-soname=ld-linux-ia64.so.2 -T
/home/wuxi/shift/build/elf/ld.so.lds
/home/wuxi/shift/src/glibc2.5/shift/shift_bitmap_signal.o
/home/wuxi/shift/src/glibc2.5/shift/shift_bitmap_signal.o: In function
`B_hook_shift_sigaction_handler':
shift_bitmap_signal.c:(.text+0x72): undefined reference to `shift_sigaction'
shift_bitmap_signal.c:(.text+0xe2): undefined reference to `shift_sigaction'
/home/wuxi/shift/src/glibc2.5/shift/shift_bitmap_signal.o: In function
`B_sigaction':
shift_bitmap_signal.c:(.text+0x1c2): undefined reference to `shift_mmap'
collect2: ld returned 1 exit status
make[2]: *** [/home/wuxi/shift/build/elf/ld.so] Error 1
make[2]: Leaving directory `/home/wuxi/shift/src/glibc2.5/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/home/wuxi/shift/src/glibc2.5'
make: *** [all] Error 2
=====================
So, what do I miss here?
Thanks :-)
yours sincerely
andrew