|
From: <sv...@va...> - 2005-08-08 13:20:04
|
Author: sewardj
Date: 2005-08-08 14:19:58 +0100 (Mon, 08 Aug 2005)
New Revision: 4343
Log:
Fix enough stuff so that static linking of valgrind_memcheck at a
non-standard address actually works as claimed. The resulting
(direct-start-) memcheck can load and run ls, xedit, etc, although you
get swamped with errors because redirection isn't working for some
reason.
Modified:
branches/ASPACEM/coregrind/m_main.c
branches/ASPACEM/memcheck/Makefile.am
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-08-08 12:14:46 UTC (rev 4342=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-08-08 13:19:58 UTC (rev 4343=
)
@@ -151,56 +151,39 @@
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
=20
/* Look for our AUXV table */
-static int scan_auxv(void* init_sp)
+static void scan_auxv(void* init_sp)
{
struct ume_auxv *auxv =3D VG_(find_auxv)((UWord*)init_sp);
- int padfile =3D -1, found =3D 0;
=20
- for (; auxv->a_type !=3D AT_NULL; auxv++)
+ for (; auxv->a_type !=3D AT_NULL; auxv++) {
switch(auxv->a_type) {
- case AT_UME_PADFD:
- padfile =3D auxv->u.a_val;
- found |=3D 1;
- break;
-
- case AT_UME_EXECFD:
- vgexecfd =3D auxv->u.a_val;
- found |=3D 2;
- break;
-
# if defined(VGP_ppc32_linux)
- case AT_DCACHEBSIZE:
- case AT_ICACHEBSIZE:
- case AT_UCACHEBSIZE:
- if (auxv->u.a_val > 0) {
- VG_(cache_line_size_ppc32) =3D auxv->u.a_val;
- VG_(debugLog)(1, "main",=20
- "PPC32 cache line size %u (type %u)\n",=20
- (UInt)auxv->u.a_val, (UInt)auxv->a_type );
- }
- break;
+ case AT_DCACHEBSIZE:
+ case AT_ICACHEBSIZE:
+ case AT_UCACHEBSIZE:
+ if (auxv->u.a_val > 0) {
+ VG_(cache_line_size_ppc32) =3D auxv->u.a_val;
+ VG_(debugLog)(1, "main",=20
+ "PPC32 cache line size %u (type %u)\n",=20
+ (UInt)auxv->u.a_val, (UInt)auxv->a_type =
);
+ }
+ break;
=20
- case AT_HWCAP:
- VG_(debugLog)(1, "main", "PPC32 hwcaps(1): 0x%x\n", (UInt)auxv-=
>u.a_val);
- auxv->u.a_val &=3D ~0x10000000; /* claim there is no Altivec su=
pport */
- VG_(debugLog)(1, "main", "PPC32 hwcaps(2): 0x%x\n", (UInt)auxv-=
>u.a_val);
- break;
-# endif
+ case AT_HWCAP:
+ VG_(debugLog)(1, "main", "PPC32 hwcaps(1): 0x%x\n", (UInt)au=
xv->u.a_val);
+ auxv->u.a_val &=3D ~0x10000000; /* claim there is no Altivec=
support */
+ VG_(debugLog)(1, "main", "PPC32 hwcaps(2): 0x%x\n", (UInt)au=
xv->u.a_val);
+ break;
+# endif
=20
- case AT_PHDR:
- VG_(valgrind_base) =3D VG_PGROUNDDN(auxv->u.a_val);
- break;
+ case AT_PHDR:
+ VG_(valgrind_base) =3D VG_PGROUNDDN(auxv->u.a_val);
+ break;
=20
- default:
- break;
+ default:
+ break;
}
-
- if ( found !=3D (1|2) ) {
- fprintf(stderr, "valgrind: stage2 must be launched by stage1\n");
- exit(127);
}
- vg_assert(padfile >=3D 0);
- return padfile;
}
=20
=20
@@ -1029,7 +1012,7 @@
extern ToolInfo VG_(tool_info);
*toolinfo_out =3D &VG_(tool_info);
/* HHHHHHHHACCCCCCCCCCK */
- *preloadpath_out =3D "/home/sewardj/VgASPACE/aspace/coregrind/vg_prel=
oad_core.so";
+ *preloadpath_out =3D "/home/sewardj/VgASPACEM/aspacem/Inst/lib/valgri=
nd/vg_preload_core.so";
=20
//zz Bool ok;
//zz int len =3D strlen(VG_(libdir)) + strlen(toolname) + 16;
@@ -2504,7 +2487,7 @@
VG_(debugLog)(1, "main", "Doing scan_auxv()\n");
{
void* init_sp =3D argv - 1;
- padfile =3D scan_auxv(init_sp);
+ scan_auxv(init_sp);
}
=20
//--------------------------------------------------------------
@@ -2579,8 +2562,8 @@
// p: layout_remaining_space() [everything must be mapped in befor=
e now] =20
// p: load_client() [ditto]=20
//--------------------------------------------------------------
- as_unpad((void *)VG_(shadow_end), (void *)~0, padfile);
- as_closepadfile(padfile); // no more padding
+ //as_unpad((void *)VG_(shadow_end), (void *)~0, padfile);
+ //as_closepadfile(padfile); // no more padding
=20
//--------------------------------------------------------------
// Set up client's environment
Modified: branches/ASPACEM/memcheck/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/memcheck/Makefile.am 2005-08-08 12:14:46 UTC (rev 43=
42)
+++ branches/ASPACEM/memcheck/Makefile.am 2005-08-08 13:19:58 UTC (rev 43=
43)
@@ -23,12 +23,11 @@
mac_shared.c \
mc_translate.c
valgrind_memcheck_LDFLAGS =3D \
- $(top_srcdir)/coregrind/libcoregrind.a
+ -static \
+ $(top_srcdir)/coregrind/libcoregrind.a \
+ -Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
+ -Wl,-T,$(top_srcdir)/valt_load_address.lds
=20
-# \
-# -Wl,-T,$(top_srcdir)/valt_load_address.lds \
-# -Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@
-
mcincludedir =3D $(includedir)/valgrind
=20
mcinclude_HEADERS =3D \
|