Remove valgrind's use of libc-supplied stat() and sbrk(). Now the only
sysbols we need from libc are __umoddi3 and __udivdi3 ; other than that
valgrind.so is completely self-contained.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@244 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_symtab2.c b/coregrind/vg_symtab2.c
index 0987f34..c781751 100644
--- a/coregrind/vg_symtab2.c
+++ b/coregrind/vg_symtab2.c
@@ -29,7 +29,6 @@
*/
#include "vg_include.h"
-#include "vg_unsafe.h"
#include <elf.h> /* ELF defns */
#include <a.out.h> /* stabs defns */
@@ -625,7 +624,7 @@
Bool ok;
Addr oimage;
Int n_oimage;
- struct stat stat_buf;
+ struct vki_stat stat_buf;
/* for the .stabs reader */
Int curr_filenmoff;
@@ -644,7 +643,7 @@
line number info out of it. It will be munmapped immediately
thereafter; it is only aboard transiently. */
- i = stat(si->filename, &stat_buf);
+ i = VG_(stat)(si->filename, &stat_buf);
if (i != 0) {
vg_symerr("Can't stat .so/.exe (to determine its size)?!");
return;
@@ -657,7 +656,8 @@
return;
}
- oimage = (Addr)VG_(mmap)( NULL, n_oimage, PROT_READ, MAP_PRIVATE, fd, 0 );
+ oimage = (Addr)VG_(mmap)( NULL, n_oimage,
+ VKI_PROT_READ, VKI_MAP_PRIVATE, fd, 0 );
if (oimage == ((Addr)(-1))) {
VG_(message)(Vg_UserMsg,
"mmap failed on %s", si->filename );