|
From: <sv...@va...> - 2005-07-10 00:54:17
|
Author: sewardj
Date: 2005-07-10 01:53:42 +0100 (Sun, 10 Jul 2005)
New Revision: 4142
Log:
Clean up endianness macros a bit. Now pub_tool_basics.h defines
VG_LITTLEENDIAN or VG_BIGENDIAN and that's what should be used.
Modified:
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_ume.c
trunk/coregrind/pub_core_machine.h
trunk/include/pub_tool_basics.h
trunk/memcheck/mc_translate.c
Modified: trunk/coregrind/m_debuginfo/symtab.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
--- trunk/coregrind/m_debuginfo/symtab.c 2005-07-09 22:51:08 UTC (rev 414=
1)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-07-10 00:53:42 UTC (rev 414=
2)
@@ -906,7 +906,7 @@
&& ehdr->e_ident[EI_MAG2] =3D=3D 'L'
&& ehdr->e_ident[EI_MAG3] =3D=3D 'F');
ok &=3D (ehdr->e_ident[EI_CLASS] =3D=3D VG_ELF_CLASS
- && ehdr->e_ident[EI_DATA] =3D=3D VG_ELF_ENDIANNESS
+ && ehdr->e_ident[EI_DATA] =3D=3D VG_ELF_DATA2XXX
&& ehdr->e_ident[EI_VERSION] =3D=3D EV_CURRENT);
ok &=3D (ehdr->e_type =3D=3D ET_EXEC || ehdr->e_type =3D=3D ET_DYN=
);
ok &=3D (ehdr->e_machine =3D=3D VG_ELF_MACHINE);
Modified: trunk/coregrind/m_ume.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
--- trunk/coregrind/m_ume.c 2005-07-09 22:51:08 UTC (rev 4141)
+++ trunk/coregrind/m_ume.c 2005-07-10 00:53:42 UTC (rev 4142)
@@ -288,7 +288,7 @@
"(eg. 32-bit instead of 64-bit)\n");
goto bad;
}
- if (e->e.e_ident[EI_DATA] !=3D VG_ELF_ENDIANNESS) {
+ if (e->e.e_ident[EI_DATA] !=3D VG_ELF_DATA2XXX) {
fprintf(stderr, "valgrind: executable has wrong endian-ness\n");
goto bad;
}
Modified: trunk/coregrind/pub_core_machine.h
=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
--- trunk/coregrind/pub_core_machine.h 2005-07-09 22:51:08 UTC (rev 4141)
+++ trunk/coregrind/pub_core_machine.h 2005-07-10 00:53:42 UTC (rev 4142)
@@ -40,15 +40,15 @@
#include "pub_tool_machine.h"
=20
#if defined(VGA_x86)
-# define VG_ELF_ENDIANNESS ELFDATA2LSB
+# define VG_ELF_DATA2XXX ELFDATA2LSB
# define VG_ELF_MACHINE EM_386
# define VG_ELF_CLASS ELFCLASS32
#elif defined(VGA_amd64)
-# define VG_ELF_ENDIANNESS ELFDATA2LSB
+# define VG_ELF_DATA2XXX ELFDATA2LSB
# define VG_ELF_MACHINE EM_X86_64
# define VG_ELF_CLASS ELFCLASS64
#elif defined(VGA_ppc32)
-# define VG_ELF_ENDIANNESS ELFDATA2MSB
+# define VG_ELF_DATA2XXX ELFDATA2MSB
# define VG_ELF_MACHINE EM_PPC
# define VG_ELF_CLASS ELFCLASS32
#else
Modified: trunk/include/pub_tool_basics.h
=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
--- trunk/include/pub_tool_basics.h 2005-07-09 22:51:08 UTC (rev 4141)
+++ trunk/include/pub_tool_basics.h 2005-07-10 00:53:42 UTC (rev 4142)
@@ -109,13 +109,24 @@
SysRes;
=20
/* ---------------------------------------------------------------------
- Miscellaneous
+ Miscellaneous (word size, endianness, regparmness)
------------------------------------------------------------------ */
=20
-/* This is going to be either 4 or 8. */
+/* Word size: this is going to be either 4 or 8. */
// It should probably be in m_machine.
#define VG_WORDSIZE VEX_HOST_WORDSIZE
=20
+/* Endianness */
+#undef VG_BIGENDIAN
+#undef VG_LITTLEENDIAN
+
+#if defined(VGA_x86) || defined(VGA_amd64)
+# define VG_LITTLEENDIAN 1
+#elif defined(VGA_ppc32)
+# define VG_BIGENDIAN 1
+#endif
+
+/* Regparmness */
#if defined(VGA_x86)
# define VG_REGPARM(n) __attribute__((regparm(n)))
#elif defined(VGA_amd64) || defined(VGA_ppc32)
Modified: trunk/memcheck/mc_translate.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
--- trunk/memcheck/mc_translate.c 2005-07-09 22:51:08 UTC (rev 4141)
+++ trunk/memcheck/mc_translate.c 2005-07-10 00:53:42 UTC (rev 4142)
@@ -2367,9 +2367,9 @@
IREndness end;
=20
/* What's the native endianness? We need to know this. */
-# if defined(VKI_BIG_ENDIAN)
+# if defined(VG_BIGENDIAN)
end =3D Iend_BE;
-# elif defined(VKI_LITTLE_ENDIAN)
+# elif defined(VG_LITTLEENDIAN)
end =3D Iend_LE;
# else
# error "Unknown endianness"
|