New .S file did not get compiled, please help
wuxi
wu.andrew.xi@gmail.com
Sat Sep 13 16:22:00 GMT 2008
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.
More information about the Libc-help
mailing list