This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
New .S file did not get compiled, please help
- From: wuxi <wu dot andrew dot xi at gmail dot com>
- To: glibc-help <libc-help at sourceware dot org>
- Date: Sun, 14 Sep 2008 00:21:29 +0800
- Subject: New .S file did not get compiled, please help
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=zzD6IgvmpMqJj3a+eSESOVaPZlYZ4+p1j+CJ/RVw7H4=; b=l3Bq5M+q5z0myMG8yOhO7u0OfRQDWsbTxObA91Y0TshJDiqpnIe7BiPAiYswZraN7i lk7KJpjLX3qC358+NcUjMAPFqf9PTANwOXM3cYZkQmNXsrMKKqGXx8IUguaqBrzarTzk uThPNyWy0aoPkgJOGHOYful2hXvB2qsRbEPUg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=DhyFmRMxKlRW0s2le1dcBlOHTYcWsL5QzqSaoeMLZBFcDq0i8s6J94d1Hjpytdiw5y bUsV8EAJDO0XRwWNDfKWqOxhKqyVI7wc4ORzXTJJoC9+CiBME3yRDKxLUFOqlA9SLrGW 9LlQHSCaBSNxKJByQAtlz941VKr/2aG2HSthY=
Hi,
I am working on ia64 and glibc-2.5. My goal is to do whole program
instrumentation to enable taint tracking.
For that purpose, I need a specific memcpy which is built for taint
tracking, so I did the following modifications to glibc (actually very
trivial modifications):
in string/memcpy.c, I rewrite the memcpy to call shift_memcpy (which is
the real memory copy routine) twice, one to write the bitmap for taint
tracking, one for the real memory copy. The skeleton of the code is
shown below:
=====================================================
void *
memcpy (dstpp, srcpp, len)
void *dstpp;
const void *srcpp;
size_t len;
{
...
shift_memcpy (dst, src, len); /* write the bitmap */
shift_memcpy (dst', src', len'); /* real memory copy */
...
}
======================================================
For performance reason, the shift_memcpy is implemented through reusing
the memcpy.S (sysdeps/ia64/memcpy.S) to shift-memcpy.S and modify the
definition of memcpy to shift_memcpy (That is, change entry(memcpy) to
entry(shift_memcpy), and so on). I have also added shift_memcpy to
Versions under "sysdeps/ia64".
However, when I get the modified glibc to build, it cannot find
shift_memcpy, and I traced the problem, found that shift_memcpy.S did
not get compiled... (that is, no shift_memcpy.o, shift_memcpy.os generated).
the full error is shown below:
=======================================================
/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/glibc2.5/elf/ld.so.lds
/home/wuxi/shift/install/compiler-4.1.1/bin/gcc -nostdlib
-nostartfiles -shared -o
/home/wuxi/shift/build/glibc2.5/elf/ld.so \
-Wl,-z,combreloc -Wl,-z,defs \
/home/wuxi/shift/build/glibc2.5/elf/librtld.os
-Wl,--version-script=/home/wuxi/shift/build/glibc2.5/ld.map \
-Wl,-soname=ld-linux-ia64.so.2 -T
/home/wuxi/shift/build/glibc2.5/elf/ld.so.lds
/home/wuxi/shift/build/glibc2.5/elf/librtld.os: In function `memcpy':
/home/wuxi/shift/src/glibc2.5/string/memcpy.c:52: undefined reference to
`shift_memcpy'
/home/wuxi/shift/src/glibc2.5/string/memcpy.c:59: undefined reference to
`shift_memcpy'
collect2: ld returned 1 exit status
make[2]: *** [/home/wuxi/shift/build/glibc2.5/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 did I miss here? Any help is truly appreciated. Thanks
yours sincerely
Andrew.