3.9.0-0.1.TEST1 - Upgrade to valgrind 3.9.0.TEST1.

This commit is contained in:
Mark Wielaard 2013-10-30 23:32:55 +01:00
parent bd0310e531
commit fc26e0de2e
53 changed files with 74 additions and 13671 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/valgrind-3.8.0-TEST1.tar.bz2 /valgrind-3.8.0-TEST1.tar.bz2
/valgrind-3.8.0.tar.bz2 /valgrind-3.8.0.tar.bz2
/valgrind-3.8.1.tar.bz2 /valgrind-3.8.1.tar.bz2
/valgrind-3.9.0.TEST1.tar.bz2

View File

@ -1 +1 @@
288758010b271119a0ffc0183f1d6e38 valgrind-3.8.1.tar.bz2 c955bdb3f24379e8b225b3da2d1d30a1 valgrind-3.9.0.TEST1.tar.bz2

View File

@ -1,160 +0,0 @@
commit 58d9ce4730d95103c9388be264a170ab852432a9
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Thu Apr 11 17:55:39 2013 +0000
read_unitinfo_dwarf2 DW_FORM_ref_addr is address size in DWARF version 2.
Bug #305513 contained a patch for some extra robustness checks. But
the real cause of crashing in the read_unitinfo_dwarf2 DWARF reader
seemed to have been this issue where DWARF version 2 DWZ partial_units
were read and DW_FORM_ref_addr had an unexpected size. This combination
is rare. DWARF version 4 is the current default version of GCC.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13367 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c
index ce34bc7..52a9099 100644
--- a/coregrind/m_debuginfo/readdwarf.c
+++ b/coregrind/m_debuginfo/readdwarf.c
@@ -991,7 +991,7 @@ void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui,
UInt acode, abcode;
ULong atoffs, blklen;
Int level;
- /* UShort ver; */
+ UShort ver;
UChar addr_size;
UChar* p = unitblock_img;
@@ -1008,7 +1008,7 @@ void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui,
p += ui->dw64 ? 12 : 4;
/* version should be 2, 3 or 4 */
- /* ver = ML_(read_UShort)(p); */
+ ver = ML_(read_UShort)(p);
p += 2;
/* get offset in abbrev */
@@ -1122,7 +1122,7 @@ void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui,
case 0x0c: /* FORM_flag */ p++; break;
case 0x0d: /* FORM_sdata */ read_leb128S( &p ); break;
case 0x0f: /* FORM_udata */ read_leb128U( &p ); break;
- case 0x10: /* FORM_ref_addr */ p += ui->dw64 ? 8 : 4; break;
+ case 0x10: /* FORM_ref_addr */ p += (ver == 2) ? addr_size : (ui->dw64 ? 8 : 4); break;
case 0x11: /* FORM_ref1 */ p++; break;
case 0x12: /* FORM_ref2 */ p += 2; break;
case 0x13: /* FORM_ref4 */ p += 4; break;
commit 4c3b2379fb2cb97f762617df7770b042b1f8a59c
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Wed Apr 17 13:48:29 2013 +0000
Simplify read_unitinfo_dwarf2. Only try to read the first DIE.
Bug #305513. We should only read the first DIE of a compilation unit.
Each compilation unit header is followed by a single DW_TAG_compile_unit
(or DW_TAG_partial_unit, but those aren't important here) and its children.
There is no reason to read any of the children at this point. If the first
DIE isn't a DW_TAG_compile_unit we are done, none of the child DIEs will
provide any useful information.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13369 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c
index 52a9099..764295c 100644
--- a/coregrind/m_debuginfo/readdwarf.c
+++ b/coregrind/m_debuginfo/readdwarf.c
@@ -965,12 +965,14 @@ static UChar* lookup_abbrev( UChar* p, UInt acode )
}
/* Read general information for a particular compile unit block in
- * the .debug_info section.
+ * the .debug_info section. In particular read the name, compdir and
+ * stmt_list needed to parse the line number information.
*
* Input: - unitblock is the start of a compilation
* unit block in .debuginfo section
* - debugabbrev is start of .debug_abbrev section
* - debugstr is start of .debug_str section
+ * - debugstr_alt_img is start of .debug_str section in alt debug file
*
* Output: Fill members of ui pertaining to the compilation unit:
* - ui->name is the name of the compilation unit
@@ -990,7 +992,6 @@ void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui,
{
UInt acode, abcode;
ULong atoffs, blklen;
- Int level;
UShort ver;
UChar addr_size;
@@ -1021,39 +1022,32 @@ void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui,
end_img = unitblock_img
+ blklen + (ui->dw64 ? 12 : 4); /* End of this block */
- level = 0; /* Level in the abbrev tree */
abbrev_img = debugabbrev_img
+ atoffs; /* Abbreviation data for this block */
- /* Read the compilation unit entries */
- while ( p < end_img ) {
- Bool has_child;
+ /* Read the compilation unit entry - this is always the first DIE.
+ * See DWARF4 para 7.5. */
+ if ( p < end_img ) {
UInt tag;
acode = read_leb128U( &p ); /* abbreviation code */
- if ( acode == 0 ) {
- /* NULL entry used for padding - or last child for a sequence
- - see para 7.5.3 */
- level--;
- continue;
- }
/* Read abbreviation header */
abcode = read_leb128U( &abbrev_img ); /* abbreviation code */
if ( acode != abcode ) {
- /* We are in in children list, and must rewind to a
- * previously declared abbrev code. This code works but is
- * not triggered since we shortcut the parsing once we have
- * read the compile_unit block. This should only occur when
- * level > 0 */
+ /* This isn't illegal, but somewhat unlikely. Normally the
+ * first abbrev describes the first DIE, the compile_unit.
+ * But maybe this abbrevation data is shared with another
+ * or it is a NULL entry used for padding. See para 7.5.3. */
abbrev_img = lookup_abbrev( debugabbrev_img + atoffs, acode );
}
tag = read_leb128U( &abbrev_img );
- has_child = *(abbrev_img++) == 1; /* DW_CHILDREN_yes */
- if ( has_child )
- level++;
+ if ( tag != 0x0011 /*TAG_compile_unit*/ )
+ return; /* Not a compile unit (might be partial) or broken DWARF. */
+
+ abbrev_img++; /* DW_CHILDREN_yes or DW_CHILDREN_no */
/* And loop on entries */
for ( ; ; ) {
@@ -1151,16 +1145,9 @@ void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui,
else if ( name == 0x10 ) ui->stmt_list = cval; /* DW_AT_stmt_list */
}
}
- /* Shortcut the parsing once we have read the compile_unit block
- * That's enough info for us, and we are not gdb ! */
- if ( tag == 0x0011 /*TAG_compile_unit*/ )
- break;
- } /* Loop on each sub block */
-
- /* This test would be valid if we were not shortcutting the parsing
- if (level != 0)
- VG_(printf)( "#### Exiting debuginfo block at level %d !!!\n", level );
- */
+ } /* Just read the first DIE, if that wasn't the compile_unit then
+ * this might have been a partial unit or broken DWARF info.
+ * That's enough info for us, and we are not gdb ! */
}

View File

@ -1,288 +0,0 @@
commit ada5ad79e5d8ecf47838319a46ea4671079e6291
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Wed May 22 10:21:10 2013 +0000
Support Linux kernel AF_BLUETOOTH for bind().
Bug #320116. sockaddr_rc might contain some padding which might not be
initialized. Explicitly check the sockaddr_rc fields are set. That also
produces better diagnostics about which field is unitialized.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13404 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c
index 40a4bbe..3a6ea82 100644
--- a/coregrind/m_syswrap/syswrap-generic.c
+++ b/coregrind/m_syswrap/syswrap-generic.c
@@ -941,6 +941,7 @@ void pre_mem_read_sockaddr ( ThreadId tid,
struct vki_sockaddr_un* sun = (struct vki_sockaddr_un *)sa;
struct vki_sockaddr_in* sin = (struct vki_sockaddr_in *)sa;
struct vki_sockaddr_in6* sin6 = (struct vki_sockaddr_in6 *)sa;
+ struct vki_sockaddr_rc* rc = (struct vki_sockaddr_rc *)sa;
/* NULL/zero-length sockaddrs are legal */
if ( sa == NULL || salen == 0 ) return;
@@ -981,6 +982,13 @@ void pre_mem_read_sockaddr ( ThreadId tid,
(Addr) &sin6->sin6_scope_id, sizeof (sin6->sin6_scope_id) );
break;
+ case VKI_AF_BLUETOOTH:
+ VG_(sprintf) ( outmsg, description, "rc_bdaddr" );
+ PRE_MEM_READ( outmsg, (Addr) &rc->rc_bdaddr, sizeof (rc->rc_bdaddr) );
+ VG_(sprintf) ( outmsg, description, "rc_channel" );
+ PRE_MEM_READ( outmsg, (Addr) &rc->rc_channel, sizeof (rc->rc_channel) );
+ break;
+
default:
VG_(sprintf) ( outmsg, description, "" );
PRE_MEM_READ( outmsg, (Addr) sa, salen );
diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h
index c57cabd..08ab138 100644
--- a/include/vki/vki-linux.h
+++ b/include/vki/vki-linux.h
@@ -676,6 +676,7 @@ __KINLINE struct vki_cmsghdr * vki_cmsg_nxthdr (struct vki_msghdr *__msg, struct
#define VKI_AF_UNIX 1 /* Unix domain sockets */
#define VKI_AF_INET 2 /* Internet IP Protocol */
#define VKI_AF_INET6 10 /* IP version 6 */
+#define VKI_AF_BLUETOOTH 31 /* Bluetooth sockets */
#define VKI_MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
@@ -2968,6 +2969,16 @@ struct vki_hci_inquiry_req {
};
//----------------------------------------------------------------------
+// From linux-3.9.2/include/net/bluetooth/rfcomm.h
+//----------------------------------------------------------------------
+
+struct vki_sockaddr_rc {
+ vki_sa_family_t rc_family;
+ vki_bdaddr_t rc_bdaddr;
+ __vki_u8 rc_channel;
+};
+
+//----------------------------------------------------------------------
// From linux-3.4/include/linux/kvm.h
//----------------------------------------------------------------------
#define KVMIO 0xAE
diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am
index 4cc9113..9755f5c 100644
--- a/memcheck/tests/linux/Makefile.am
+++ b/memcheck/tests/linux/Makefile.am
@@ -8,6 +8,7 @@ EXTRA_DIST = \
capget.vgtest capget.stderr.exp capget.stderr.exp2 \
lsframe1.vgtest lsframe1.stdout.exp lsframe1.stderr.exp \
lsframe2.vgtest lsframe2.stdout.exp lsframe2.stderr.exp \
+ rfcomm.vgtest rfcomm.stderr.exp \
sigqueue.vgtest sigqueue.stderr.exp \
stack_changes.stderr.exp stack_changes.stdout.exp \
stack_changes.stdout.exp2 stack_changes.vgtest \
@@ -26,6 +27,7 @@ check_PROGRAMS = \
getregset \
lsframe1 \
lsframe2 \
+ rfcomm \
sigqueue \
stack_changes \
stack_switch \
diff --git a/memcheck/tests/linux/rfcomm.c b/memcheck/tests/linux/rfcomm.c
new file mode 100644
index 0000000..02dcd7e
--- /dev/null
+++ b/memcheck/tests/linux/rfcomm.c
@@ -0,0 +1,54 @@
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+/* user space headers might not be there, define things ourselves. */
+typedef struct {
+ uint8_t b[6];
+} __attribute__((packed)) vui_bdaddr_t;
+
+struct vui_sockaddr_rc {
+ sa_family_t rc_family;
+ vui_bdaddr_t rc_bdaddr;
+ uint8_t rc_channel;
+};
+
+#define VUI_AF_BLUETOOTH 31
+#define VUI_BTPROTO_RFCOMM 3
+
+#define VUI_BDADDR_ANY (&(vui_bdaddr_t) {{0, 0, 0, 0, 0, 0}})
+
+int
+main (int argc, char **argv)
+{
+ int nSocket;
+
+ nSocket = socket(VUI_AF_BLUETOOTH, SOCK_STREAM, VUI_BTPROTO_RFCOMM);
+
+ if (nSocket < 0)
+ {
+ // Not supported, nothing to test...
+ return 1;
+ }
+
+ struct vui_sockaddr_rc aAddr;
+ // Ignore return values.
+
+ // Missing family
+ bind(nSocket, (struct sockaddr *) &aAddr, sizeof(aAddr));
+
+ aAddr.rc_family = VUI_AF_BLUETOOTH;
+ // Missing bdaddr.
+ bind(nSocket, (struct sockaddr *) &aAddr, sizeof(aAddr));
+
+ aAddr.rc_bdaddr = *VUI_BDADDR_ANY;
+ // Missing channel.
+ bind(nSocket, (struct sockaddr *) &aAddr, sizeof(aAddr));
+
+ aAddr.rc_channel = 5;
+ bind(nSocket, (struct sockaddr *) &aAddr, sizeof(aAddr));
+
+ return 0;
+}
diff --git a/memcheck/tests/linux/rfcomm.stderr.exp b/memcheck/tests/linux/rfcomm.stderr.exp
new file mode 100644
index 0000000..4df935b
--- /dev/null
+++ b/memcheck/tests/linux/rfcomm.stderr.exp
@@ -0,0 +1,21 @@
+Syscall param socketcall.bind(my_addr.sa_family) points to uninitialised byte(s)
+ ...
+ by 0x........: main (rfcomm.c:40)
+ Address 0x........ is on thread 1's stack
+ Uninitialised value was created by a stack allocation
+ at 0x........: main (rfcomm.c:25)
+
+Syscall param socketcall.bind(my_addr.rc_bdaddr) points to uninitialised byte(s)
+ ...
+ by 0x........: main (rfcomm.c:44)
+ Address 0x........ is on thread 1's stack
+ Uninitialised value was created by a stack allocation
+ at 0x........: main (rfcomm.c:25)
+
+Syscall param socketcall.bind(my_addr.rc_channel) points to uninitialised byte(s)
+ ...
+ by 0x........: main (rfcomm.c:48)
+ Address 0x........ is on thread 1's stack
+ Uninitialised value was created by a stack allocation
+ at 0x........: main (rfcomm.c:25)
+
diff --git a/memcheck/tests/linux/rfcomm.vgtest b/memcheck/tests/linux/rfcomm.vgtest
new file mode 100644
index 0000000..490aef4
--- /dev/null
+++ b/memcheck/tests/linux/rfcomm.vgtest
@@ -0,0 +1,5 @@
+prog: rfcomm
+vgopts: -q --track-origins=yes
+
+# Will exit -1 if AF_BLUETOOTH not supported
+prereq: ./rfcomm
commit 4cb663fdaa2a63efc447f7251270446c4e8c9611
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Wed May 22 10:37:52 2013 +0000
Don't break platforms without AF_BLUETOOTH.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13405 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c
index 3a6ea82..b85fd9c 100644
--- a/coregrind/m_syswrap/syswrap-generic.c
+++ b/coregrind/m_syswrap/syswrap-generic.c
@@ -941,7 +941,9 @@ void pre_mem_read_sockaddr ( ThreadId tid,
struct vki_sockaddr_un* sun = (struct vki_sockaddr_un *)sa;
struct vki_sockaddr_in* sin = (struct vki_sockaddr_in *)sa;
struct vki_sockaddr_in6* sin6 = (struct vki_sockaddr_in6 *)sa;
+#ifdef VKI_AF_BLUETOOTH
struct vki_sockaddr_rc* rc = (struct vki_sockaddr_rc *)sa;
+#endif
/* NULL/zero-length sockaddrs are legal */
if ( sa == NULL || salen == 0 ) return;
@@ -981,13 +983,15 @@ void pre_mem_read_sockaddr ( ThreadId tid,
PRE_MEM_READ( outmsg,
(Addr) &sin6->sin6_scope_id, sizeof (sin6->sin6_scope_id) );
break;
-
+
+#ifdef VKI_AF_BLUETOOTH
case VKI_AF_BLUETOOTH:
VG_(sprintf) ( outmsg, description, "rc_bdaddr" );
PRE_MEM_READ( outmsg, (Addr) &rc->rc_bdaddr, sizeof (rc->rc_bdaddr) );
VG_(sprintf) ( outmsg, description, "rc_channel" );
PRE_MEM_READ( outmsg, (Addr) &rc->rc_channel, sizeof (rc->rc_channel) );
break;
+#endif
default:
VG_(sprintf) ( outmsg, description, "" );
--- valgrind-3.8.1.orig/memcheck/tests/linux/Makefile.in 2013-07-08 15:15:20.579962577 +0200
+++ valgrind-3.8.1/memcheck/tests/linux/Makefile.in 2013-07-08 16:12:36.353352626 +0200
@@ -55,8 +55,8 @@
@VGCONF_HAVE_PLATFORM_SEC_TRUE@ -DVGP_SEC_@VGCONF_ARCH_PRI@_@VGCONF_OS@=1
check_PROGRAMS = brk$(EXEEXT) capget$(EXEEXT) getregset$(EXEEXT) \
- lsframe1$(EXEEXT) lsframe2$(EXEEXT) sigqueue$(EXEEXT) \
- stack_changes$(EXEEXT) stack_switch$(EXEEXT) \
+ lsframe1$(EXEEXT) lsframe2$(EXEEXT) rfcomm$(EXEEXT) \
+ sigqueue$(EXEEXT) stack_changes$(EXEEXT) stack_switch$(EXEEXT) \
syscalls-2007$(EXEEXT) syslog-syscall$(EXEEXT) \
timerfd-syscall$(EXEEXT) proc-auxv$(EXEEXT)
subdir = memcheck/tests/linux
@@ -86,6 +86,9 @@
proc_auxv_SOURCES = proc-auxv.c
proc_auxv_OBJECTS = proc-auxv.$(OBJEXT)
proc_auxv_LDADD = $(LDADD)
+rfcomm_SOURCES = rfcomm.c
+rfcomm_OBJECTS = rfcomm.$(OBJEXT)
+rfcomm_LDADD = $(LDADD)
sigqueue_SOURCES = sigqueue.c
sigqueue_OBJECTS = sigqueue.$(OBJEXT)
sigqueue_LDADD = $(LDADD)
@@ -114,10 +117,10 @@
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = brk.c capget.c getregset.c lsframe1.c lsframe2.c proc-auxv.c \
- sigqueue.c stack_changes.c stack_switch.c syscalls-2007.c \
- syslog-syscall.c timerfd-syscall.c
+ rfcomm.c sigqueue.c stack_changes.c stack_switch.c \
+ syscalls-2007.c syslog-syscall.c timerfd-syscall.c
DIST_SOURCES = brk.c capget.c getregset.c lsframe1.c lsframe2.c \
- proc-auxv.c sigqueue.c stack_changes.c stack_switch.c \
+ proc-auxv.c rfcomm.c sigqueue.c stack_changes.c stack_switch.c \
syscalls-2007.c syslog-syscall.c timerfd-syscall.c
ETAGS = etags
CTAGS = ctags
@@ -405,6 +408,7 @@
capget.vgtest capget.stderr.exp capget.stderr.exp2 \
lsframe1.vgtest lsframe1.stdout.exp lsframe1.stderr.exp \
lsframe2.vgtest lsframe2.stdout.exp lsframe2.stderr.exp \
+ rfcomm.vgtest rfcomm.stderr.exp \
sigqueue.vgtest sigqueue.stderr.exp \
stack_changes.stderr.exp stack_changes.stdout.exp \
stack_changes.stdout.exp2 stack_changes.vgtest \
@@ -473,6 +477,9 @@
proc-auxv$(EXEEXT): $(proc_auxv_OBJECTS) $(proc_auxv_DEPENDENCIES)
@rm -f proc-auxv$(EXEEXT)
$(LINK) $(proc_auxv_OBJECTS) $(proc_auxv_LDADD) $(LIBS)
+rfcomm$(EXEEXT): $(rfcomm_OBJECTS) $(rfcomm_DEPENDENCIES)
+ @rm -f rfcomm$(EXEEXT)
+ $(LINK) $(rfcomm_OBJECTS) $(rfcomm_LDADD) $(LIBS)
sigqueue$(EXEEXT): $(sigqueue_OBJECTS) $(sigqueue_DEPENDENCIES)
@rm -f sigqueue$(EXEEXT)
$(LINK) $(sigqueue_OBJECTS) $(sigqueue_LDADD) $(LIBS)
@@ -504,6 +511,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsframe1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsframe2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc-auxv.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfcomm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigqueue.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack_changes.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack_switch.Po@am__quote@

View File

@ -1,17 +0,0 @@
Index: valgrind/coregrind/m_aspacemgr/aspacemgr-linux.c
===================================================================
--- valgrind/coregrind/m_aspacemgr/aspacemgr-linux.c (revision 13043)
+++ valgrind/coregrind/m_aspacemgr/aspacemgr-linux.c (working copy)
@@ -265,10 +265,10 @@
/* ------ start of STATE for the address-space manager ------ */
/* Max number of segments we can track. */
-#define VG_N_SEGMENTS 5000
+#define VG_N_SEGMENTS 50000
/* Max number of segment file names we can track. */
-#define VG_N_SEGNAMES 1000
+#define VG_N_SEGNAMES 25000
/* Max length of a segment file name. */
#define VG_MAX_SEGNAMELEN 1000

Binary file not shown.

View File

@ -1,21 +0,0 @@
--- valgrind/none/tests/amd64/avx2-1.vgtest 2012-09-19 16:40:20.675627549 +0200
+++ valgrind/none/tests/amd64/avx2-1.vgtest 2012-09-19 20:53:16.939765249 +0200
@@ -1,3 +1,3 @@
prog: avx2-1
-prereq: ../../../tests/x86_amd64_features amd64-avx
+prereq: test -x avx2-1 && ../../../tests/x86_amd64_features amd64-avx
vgopts: -q
--- valgrind/none/tests/amd64/bmi.vgtest 2012-09-19 16:40:20.368622951 +0200
+++ valgrind/none/tests/amd64/bmi.vgtest 2012-09-19 20:54:31.168839454 +0200
@@ -1,3 +1,3 @@
prog: bmi
-prereq: ../../../tests/x86_amd64_features amd64-avx
+prereq: test -x bmi && ../../../tests/x86_amd64_features amd64-avx
vgopts: -q
--- valgrind/none/tests/amd64/fma.vgtest 2012-09-19 16:40:20.755628747 +0200
+++ valgrind/none/tests/amd64/fma.vgtest 2012-09-19 20:54:58.851240219 +0200
@@ -1,3 +1,3 @@
prog: fma
-prereq: ../../../tests/x86_amd64_features amd64-avx
+prereq: test -x fma && ../../../tests/x86_amd64_features amd64-avx
vgopts: -q

View File

@ -1,28 +0,0 @@
--- valgrind/configure 2012-09-12 20:20:29.868427602 +0200
+++ valgrind/configure 2012-09-13 18:28:42.354382238 +0200
@@ -8389,9 +8389,9 @@
do { unsigned int h, l;
__asm__ __volatile__(
- "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) ); }
+ "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) );
__asm__ __volatile__(
- "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "g" (0x7654321) : "edx" ); }
+ "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "rm" (0x7654321) : "edx" ); }
while (0)
;
--- valgrind/configure.in 2012-09-13 14:53:45.826948006 +0200
+++ valgrind/configure.in 2012-09-13 18:28:20.725057751 +0200
@@ -1822,9 +1822,9 @@
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
do { unsigned int h, l;
__asm__ __volatile__(
- "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) ); }
+ "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) );
__asm__ __volatile__(
- "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "g" (0x7654321) : "edx" ); }
+ "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "rm" (0x7654321) : "edx" ); }
while (0)
]])], [
ac_have_as_bmi=yes

View File

@ -1,50 +0,0 @@
#include <sys/capability.h>
#include <stddef.h>
#include <stdio.h>
int
main (int c, char **argv)
{
struct __user_cap_header_struct hdr;
hdr.version = _LINUX_CAPABILITY_VERSION;
hdr.pid = 0;
(void) capget(&hdr, NULL);
switch (hdr.version) {
case _LINUX_CAPABILITY_VERSION_1:
printf("Version 1\n");
break;
case _LINUX_CAPABILITY_VERSION_2:
printf("Version 2\n");
break;
default:
printf("Unknown version\n");
break;
}
return 0;
}
--- valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c.jj 2010-04-07 08:14:12.000000000 -0400
+++ valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c 2010-04-12 07:24:12.838876000 -0400
@@ -2212,8 +2212,9 @@ PRE(sys_capget)
vki_cap_user_header_t, header, vki_cap_user_data_t, data);
PRE_MEM_READ( "capget(header)", ARG1,
sizeof(struct __vki_user_cap_header_struct) );
- PRE_MEM_WRITE( "capget(data)", ARG2,
- sizeof(struct __vki_user_cap_data_struct) );
+ if (ARG2 != (Addr)NULL)
+ PRE_MEM_WRITE( "capget(data)", ARG2,
+ sizeof(struct __vki_user_cap_data_struct) );
}
POST(sys_capget)
{
--- valgrind/memcheck/tests/x86-linux/scalar.c (revision 13010)
+++ valgrind/memcheck/tests/x86-linux/scalar.c (working copy)
@@ -813,7 +813,7 @@
// __NR_capget 184
GO(__NR_capget, "2s 2m");
- SY(__NR_capget, x0, x0); FAIL;
+ SY(__NR_capget, x0, x0+1); FAIL;
// __NR_capset 185
GO(__NR_capset, "2s 2m");

View File

@ -1,415 +0,0 @@
------------------------------------------------------------------------
r13008 | tom | 2012-09-21 10:57:46 +0200 (Fri, 21 Sep 2012) | 3 lines
When processing DW_OP_plus_uconst make sure we record an add, not
whatever binary operation we happened to see last.
------------------------------------------------------------------------
r13009 | tom | 2012-09-21 11:04:27 +0200 (Fri, 21 Sep 2012) | 2 lines
Rename CfiOp to CfiBinop in preparation for adding unary operators.
------------------------------------------------------------------------
r13010 | tom | 2012-09-21 11:12:30 +0200 (Fri, 21 Sep 2012) | 3 lines
Implement some extra DW_OPs - more constants and some unary operators.
Patch from Mark Wielaard on BZ#307038.
------------------------------------------------------------------------
Index: valgrind/coregrind/m_debuginfo/readdwarf.c
===================================================================
--- valgrind/coregrind/m_debuginfo/readdwarf.c (revision 13007)
+++ valgrind/coregrind/m_debuginfo/readdwarf.c (working copy)
@@ -2728,12 +2728,13 @@
sp--; \
} while (0)
- Int ix, ix2, reg;
- UChar opcode;
- Word sw;
- UWord uw;
- CfiOp op;
- HChar* opname;
+ Int ix, ix2, reg;
+ UChar opcode;
+ Word sw;
+ UWord uw;
+ CfiUnop uop;
+ CfiBinop bop;
+ HChar* opname;
Int sp; /* # of top element: valid is -1 .. N_EXPR_STACK-1 */
Int stack[N_EXPR_STACK]; /* indices into ctx->exprs */
@@ -2752,7 +2753,7 @@
if (ctxs->cfa_is_regoff) {
/* cfa is reg +/- offset */
ix = ML_(CfiExpr_Binop)( dst,
- Cop_Add,
+ Cbinop_Add,
ML_(CfiExpr_DwReg)( dst, ctxs->cfa_reg ),
ML_(CfiExpr_Const)( dst, (UWord)(Word)ctxs->cfa_off )
);
@@ -2778,7 +2779,7 @@
break;
}
- op = 0; opname = NULL; /* excessively conservative */
+ uop = 0; bop = 0; opname = NULL; /* excessively conservative */
opcode = *expr++;
switch (opcode) {
@@ -2798,7 +2799,7 @@
vg_assert(reg >= 0 && reg <= 31);
sw = read_leb128S( &expr );
ix = ML_(CfiExpr_Binop)( dst,
- Cop_Add,
+ Cbinop_Add,
ML_(CfiExpr_DwReg)( dst, reg ),
ML_(CfiExpr_Const)( dst, (UWord)sw )
);
@@ -2822,7 +2823,7 @@
PUSH( ML_(CfiExpr_Const)( dst, uw ) );
POP( ix );
POP( ix2 );
- PUSH( ML_(CfiExpr_Binop)( dst, op, ix2, ix ) );
+ PUSH( ML_(CfiExpr_Binop)( dst, Cbinop_Add, ix2, ix ) );
if (ddump_frames)
VG_(printf)("DW_OP_plus_uconst: %lu", uw);
break;
@@ -2836,6 +2837,15 @@
VG_(printf)("DW_OP_const4s: %ld", sw);
break;
+ case DW_OP_const2s:
+ /* push: 16-bit signed immediate */
+ sw = read_le_s_encoded_literal( expr, 2 );
+ expr += 2;
+ PUSH( ML_(CfiExpr_Const)( dst, (UWord)sw ) );
+ if (ddump_frames)
+ VG_(printf)("DW_OP_const2s: %ld", sw);
+ break;
+
case DW_OP_const1s:
/* push: 8-bit signed immediate */
sw = read_le_s_encoded_literal( expr, 1 );
@@ -2845,34 +2855,74 @@
VG_(printf)("DW_OP_const1s: %ld", sw);
break;
+ case DW_OP_const1u:
+ /* push: 8-bit unsigned immediate */
+ uw = read_le_u_encoded_literal( expr, 1 );
+ expr += 1;
+ PUSH( ML_(CfiExpr_Const)( dst, uw ) );
+ if (ddump_frames)
+ VG_(printf)("DW_OP_const1: %lu", uw);
+ break;
+
+ case DW_OP_const2u:
+ /* push: 16-bit unsigned immediate */
+ uw = read_le_u_encoded_literal( expr, 2 );
+ expr += 2;
+ PUSH( ML_(CfiExpr_Const)( dst, uw ) );
+ if (ddump_frames)
+ VG_(printf)("DW_OP_const2: %lu", uw);
+ break;
+
+ case DW_OP_const4u:
+ /* push: 32-bit unsigned immediate */
+ uw = read_le_u_encoded_literal( expr, 4 );
+ expr += 4;
+ PUSH( ML_(CfiExpr_Const)( dst, uw ) );
+ if (ddump_frames)
+ VG_(printf)("DW_OP_const4: %lu", uw);
+ break;
+
+ case DW_OP_abs:
+ uop = Cunop_Abs; opname = "abs"; goto unop;
+ case DW_OP_neg:
+ uop = Cunop_Neg; opname = "neg"; goto unop;
+ case DW_OP_not:
+ uop = Cunop_Not; opname = "not"; goto unop;
+ unop:
+ POP( ix );
+ PUSH( ML_(CfiExpr_Unop)( dst, uop, ix ) );
+ if (ddump_frames)
+ VG_(printf)("DW_OP_%s", opname);
+ break;
+
case DW_OP_minus:
- op = Cop_Sub; opname = "minus"; goto binop;
+ bop = Cbinop_Sub; opname = "minus"; goto binop;
case DW_OP_plus:
- op = Cop_Add; opname = "plus"; goto binop;
+ bop = Cbinop_Add; opname = "plus"; goto binop;
case DW_OP_and:
- op = Cop_And; opname = "and"; goto binop;
+ bop = Cbinop_And; opname = "and"; goto binop;
case DW_OP_mul:
- op = Cop_Mul; opname = "mul"; goto binop;
+ bop = Cbinop_Mul; opname = "mul"; goto binop;
case DW_OP_shl:
- op = Cop_Shl; opname = "shl"; goto binop;
+ bop = Cbinop_Shl; opname = "shl"; goto binop;
case DW_OP_shr:
- op = Cop_Shr; opname = "shr"; goto binop;
+ bop = Cbinop_Shr; opname = "shr"; goto binop;
case DW_OP_eq:
- op = Cop_Eq; opname = "eq"; goto binop;
+ bop = Cbinop_Eq; opname = "eq"; goto binop;
case DW_OP_ge:
- op = Cop_Ge; opname = "ge"; goto binop;
+ bop = Cbinop_Ge; opname = "ge"; goto binop;
case DW_OP_gt:
- op = Cop_Gt; opname = "gt"; goto binop;
+ bop = Cbinop_Gt; opname = "gt"; goto binop;
case DW_OP_le:
- op = Cop_Le; opname = "le"; goto binop;
+ bop = Cbinop_Le; opname = "le"; goto binop;
case DW_OP_lt:
- op = Cop_Lt; opname = "lt"; goto binop;
+ bop = Cbinop_Lt; opname = "lt"; goto binop;
case DW_OP_ne:
- op = Cop_Ne; opname = "ne"; goto binop;
+ bop = Cbinop_Ne; opname = "ne"; goto binop;
binop:
POP( ix );
POP( ix2 );
- PUSH( ML_(CfiExpr_Binop)( dst, op, ix2, ix ) );
+ PUSH( ML_(CfiExpr_Binop)( dst, bop, ix2, ix ) );
if (ddump_frames)
VG_(printf)("DW_OP_%s", opname);
break;
Index: coregrind/m_debuginfo/debuginfo.c
===================================================================
--- valgrind/coregrind/m_debuginfo/debuginfo.c (revision 13007)
+++ valgrind/coregrind/m_debuginfo/debuginfo.c (working copy)
@@ -2051,30 +2051,40 @@
UWord evalCfiExpr ( XArray* exprs, Int ix,
CfiExprEvalContext* eec, Bool* ok )
{
- UWord wL, wR;
+ UWord w, wL, wR;
Addr a;
CfiExpr* e;
vg_assert(sizeof(Addr) == sizeof(UWord));
e = VG_(indexXA)( exprs, ix );
switch (e->tag) {
+ case Cex_Unop:
+ w = evalCfiExpr( exprs, e->Cex.Unop.ix, eec, ok );
+ if (!(*ok)) return 0;
+ switch (e->Cex.Unop.op) {
+ case Cunop_Abs: return (Word) w < 0 ? - w : w;
+ case Cunop_Neg: return - (Word) w;
+ case Cunop_Not: return ~ w;
+ default: goto unhandled;
+ }
+ /*NOTREACHED*/
case Cex_Binop:
wL = evalCfiExpr( exprs, e->Cex.Binop.ixL, eec, ok );
if (!(*ok)) return 0;
wR = evalCfiExpr( exprs, e->Cex.Binop.ixR, eec, ok );
if (!(*ok)) return 0;
switch (e->Cex.Binop.op) {
- case Cop_Add: return wL + wR;
- case Cop_Sub: return wL - wR;
- case Cop_And: return wL & wR;
- case Cop_Mul: return wL * wR;
- case Cop_Shl: return wL << wR;
- case Cop_Shr: return wL >> wR;
- case Cop_Eq: return wL == wR ? 1 : 0;
- case Cop_Ge: return (Word) wL >= (Word) wR ? 1 : 0;
- case Cop_Gt: return (Word) wL > (Word) wR ? 1 : 0;
- case Cop_Le: return (Word) wL <= (Word) wR ? 1 : 0;
- case Cop_Lt: return (Word) wL < (Word) wR ? 1 : 0;
- case Cop_Ne: return wL != wR ? 1 : 0;
+ case Cbinop_Add: return wL + wR;
+ case Cbinop_Sub: return wL - wR;
+ case Cbinop_And: return wL & wR;
+ case Cbinop_Mul: return wL * wR;
+ case Cbinop_Shl: return wL << wR;
+ case Cbinop_Shr: return wL >> wR;
+ case Cbinop_Eq: return wL == wR ? 1 : 0;
+ case Cbinop_Ge: return (Word) wL >= (Word) wR ? 1 : 0;
+ case Cbinop_Gt: return (Word) wL > (Word) wR ? 1 : 0;
+ case Cbinop_Le: return (Word) wL <= (Word) wR ? 1 : 0;
+ case Cbinop_Lt: return (Word) wL < (Word) wR ? 1 : 0;
+ case Cbinop_Ne: return wL != wR ? 1 : 0;
default: goto unhandled;
}
/*NOTREACHED*/
Index: valgrind/coregrind/m_debuginfo/storage.c
===================================================================
--- valgrind/coregrind/m_debuginfo/storage.c (revision 13007)
+++ valgrind/coregrind/m_debuginfo/storage.c (working copy)
@@ -585,10 +585,19 @@
e.Cex.Const.con = con;
return (Int)VG_(addToXA)( dst, &e );
}
-Int ML_(CfiExpr_Binop)( XArray* dst, CfiOp op, Int ixL, Int ixR )
+Int ML_(CfiExpr_Unop)( XArray* dst, CfiUnop op, Int ix )
{
CfiExpr e;
VG_(memset)( &e, 0, sizeof(e) );
+ e.tag = Cex_Unop;
+ e.Cex.Unop.op = op;
+ e.Cex.Unop.ix = ix;
+ return (Int)VG_(addToXA)( dst, &e );
+}
+Int ML_(CfiExpr_Binop)( XArray* dst, CfiBinop op, Int ixL, Int ixR )
+{
+ CfiExpr e;
+ VG_(memset)( &e, 0, sizeof(e) );
e.tag = Cex_Binop;
e.Cex.Binop.op = op;
e.Cex.Binop.ixL = ixL;
@@ -612,25 +621,35 @@
return (Int)VG_(addToXA)( dst, &e );
}
-static void ppCfiOp ( CfiOp op )
+static void ppCfiUnop ( CfiUnop op )
{
switch (op) {
- case Cop_Add: VG_(printf)("+"); break;
- case Cop_Sub: VG_(printf)("-"); break;
- case Cop_And: VG_(printf)("&"); break;
- case Cop_Mul: VG_(printf)("*"); break;
- case Cop_Shl: VG_(printf)("<<"); break;
- case Cop_Shr: VG_(printf)(">>"); break;
- case Cop_Eq: VG_(printf)("=="); break;
- case Cop_Ge: VG_(printf)(">="); break;
- case Cop_Gt: VG_(printf)(">"); break;
- case Cop_Le: VG_(printf)("<="); break;
- case Cop_Lt: VG_(printf)("<"); break;
- case Cop_Ne: VG_(printf)("!="); break;
- default: vg_assert(0);
+ case Cunop_Abs: VG_(printf)("abs"); break;
+ case Cunop_Neg: VG_(printf)("-"); break;
+ case Cunop_Not: VG_(printf)("~"); break;
+ default: vg_assert(0);
}
}
+static void ppCfiBinop ( CfiBinop op )
+{
+ switch (op) {
+ case Cbinop_Add: VG_(printf)("+"); break;
+ case Cbinop_Sub: VG_(printf)("-"); break;
+ case Cbinop_And: VG_(printf)("&"); break;
+ case Cbinop_Mul: VG_(printf)("*"); break;
+ case Cbinop_Shl: VG_(printf)("<<"); break;
+ case Cbinop_Shr: VG_(printf)(">>"); break;
+ case Cbinop_Eq: VG_(printf)("=="); break;
+ case Cbinop_Ge: VG_(printf)(">="); break;
+ case Cbinop_Gt: VG_(printf)(">"); break;
+ case Cbinop_Le: VG_(printf)("<="); break;
+ case Cbinop_Lt: VG_(printf)("<"); break;
+ case Cbinop_Ne: VG_(printf)("!="); break;
+ default: vg_assert(0);
+ }
+}
+
static void ppCfiReg ( CfiReg reg )
{
switch (reg) {
@@ -664,11 +683,17 @@
case Cex_Const:
VG_(printf)("0x%lx", e->Cex.Const.con);
break;
+ case Cex_Unop:
+ ppCfiUnop(e->Cex.Unop.op);
+ VG_(printf)("(");
+ ML_(ppCfiExpr)(src, e->Cex.Unop.ix);
+ VG_(printf)(")");
+ break;
case Cex_Binop:
VG_(printf)("(");
ML_(ppCfiExpr)(src, e->Cex.Binop.ixL);
VG_(printf)(")");
- ppCfiOp(e->Cex.Binop.op);
+ ppCfiBinop(e->Cex.Binop.op);
VG_(printf)("(");
ML_(ppCfiExpr)(src, e->Cex.Binop.ixR);
VG_(printf)(")");
Index: valgrind/coregrind/m_debuginfo/priv_storage.h
===================================================================
--- valgrind/coregrind/m_debuginfo/priv_storage.h (revision 13007)
+++ valgrind/coregrind/m_debuginfo/priv_storage.h (working copy)
@@ -279,23 +279,31 @@
typedef
enum {
- Cop_Add=0x321,
- Cop_Sub,
- Cop_And,
- Cop_Mul,
- Cop_Shl,
- Cop_Shr,
- Cop_Eq,
- Cop_Ge,
- Cop_Gt,
- Cop_Le,
- Cop_Lt,
- Cop_Ne
+ Cunop_Abs=0x231,
+ Cunop_Neg,
+ Cunop_Not
}
- CfiOp;
+ CfiUnop;
typedef
enum {
+ Cbinop_Add=0x321,
+ Cbinop_Sub,
+ Cbinop_And,
+ Cbinop_Mul,
+ Cbinop_Shl,
+ Cbinop_Shr,
+ Cbinop_Eq,
+ Cbinop_Ge,
+ Cbinop_Gt,
+ Cbinop_Le,
+ Cbinop_Lt,
+ Cbinop_Ne
+ }
+ CfiBinop;
+
+typedef
+ enum {
Creg_IA_SP=0x213,
Creg_IA_BP,
Creg_IA_IP,
@@ -313,6 +321,7 @@
Cex_Undef=0x123,
Cex_Deref,
Cex_Const,
+ Cex_Unop,
Cex_Binop,
Cex_CfiReg,
Cex_DwReg
@@ -332,7 +341,11 @@
UWord con;
} Const;
struct {
- CfiOp op;
+ CfiUnop op;
+ Int ix;
+ } Unop;
+ struct {
+ CfiBinop op;
Int ixL;
Int ixR;
} Binop;
@@ -350,7 +363,8 @@
extern Int ML_(CfiExpr_Undef) ( XArray* dst );
extern Int ML_(CfiExpr_Deref) ( XArray* dst, Int ixAddr );
extern Int ML_(CfiExpr_Const) ( XArray* dst, UWord con );
-extern Int ML_(CfiExpr_Binop) ( XArray* dst, CfiOp op, Int ixL, Int ixR );
+extern Int ML_(CfiExpr_Unop) ( XArray* dst, CfiUnop op, Int ix );
+extern Int ML_(CfiExpr_Binop) ( XArray* dst, CfiBinop op, Int ixL, Int ixR );
extern Int ML_(CfiExpr_CfiReg)( XArray* dst, CfiReg reg );
extern Int ML_(CfiExpr_DwReg) ( XArray* dst, Int reg );

View File

@ -1,71 +0,0 @@
commit 9d82d0f293c83ff2b8c3ab07065d8454059452be
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Fri Jun 28 14:03:58 2013 +0000
Bug 289360 parse_type_DIE confused by DW_TAG_enumeration_type.
GCC allows incomplete enums as GNU extension.
http://gcc.gnu.org/onlinedocs/gcc/Incomplete-Enums.html
These are marked as DW_AT_declaration and won't have a size.
They can only be used in declaration or as pointer types.
You can't allocate variables or storage using such an enum type.
So don't require a size for such enum types.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13433 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
index 8dbed5a..5e20ff0 100644
--- a/coregrind/m_debuginfo/readdwarf3.c
+++ b/coregrind/m_debuginfo/readdwarf3.c
@@ -2501,6 +2501,7 @@ static void parse_type_DIE ( /*MOD*/XArray* /* of TyEnt */ tyents,
VG_(memset)(&typeE, 0, sizeof(typeE));
typeE.cuOff = posn;
typeE.tag = Te_TyEnum;
+ Bool is_decl = False;
typeE.Te.TyEnum.atomRs
= VG_(newXA)( ML_(dinfo_zalloc), "di.readdwarf3.ptD.enum_type.1",
ML_(dinfo_free),
@@ -2519,6 +2520,9 @@ static void parse_type_DIE ( /*MOD*/XArray* /* of TyEnt */ tyents,
if (attr == DW_AT_byte_size && ctsSzB > 0) {
typeE.Te.TyEnum.szB = cts;
}
+ if (attr == DW_AT_declaration) {
+ is_decl = True;
+ }
}
if (!typeE.Te.TyEnum.name)
@@ -2530,22 +2534,17 @@ static void parse_type_DIE ( /*MOD*/XArray* /* of TyEnt */ tyents,
if (typeE.Te.TyEnum.szB == 0
/* we must know the size */
/* but not for Ada, which uses such dummy
- enumerations as helper for gdb ada mode. */
- && parser->language != 'A') {
- /* GCC has been seen to put an odd DIE like this into
- .debug_types:
-
- <1><cb72>: DW_TAG_enumeration_type (in .debug_types)
- DW_AT_name : (indirect string, offset: 0x3374a): exec_direction_kind
- DW_AT_declaration : 1
-
- It isn't clear what this means, but we accept it and
- assume that the enum is int-sized. */
- if (cc->is_type_unit) {
- typeE.Te.TyEnum.szB = sizeof(int);
- } else {
- goto bad_DIE;
- }
+ enumerations as helper for gdb ada mode.
+ Also GCC allows incomplete enums as GNU extension.
+ http://gcc.gnu.org/onlinedocs/gcc/Incomplete-Enums.html
+ These are marked as DW_AT_declaration and won't have
+ a size. They can only be used in declaration or as
+ pointer types. You can't allocate variables or storage
+ using such an enum type. (Also GCC seems to have a bug
+ that will put such an enumeration_type into a .debug_types
+ unit which should only contain complete types.) */
+ && (parser->language != 'A' && !is_decl)) {
+ goto bad_DIE;
}
/* On't stack! */

View File

@ -1,22 +0,0 @@
--- valgrind/configure.in 2012-03-05 15:16:23.000000000 -0500
+++ valgrind/configure.in 2012-03-05 13:49:04.000000000 -0500
@@ -186,7 +186,7 @@ case "${host_cpu}" in
ARCH_MAX="s390x"
;;
- armv7*)
+ armv[[57]]*)
AC_MSG_RESULT([ok (${host_cpu})])
ARCH_MAX="arm"
;;
--- valgrind/configure 2012-03-05 15:16:23.000000000 -0500
+++ valgrind/configure 2012-03-05 13:49:04.000000000 -0500
@@ -5335,7 +5335,7 @@
ARCH_MAX="s390x"
;;
- armv7*)
+ armv[57]*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (${host_cpu})" >&5
$as_echo "ok (${host_cpu})" >&6; }
ARCH_MAX="arm"

View File

@ -1,11 +0,0 @@
--- valgrind/gdbserver_tests/filter_gdb (revision 13036)
+++ valgrind/gdbserver_tests/filter_gdb (working copy)
@@ -12,6 +12,8 @@
# memcheck stuff
$dir/filter_memcheck_monitor "$@" |
+# memcheck filter might leave some "..." lines, we are not interested
+sed -e '/^\ \ \ \ \.\.\.$/d' |
# Anonymise or remove :
# delete the initial lines between the launch of vgdb and the

View File

@ -1,42 +0,0 @@
--- valgrind/coregrind/m_debuginfo/readelf.c (revision 12871)
+++ valgrind/coregrind/m_debuginfo/readelf.c (working copy)
@@ -888,7 +888,7 @@
* http://fedoraproject.org/wiki/RolandMcGrath/BuildID
*/
static
-Char *find_buildid(Addr image, UWord n_image, Bool rel_ok)
+Char *find_buildid(Addr image, UWord n_image, Bool rel_ok, Bool search_shdrs)
{
Char* buildid = NULL;
__attribute__((unused)) /* on Android, at least */
@@ -930,7 +930,11 @@
}
}
- if (buildid || !rel_ok)
+ /* Normally we would only search shdrs for ET_REL files, but when
+ we search for a separate .debug file phdrs might not be there
+ (they are never loaded) or have been corrupted, so try again
+ against shdrs. */
+ if (buildid || (!rel_ok && !search_shdrs))
return buildid;
for (i = 0; i < ehdr->e_shnum; i++) {
@@ -1074,7 +1078,7 @@
return 0;
if (buildid) {
- Char* debug_buildid = find_buildid(sr_Res(sres), *size, rel_ok);
+ Char* debug_buildid = find_buildid(sr_Res(sres), *size, rel_ok, True);
if (debug_buildid == NULL || VG_(strcmp)(buildid, debug_buildid) != 0) {
SysRes res = VG_(am_munmap_valgrind)(sr_Res(sres), *size);
vg_assert(!sr_isError(res));
@@ -2274,7 +2278,7 @@
vg_assert(dimage == 0 && n_dimage == 0);
/* Look for a build-id */
- buildid = find_buildid(oimage, n_oimage, False);
+ buildid = find_buildid(oimage, n_oimage, False, False);
/* Look for a debug image */
if (buildid != NULL || debuglink_img != NULL) {

View File

@ -1,630 +0,0 @@
Index: valgrind/coregrind/m_gdbserver/m_gdbserver.c
===================================================================
--- valgrind/coregrind/m_gdbserver/m_gdbserver.c (revision 13036)
+++ valgrind/coregrind/m_gdbserver/m_gdbserver.c (working copy)
@@ -33,6 +33,8 @@
#include "pub_core_libcproc.h"
#include "pub_core_libcprint.h"
#include "pub_core_mallocfree.h"
+#include "pub_tool_libcsetjmp.h"
+#include "pub_core_threadstate.h"
#include "pub_core_gdbserver.h"
#include "pub_core_options.h"
#include "pub_core_libcsetjmp.h"
@@ -68,7 +70,8 @@
core_reason, // gdbserver invocation by core (e.g. error encountered)
break_reason, // break encountered
watch_reason, // watchpoint detected by tool
- signal_reason} // signal encountered
+ signal_reason, // signal encountered
+ exit_reason} // process terminated
CallReason;
static char* ppCallReason(CallReason reason)
@@ -80,6 +83,7 @@
case break_reason: return "break_reason";
case watch_reason: return "watch_reason";
case signal_reason: return "signal_reason";
+ case exit_reason: return "exit_reason";
default: vg_assert (0);
}
}
@@ -641,6 +645,14 @@
VG_(getpid) (), tid, VG_(name_of_ThreadStatus)(tst->status),
tst->sched_jmpbuf_valid);
+ /* If we are about to die, then just run server_main() once to get
+ the message out and return immediately because most of the state
+ of this tid and process is about to be torn down. */
+ if (reason == exit_reason) {
+ server_main();
+ return;
+ }
+
vg_assert(VG_(is_valid_tid)(tid));
saved_pc = VG_(get_IP) (tid);
@@ -933,6 +945,29 @@
}
}
+void VG_(gdbserver_exit) (ThreadId tid, VgSchedReturnCode tids_schedretcode)
+{
+ dlog(1, "VG core calling VG_(gdbserver_exit) tid %d will exit\n", tid);
+ if (remote_connected()) {
+ /* Make sure vgdb knows we are about to die and why. */
+ if (tids_schedretcode == VgSrc_ExitThread
+ || tids_schedretcode == VgSrc_ExitProcess) {
+ gdbserver_process_exit ('W', VG_(threads)[tid].os_state.exitcode);
+ call_gdbserver (tid, exit_reason);
+ }
+
+ if (tids_schedretcode == VgSrc_FatalSig) {
+ gdbserver_process_exit ('X', VG_(threads)[tid].os_state.fatalsig);
+ call_gdbserver (tid, exit_reason);
+ }
+ } else {
+ dlog(1, "not connected\n");
+ }
+
+ /* Tear down the connection if it still exists. */
+ VG_(gdbserver) (0);
+}
+
// Check if single_stepping or if there is a break requested at iaddr.
// If yes, call debugger
VG_REGPARM(1)
Index: valgrind/coregrind/m_gdbserver/server.c
===================================================================
--- valgrind/coregrind/m_gdbserver/server.c (revision 13036)
+++ valgrind/coregrind/m_gdbserver/server.c (working copy)
@@ -765,6 +765,13 @@
putpkt (own_buf);
}
+ /* If we our status is terminal (exit or fatal signal) get out
+ as quickly as we can. We won't be able to handle any request
+ anymore. */
+ if (status == 'W' || status == 'X') {
+ return;
+ }
+
packet_len = getpkt (own_buf);
if (packet_len <= 0)
break;
Index: valgrind/coregrind/m_gdbserver/server.h
===================================================================
--- valgrind/coregrind/m_gdbserver/server.h (revision 13036)
+++ valgrind/coregrind/m_gdbserver/server.h (working copy)
@@ -40,9 +40,9 @@
#include "pub_tool_libcassert.h"
#include "pub_tool_libcbase.h"
#include "pub_tool_options.h"
-#include "pub_core_gdbserver.h"
#include "pub_tool_libcsetjmp.h"
#include "pub_core_threadstate.h"
+#include "pub_core_gdbserver.h"
#include "pub_core_aspacemgr.h"
#include "pub_tool_vki.h"
#include "valgrind.h"
@@ -208,6 +208,9 @@
to ignore the signal, so signal can be delivered to the guest. */
extern Bool gdbserver_deliver_signal (Int vki_sigNo);
+/* Called when a process is about to go with reason ('W' or 'X') and code. */
+extern void gdbserver_process_exit (unsigned char status, Int code);
+
/* To optimise signal handling, gdb can instruct gdbserver to
not stop on some signals. In the below, a 1 indicates the gdb_nr signal
has to be passed directly to the guest, without asking gdb.
Index: valgrind/coregrind/m_gdbserver/target.c
===================================================================
--- valgrind/coregrind/m_gdbserver/target.c (revision 13036)
+++ valgrind/coregrind/m_gdbserver/target.c (working copy)
@@ -165,6 +165,14 @@
return vki_sigNo == vki_signal_to_deliver;
}
+static unsigned char exit_status_to_report;
+static int exit_code_to_report;
+void gdbserver_process_exit (unsigned char status, Int code)
+{
+ exit_status_to_report = status;
+ exit_code_to_report = code;
+}
+
static
char* sym (Addr addr)
{
@@ -248,6 +256,7 @@
unsigned long wptid;
ThreadState *tst;
enum target_signal sig;
+ int code;
pid = VG_(getpid) ();
dlog(1, "enter valgrind_wait pid %d\n", pid);
@@ -255,6 +264,24 @@
regcache_invalidate();
valgrind_update_threads(pid);
+ /* First see if we are done with this process. */
+ if (exit_status_to_report != 0) {
+ *ourstatus = exit_status_to_report;
+ exit_status_to_report = 0;
+
+ if (*ourstatus == 'W') {
+ code = exit_code_to_report;
+ exit_code_to_report = 0;
+ return code;
+ }
+
+ if (*ourstatus == 'X') {
+ sig = target_signal_from_host(exit_code_to_report);
+ exit_code_to_report = 0;
+ return sig;
+ }
+ }
+
/* in valgrind, we consider that a wait always succeeds with STOPPED 'T'
and with a signal TRAP (i.e. a breakpoint), unless there is
a signal to report. */
Index: valgrind/coregrind/m_libcprint.c
===================================================================
--- valgrind/coregrind/m_libcprint.c (revision 13036)
+++ valgrind/coregrind/m_libcprint.c (working copy)
@@ -31,7 +31,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_debuglog.h"
-#include "pub_core_gdbserver.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcfile.h" // VG_(write)(), VG_(write_socket)()
Index: valgrind/coregrind/m_main.c
===================================================================
--- valgrind/coregrind/m_main.c (revision 13036)
+++ valgrind/coregrind/m_main.c (working copy)
@@ -2543,7 +2543,7 @@
/* terminate gdbserver if ever it was started. We terminate it here so that it get
the output above if output was redirected to gdb */
- VG_(gdbserver) (0);
+ VG_(gdbserver_exit) (tid, tids_schedretcode);
/* Ok, finally exit in the os-specific way, according to the scheduler's
return code. In short, if the (last) thread exited by calling
Index: valgrind/coregrind/pub_core_gdbserver.h
===================================================================
--- valgrind/coregrind/pub_core_gdbserver.h (revision 13036)
+++ valgrind/coregrind/pub_core_gdbserver.h (working copy)
@@ -48,7 +48,10 @@
// to handle this incoming vgdb request.
extern Bool VG_(gdbserver_activity) (ThreadId tid);
+// Called by low level when the process is about to exit and why.
+void VG_(gdbserver_exit) (ThreadId, VgSchedReturnCode);
+
/* Called by low level to insert or remove a break or watch point.
Break or watch point implementation is done using help from the tool.
break point support implies some (small) specific instrumentation
Index: valgrind/gdbserver_tests/Makefile.am
===================================================================
--- valgrind/gdbserver_tests/Makefile.am (revision 13036)
+++ valgrind/gdbserver_tests/Makefile.am (working copy)
@@ -100,7 +100,22 @@
nlsigvgdb.vgtest \
nlsigvgdb.stderr.exp \
nlsigvgdb.stderrB.exp \
- nlsigvgdb.stdinB.gdb
+ nlsigvgdb.stdinB.gdb \
+ gone_abrt.stderr.exp \
+ gone_abrt.stderrB.exp \
+ gone_abrt.stdinB.gdb \
+ gone_abrt.stdoutB.exp \
+ gone_abrt.vgtest \
+ gone_exit.stderr.exp \
+ gone_exit.stderrB.exp \
+ gone_exit.stdinB.gdb \
+ gone_exit.stdoutB.exp \
+ gone_exit.vgtest \
+ gone_return.stderr.exp \
+ gone_return.stderrB.exp \
+ gone_return.stdinB.gdb \
+ gone_return.stdoutB.exp \
+ gone_return.vgtest
check_PROGRAMS = \
clean_after_fork \
@@ -109,7 +124,8 @@
sleepers \
main_pic \
t \
- watchpoints
+ watchpoints \
+ gone
AM_CFLAGS += $(AM_FLAG_M3264_PRI)
AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
Index: valgrind/gdbserver_tests/filter_gdb
===================================================================
--- valgrind/gdbserver_tests/filter_gdb (revision 13036)
+++ valgrind/gdbserver_tests/filter_gdb (working copy)
@@ -49,6 +51,8 @@
# a.o. produced by gdb 7.2 on arm (same with standard gdbserver)
# delete empty lines (the last line (only made of prompts) sometimes
# finishes with a new line, sometimes not ???).
+# 'exited with code' and 'exited normally' are printed slightly
+# differently between gdb versions, normalize to "Program exited...".
sed -e '/Remote debugging using/,/vgdb launched process attached/d' \
-e 's/^\[?1034hReading symbols/Reading symbols/' \
-e '/^Missing separate debuginfo/d' \
@@ -64,6 +68,8 @@
-e '/^Loaded symbols for .*$/d' \
-e '/^Current language.*/d' \
-e '/^The current source language is.*/d' \
+ -e 's/^.*\( exited with code [0-9]\+\).$/Program\1\./g' \
+ -e 's/^.*\( exited normally\).$/Program\1\./g' \
-e 's/(gdb) //g' \
-e 's/^>[> ]*//' \
-e '/^done\.$/d' \
Index: valgrind/gdbserver_tests/gone.c
===================================================================
--- valgrind/gdbserver_tests/gone.c (revision 0)
+++ valgrind/gdbserver_tests/gone.c (working copy)
@@ -0,0 +1,33 @@
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+int
+main (int argc, char **argv)
+{
+ fprintf(stderr, "starting ...\n");
+
+ // Three ways of going away...
+ if (argc > 1)
+ {
+ // Explicit exit() with exit code.
+ if (strcmp (argv[1], "exit") == 0)
+ {
+ fprintf(stderr, "exiting ...\n");
+ exit (1);
+ }
+
+ // Get killed by a signal.
+ if (strcmp (argv[1], "abort") == 0)
+ {
+ fprintf(stderr, "aborting ...\n");
+ kill(getpid(), SIGABRT);
+ }
+ }
+
+ // And finally, just return from main with success.
+ fprintf(stderr, "returning ...\n");
+ return 0;
+}
Index: valgrind/gdbserver_tests/gone_abrt.stderr.exp
===================================================================
--- valgrind/gdbserver_tests/gone_abrt.stderr.exp (revision 0)
+++ valgrind/gdbserver_tests/gone_abrt.stderr.exp (working copy)
@@ -0,0 +1,8 @@
+Nulgrind, the minimal Valgrind tool
+
+(action at startup) vgdb me ...
+
+
+starting ...
+aborting ...
+
Index: valgrind/gdbserver_tests/gone_abrt.stderrB.exp
===================================================================
--- valgrind/gdbserver_tests/gone_abrt.stderrB.exp (revision 0)
+++ valgrind/gdbserver_tests/gone_abrt.stderrB.exp (working copy)
@@ -0,0 +1 @@
+relaying data between gdb and process ....
Index: valgrind/gdbserver_tests/gone_abrt.stdinB.gdb
===================================================================
--- valgrind/gdbserver_tests/gone_abrt.stdinB.gdb (revision 0)
+++ valgrind/gdbserver_tests/gone_abrt.stdinB.gdb (working copy)
@@ -0,0 +1,9 @@
+# connect gdb to Valgrind gdbserver:
+target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-gone-abrt
+echo vgdb launched process attached\n
+
+continue
+# see process get a fatal signal
+continue
+# see program is gone
+quit
Index: valgrind/gdbserver_tests/gone_abrt.stdoutB.exp
===================================================================
--- valgrind/gdbserver_tests/gone_abrt.stdoutB.exp (revision 0)
+++ valgrind/gdbserver_tests/gone_abrt.stdoutB.exp (working copy)
@@ -0,0 +1,7 @@
+vgdb launched process attached
+Continuing.
+Program received signal SIGABRT, Aborted.
+0x........ in syscall ...
+Continuing.
+Program terminated with signal SIGABRT, Aborted.
+The program no longer exists.
Index: valgrind/gdbserver_tests/gone_abrt.vgtest
===================================================================
--- valgrind/gdbserver_tests/gone_abrt.vgtest (revision 0)
+++ valgrind/gdbserver_tests/gone_abrt.vgtest (working copy)
@@ -0,0 +1,12 @@
+# test that a fatal SIGABRT signal is properly passed on to gdb.
+
+prog: gone
+args: abort
+vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-gone-abrt
+stderr_filter: filter_stderr
+prereq: test -e gdb
+progB: gdb
+argsB: --quiet -l 60 --nx ./gone
+stdinB: gone_abrt.stdinB.gdb
+stdoutB_filter: filter_gdb
+stderrB_filter: filter_gdb
Index: valgrind/gdbserver_tests/gone_exit.stderr.exp
===================================================================
--- valgrind/gdbserver_tests/gone_exit.stderr.exp (revision 0)
+++ valgrind/gdbserver_tests/gone_exit.stderr.exp (working copy)
@@ -0,0 +1,8 @@
+Nulgrind, the minimal Valgrind tool
+
+(action at startup) vgdb me ...
+
+
+starting ...
+exiting ...
+
Index: valgrind/gdbserver_tests/gone_exit.stderrB.exp
===================================================================
--- valgrind/gdbserver_tests/gone_exit.stderrB.exp (revision 0)
+++ valgrind/gdbserver_tests/gone_exit.stderrB.exp (working copy)
@@ -0,0 +1 @@
+relaying data between gdb and process ....
Index: valgrind/gdbserver_tests/gone_exit.stdinB.gdb
===================================================================
--- valgrind/gdbserver_tests/gone_exit.stdinB.gdb (revision 0)
+++ valgrind/gdbserver_tests/gone_exit.stdinB.gdb (working copy)
@@ -0,0 +1,7 @@
+# connect gdb to Valgrind gdbserver:
+target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-gone-exit
+echo vgdb launched process attached\n
+
+continue
+# see program is gone with exit code
+quit
Index: valgrind/gdbserver_tests/gone_exit.stdoutB.exp
===================================================================
--- valgrind/gdbserver_tests/gone_exit.stdoutB.exp (revision 0)
+++ valgrind/gdbserver_tests/gone_exit.stdoutB.exp (working copy)
@@ -0,0 +1,3 @@
+vgdb launched process attached
+Continuing.
+Program exited with code 01.
Index: valgrind/gdbserver_tests/gone_exit.vgtest
===================================================================
--- valgrind/gdbserver_tests/gone_exit.vgtest (revision 0)
+++ valgrind/gdbserver_tests/gone_exit.vgtest (working copy)
@@ -0,0 +1,12 @@
+# test that an exit (with return value) is properly passed on to gdb.
+
+prog: gone
+args: exit
+vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-gone-exit
+stderr_filter: filter_stderr
+prereq: test -e gdb
+progB: gdb
+argsB: --quiet -l 60 --nx ./gone
+stdinB: gone_exit.stdinB.gdb
+stdoutB_filter: filter_gdb
+stderrB_filter: filter_gdb
Index: valgrind/gdbserver_tests/gone_return.stderr.exp
===================================================================
--- valgrind/gdbserver_tests/gone_return.stderr.exp (revision 0)
+++ valgrind/gdbserver_tests/gone_return.stderr.exp (working copy)
@@ -0,0 +1,8 @@
+Nulgrind, the minimal Valgrind tool
+
+(action at startup) vgdb me ...
+
+
+starting ...
+returning ...
+
Index: valgrind/gdbserver_tests/gone_return.stderrB.exp
===================================================================
--- valgrind/gdbserver_tests/gone_return.stderrB.exp (revision 0)
+++ valgrind/gdbserver_tests/gone_return.stderrB.exp (working copy)
@@ -0,0 +1 @@
+relaying data between gdb and process ....
Index: valgrind/gdbserver_tests/gone_return.stdinB.gdb
===================================================================
--- valgrind/gdbserver_tests/gone_return.stdinB.gdb (revision 0)
+++ valgrind/gdbserver_tests/gone_return.stdinB.gdb (working copy)
@@ -0,0 +1,7 @@
+# connect gdb to Valgrind gdbserver:
+target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-gone-return
+echo vgdb launched process attached\n
+
+continue
+# see program is gone
+quit
Index: valgrind/gdbserver_tests/gone_return.stdoutB.exp
===================================================================
--- valgrind/gdbserver_tests/gone_return.stdoutB.exp (revision 0)
+++ valgrind/gdbserver_tests/gone_return.stdoutB.exp (working copy)
@@ -0,0 +1,3 @@
+vgdb launched process attached
+Continuing.
+Program exited normally.
Index: valgrind/gdbserver_tests/gone_return.vgtest
===================================================================
--- valgrind/gdbserver_tests/gone_return.vgtest (revision 0)
+++ valgrind/gdbserver_tests/gone_return.vgtest (working copy)
@@ -0,0 +1,12 @@
+# test that a normal (successful) return is properly passed on to gdb.
+
+prog: gone
+args: return
+vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-gone-return
+stderr_filter: filter_stderr
+prereq: test -e gdb
+progB: gdb
+argsB: --quiet -l 60 --nx ./gone
+stdinB: gone_return.stdinB.gdb
+stdoutB_filter: filter_gdb
+stderrB_filter: filter_gdb
Index: valgrind/gdbserver_tests/mcleak.stderrB.exp
===================================================================
--- valgrind/gdbserver_tests/mcleak.stderrB.exp (revision 13036)
+++ valgrind/gdbserver_tests/mcleak.stderrB.exp (working copy)
@@ -95,4 +95,3 @@
by 0x........: f (leak-delta.c:28)
by 0x........: main (leak-delta.c:60)
-Remote connection closed
Index: valgrind/gdbserver_tests/mcleak.stdoutB.exp
===================================================================
--- valgrind/gdbserver_tests/mcleak.stdoutB.exp (revision 13036)
+++ valgrind/gdbserver_tests/mcleak.stdoutB.exp (working copy)
@@ -45,3 +45,4 @@
#1 0x........ in f () at leak-delta.c:48
48 fprintf(stderr, "expecting details 32 (+32) bytes lost, 33 (-32) bytes reachable\n"); fflush(stderr); breakme();
Continuing.
+Program exited normally.
Index: valgrind/gdbserver_tests/mcmain_pic.stderrB.exp
===================================================================
--- valgrind/gdbserver_tests/mcmain_pic.stderrB.exp (revision 13036)
+++ valgrind/gdbserver_tests/mcmain_pic.stderrB.exp (working copy)
@@ -1,3 +1,2 @@
relaying data between gdb and process ....
vgdb-error value changed from 0 to 999999
-Remote connection closed
Index: valgrind/gdbserver_tests/mcmain_pic.stdoutB.exp
===================================================================
--- valgrind/gdbserver_tests/mcmain_pic.stdoutB.exp (revision 13036)
+++ valgrind/gdbserver_tests/mcmain_pic.stdoutB.exp (working copy)
@@ -6,3 +6,4 @@
$2 = (int (*)(int, char **)) 0x........ <main>
$3 = (void (*)(char *)) 0x........ <another_func>
Continuing.
+Program exited normally.
Index: valgrind/gdbserver_tests/mcwatchpoints.stdoutB.exp
===================================================================
--- valgrind/gdbserver_tests/mcwatchpoints.stdoutB.exp (revision 13036)
+++ valgrind/gdbserver_tests/mcwatchpoints.stdoutB.exp (working copy)
@@ -32,3 +32,4 @@
49 fprintf(stderr, "after writing 8\n");
Delete all breakpoints? (y or n) [answered Y; input not from terminal]
Continuing.
+Program exited normally.
Index: valgrind/gdbserver_tests/nlcontrolc.stdoutB.exp
===================================================================
--- valgrind/gdbserver_tests/nlcontrolc.stdoutB.exp (revision 13036)
+++ valgrind/gdbserver_tests/nlcontrolc.stdoutB.exp (working copy)
@@ -21,3 +21,4 @@
$6 = 0
$7 = 0
Continuing.
+Program exited normally.
Index: valgrind/gdbserver_tests/nlpasssigalrm.stderrB.exp
===================================================================
--- valgrind/gdbserver_tests/nlpasssigalrm.stderrB.exp (revision 13036)
+++ valgrind/gdbserver_tests/nlpasssigalrm.stderrB.exp (working copy)
@@ -1,3 +1,2 @@
relaying data between gdb and process ....
vgdb-error value changed from 0 to 999999
-Remote connection closed
Index: valgrind/gdbserver_tests/nlpasssigalrm.stdoutB.exp
===================================================================
--- valgrind/gdbserver_tests/nlpasssigalrm.stdoutB.exp (revision 13036)
+++ valgrind/gdbserver_tests/nlpasssigalrm.stdoutB.exp (working copy)
@@ -19,3 +19,4 @@
Program received signal SIG34, Real-time event 34.
0x........ in syscall ...
Continuing.
+Program exited normally.
--- valgrind-3.8.1/gdbserver_tests/Makefile.in.orig 2012-10-13 16:35:43.846865557 +0200
+++ valgrind-3.8.1/gdbserver_tests/Makefile.in 2012-10-13 16:36:37.445641004 +0200
@@ -56,7 +56,7 @@
check_PROGRAMS = clean_after_fork$(EXEEXT) fork_chain$(EXEEXT) \
passsigalrm$(EXEEXT) sleepers$(EXEEXT) main_pic$(EXEEXT) \
- t$(EXEEXT) watchpoints$(EXEEXT)
+ t$(EXEEXT) watchpoints$(EXEEXT) gone$(EXEEXT)
subdir = gdbserver_tests
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
@@ -74,6 +74,10 @@
fork_chain_OBJECTS = fork_chain.$(OBJEXT)
fork_chain_LDADD = $(LDADD)
fork_chain_DEPENDENCIES =
+gone_SOURCES = gone.c
+gone_OBJECTS = gone.$(OBJEXT)
+gone_LDADD = $(LDADD)
+gone_DEPENDENCIES =
main_pic_SOURCES = main_pic.c
main_pic_OBJECTS = main_pic-main_pic.$(OBJEXT)
main_pic_LDADD = $(LDADD)
@@ -105,9 +109,9 @@
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = clean_after_fork.c fork_chain.c main_pic.c passsigalrm.c \
- sleepers.c t.c watchpoints.c
-DIST_SOURCES = clean_after_fork.c fork_chain.c main_pic.c \
+SOURCES = clean_after_fork.c fork_chain.c gone.c main_pic.c \
+ passsigalrm.c sleepers.c t.c watchpoints.c
+DIST_SOURCES = clean_after_fork.c fork_chain.c gone.c main_pic.c \
passsigalrm.c sleepers.c t.c watchpoints.c
ETAGS = etags
CTAGS = ctags
@@ -487,7 +491,22 @@
nlsigvgdb.vgtest \
nlsigvgdb.stderr.exp \
nlsigvgdb.stderrB.exp \
- nlsigvgdb.stdinB.gdb
+ nlsigvgdb.stdinB.gdb \
+ gone_abrt.stderr.exp \
+ gone_abrt.stderrB.exp \
+ gone_abrt.stdinB.gdb \
+ gone_abrt.stdoutB.exp \
+ gone_abrt.vgtest \
+ gone_exit.stderr.exp \
+ gone_exit.stderrB.exp \
+ gone_exit.stdinB.gdb \
+ gone_exit.stdoutB.exp \
+ gone_exit.vgtest \
+ gone_return.stderr.exp \
+ gone_return.stderrB.exp \
+ gone_return.stdinB.gdb \
+ gone_return.stdoutB.exp \
+ gone_return.vgtest
LDADD = -lpthread
main_pic_LDFLAGS = -pie
@@ -535,6 +554,9 @@
fork_chain$(EXEEXT): $(fork_chain_OBJECTS) $(fork_chain_DEPENDENCIES)
@rm -f fork_chain$(EXEEXT)
$(LINK) $(fork_chain_OBJECTS) $(fork_chain_LDADD) $(LIBS)
+gone$(EXEEXT): $(gone_OBJECTS) $(gone_DEPENDENCIES)
+ @rm -f gone$(EXEEXT)
+ $(LINK) $(gone_OBJECTS) $(gone_LDADD) $(LIBS)
main_pic$(EXEEXT): $(main_pic_OBJECTS) $(main_pic_DEPENDENCIES)
@rm -f main_pic$(EXEEXT)
$(main_pic_LINK) $(main_pic_OBJECTS) $(main_pic_LDADD) $(LIBS)
@@ -559,6 +581,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clean_after_fork.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork_chain.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gone.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main_pic-main_pic.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passsigalrm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleepers.Po@am__quote@

View File

@ -1,10 +0,0 @@
--- valgrind/gdbserver_tests/filter_gdb (revision 13010)
+++ valgrind/gdbserver_tests/filter_gdb (working copy)
@@ -85,6 +85,7 @@
-e '/^[ ]*in \.\.\/sysdeps\/unix\/syscall-template\.S/d' \
-e '/^[1-9][0-9]*[ ]*\.\.\/sysdeps\/unix\/syscall-template\.S/d' \
-e '/^[1-9][0-9]*[ ]in *\.\.\/sysdeps\/unix\/syscall-template\.S/d' \
+ -e '/^[1-9][0-9]*[ ]T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)/d' \
-e 's/\(Could not write register \)".*"/\1 "xxx"/' \
-e 's/\(ERROR changing register \).*$/\1 xxx regno y/' \
-e 's/0x........ in \(main (argc=1, argv=0x........) at watchpoints.c:[24][3689]\)/\1/' \

View File

@ -1,151 +0,0 @@
commit 3781ac11ff374b3517011c1710ec517d52f25cd2
Author: tom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Mon Jan 14 09:48:49 2013 +0000
Accept glibc 2.17 as valid.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13228 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.in b/configure.in
index e0fb12d..0f3b3df 100644
--- a/configure.in
+++ b/configure.in
@@ -906,6 +906,13 @@ case "${GLIBC_VERSION}" in
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
;;
+ 2.17)
+ AC_MSG_RESULT(2.17 family)
+ AC_DEFINE([GLIBC_2_17], 1, [Define to 1 if you're using glibc 2.17.x])
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
darwin)
AC_MSG_RESULT(Darwin)
AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
@@ -919,7 +926,7 @@ case "${GLIBC_VERSION}" in
*)
AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.16])
+ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.17])
AC_MSG_ERROR([or Darwin libc])
;;
esac
diff -ur valgrind-3.8.1/config.h.in valgrind-3.8.1/config.h.in
--- valgrind-3.8.1/config.h.in 2013-01-16 17:15:33.531018561 +0100
+++ valgrind-3.8.1/config.h.in 2013-01-16 17:19:21.000000000 +0100
@@ -48,6 +48,9 @@
/* Define to 1 if you're using glibc 2.16.x */
#undef GLIBC_2_16
+/* Define to 1 if you're using glibc 2.17.x */
+#undef GLIBC_2_17
+
/* Define to 1 if you're using glibc 2.2.x */
#undef GLIBC_2_2
diff -ur valgrind-3.8.1/configure valgrind-3.8.1/configure
--- valgrind-3.8.1/configure 2013-01-16 17:15:33.563018480 +0100
+++ valgrind-3.8.1/configure 2013-01-16 17:19:21.373643238 +0100
@@ -6610,6 +6610,16 @@
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
;;
+ 2.17)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.17 family" >&5
+$as_echo "2.17 family" >&6; }
+
+$as_echo "#define GLIBC_2_17 1" >>confdefs.h
+
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
darwin)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin" >&5
$as_echo "Darwin" >&6; }
@@ -6630,7 +6640,7 @@
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported version ${GLIBC_VERSION}" >&5
$as_echo "unsupported version ${GLIBC_VERSION}" >&6; }
- as_fn_error "Valgrind requires glibc version 2.2 - 2.16" "$LINENO" 5
+ as_fn_error "Valgrind requires glibc version 2.2 - 2.17" "$LINENO" 5
as_fn_error "or Darwin libc" "$LINENO" 5
;;
esac
commit 73f797992296ec0f23db6d97d15f48de8da1304c
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Wed Aug 21 14:47:52 2013 +0000
Accept glibc 2.18 as valid.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13504 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.in b/configure.in
index c51f465..58dc221 100644
--- a/configure.in
+++ b/configure.in
@@ -906,6 +906,13 @@ case "${GLIBC_VERSION}" in
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
;;
+ 2.18)
+ AC_MSG_RESULT(2.18 family)
+ AC_DEFINE([GLIBC_2_18], 1, [Define to 1 if you're using glibc 2.18.x])
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
darwin)
AC_MSG_RESULT(Darwin)
AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
Only in valgrind-3.8.1: autom4te.cache
diff -ur valgrind-3.8.1.orig/config.h.in valgrind-3.8.1/config.h.in
--- valgrind-3.8.1.orig/config.h.in 2013-08-21 17:11:19.960147623 +0200
+++ valgrind-3.8.1/config.h.in 2013-08-21 17:12:32.000000000 +0200
@@ -51,6 +51,9 @@
/* Define to 1 if you're using glibc 2.17.x */
#undef GLIBC_2_17
+/* Define to 1 if you're using glibc 2.18.x */
+#undef GLIBC_2_18
+
/* Define to 1 if you're using glibc 2.2.x */
#undef GLIBC_2_2
Only in valgrind-3.8.1: config.h.in~
diff -ur valgrind-3.8.1.orig/configure valgrind-3.8.1/configure
--- valgrind-3.8.1.orig/configure 2013-08-21 17:11:20.000147954 +0200
+++ valgrind-3.8.1/configure 2013-08-21 17:12:37.875793204 +0200
@@ -6623,6 +6623,16 @@
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
;;
+ 2.18)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.18 family" >&5
+$as_echo "2.18 family" >&6; }
+
+$as_echo "#define GLIBC_2_18 1" >>confdefs.h
+
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
darwin)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin" >&5
$as_echo "Darwin" >&6; }
diff -ur valgrind-3.8.1.orig/Makefile.in valgrind-3.8.1/Makefile.in
--- valgrind-3.8.1.orig/Makefile.in 2013-08-21 17:11:19.983147813 +0200
+++ valgrind-3.8.1/Makefile.in 2013-08-21 17:12:37.559790584 +0200
@@ -871,7 +871,7 @@
*.zip*) \
unzip $(distdir).zip ;;\
esac
- chmod -R a-w $(distdir); chmod a+w $(distdir)
+ chmod -R a-w $(distdir); chmod u+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)

View File

@ -1,16 +0,0 @@
--- valgrind-3.8.1.orig/glibc-2.X.supp.in 2013-09-24 23:40:41.371195878 +0200
+++ valgrind-3.8.1/glibc-2.X.supp.in 2013-09-26 21:30:44.232589496 +0200
@@ -133,6 +133,13 @@
fun:expand_dynamic_string_token
}
{
+# https://bugzilla.redhat.com/show_bug.cgi?id=1011713
+ glibc-2.18.90-on-Fedora-21-index-expand
+ Memcheck:Value8
+ fun:index
+ fun:expand_dynamic_string_token
+}
+{
glibc-2.5.5-on-SuSE-10.2-(PPC)-2c
Memcheck:Addr4
fun:index

File diff suppressed because it is too large Load Diff

View File

@ -1,485 +0,0 @@
commit a02e2677ab02bcded6111d74320d4c1f4f062798
Author: philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Wed Mar 6 22:39:18 2013 +0000
Fix 316144 (valgrind.1 manpage contains ??? strings for references)
Patch by Mark Wielaard.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13314 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/docs/xml/manual-core-adv.xml b/docs/xml/manual-core-adv.xml
index 2a022a0..00376a1 100644
--- a/docs/xml/manual-core-adv.xml
+++ b/docs/xml/manual-core-adv.xml
@@ -293,9 +293,9 @@ tool-specific macros).</para>
-
-<sect1 id="manual-core-adv.gdbserver"
- xreflabel="Debugging your program using Valgrind's gdbserver and GDB">
+<!-- Referenced from both the manual and manpage -->
+<sect1 id="&vg-gdbserver-id;"
+ xreflabel="&vg-gdbserver-label;">
<title>Debugging your program using Valgrind gdbserver and GDB</title>
<para>A program running under Valgrind is not executed directly by the
@@ -381,7 +381,7 @@ and gives the results back to GDB.
<para>GDB can use various kinds of channels (TCP/IP, serial line, etc)
to communicate with the gdbserver. In the case of Valgrind's
gdbserver, communication is done via a pipe and a small helper program
-called <xref linkend="manual-core-adv.vgdb"/>, which acts as an
+called <xref linkend="&vg-vgdb-id;"/>, which acts as an
intermediary. If no GDB is in use, vgdb can also be
used to send monitor commands to the Valgrind gdbserver from a shell
command line.
@@ -1105,8 +1105,9 @@ $5 = 36
</sect2>
-<sect2 id="manual-core-adv.vgdb"
- xreflabel="vgdb">
+<!-- Referenced from both the manual and manpage -->
+<sect2 id="&vg-vgdb-id;"
+ xreflabel="&vg-vgdb-label;">
<title>vgdb command line options</title>
<para> Usage: <computeroutput>vgdb [OPTION]... [[-c] COMMAND]...</computeroutput></para>
@@ -1254,8 +1255,9 @@ vgdb v.set log_output -c leak_check any
</sect2>
-<sect2 id="manual-core-adv.valgrind-monitor-commands"
- xreflabel="Valgrind monitor commands">
+<!-- Referenced from both the manual and manpage -->
+<sect2 id="&vg-monitor-id;"
+ xreflabel="&vg-monitor-label;">
<title>Valgrind monitor commands</title>
<para>This section describes the Valgrind monitor commands, available
diff --git a/docs/xml/manual-core.xml b/docs/xml/manual-core.xml
index 70b0989..a60c3a4 100644
--- a/docs/xml/manual-core.xml
+++ b/docs/xml/manual-core.xml
@@ -152,7 +152,8 @@ likely.</para>
</sect1>
-<sect1 id="manual-core.comment" xreflabel="The Commentary">
+<!-- Referenced from both the manual and manpage -->
+<sect1 id="&vg-comment-id;" xreflabel="&vg-comment-label;">
<title>The Commentary</title>
<para>Valgrind tools write a commentary, a stream of text, detailing
@@ -857,7 +858,7 @@ in most cases. We group the available options by rough categories.</para>
be used in conjunction with the
<computeroutput>valgrind-listener</computeroutput> program. For
further details, see
- <link linkend="manual-core.comment">the commentary</link>
+ <link linkend="&vg-comment-id;">the commentary</link>
in the manual.</para>
</listitem>
</varlistentry>
@@ -1755,7 +1756,7 @@ need to use them.</para>
between fairness and performance. For more details about the
Valgrind thread serialisation scheme and its impact on
performance and thread scheduling, see
- <xref linkend="manual-core.pthreads_perf_sched"/>.
+ <xref linkend="&vg-pthreads-perf-sched-id;"/>.
<itemizedlist>
<listitem> <para>The value <option>--fair-sched=yes</option>
@@ -2084,7 +2085,8 @@ everything is shared (a thread) or nothing is shared (fork-like); partial
sharing will fail.
</para>
-<sect2 id="manual-core.pthreads_perf_sched" xreflabel="Scheduling and Multi-Thread Performance">
+<!-- Referenced from both the manual and manpage -->
+<sect2 id="&vg-pthreads-perf-sched-id;" xreflabel="&vg-pthreads-perf-sched-label;">
<title>Scheduling and Multi-Thread Performance</title>
<para>A thread executes code only when it holds the abovementioned
diff --git a/docs/xml/valgrind-manpage.xml b/docs/xml/valgrind-manpage.xml
index 8f2f630..bd4b924 100644
--- a/docs/xml/valgrind-manpage.xml
+++ b/docs/xml/valgrind-manpage.xml
@@ -240,7 +240,22 @@ callgrind_annotate(1),
callgrind_control(1),
ms_print(1),
<filename>&vg-docs-path;</filename> or
-<filename>&vg-docs-url;</filename>.
+<filename>&vg-docs-url;</filename>,
+<ulink id="&vg-gdbserver-id;"
+ xreflabel="&vg-gdbserver-label;"
+ url="&vg-gdbserver-url;">&vg-gdbserver-label;</ulink>
+<ulink id="&vg-vgdb-id;"
+ xreflabel="&vg-vgdb-label;"
+ url="&vg-vgdb-url;">&vg-vgdb-label;</ulink>,
+<ulink id="&vg-monitor-id;"
+ xreflabel="&vg-monitor-label;"
+ url="&vg-monitor-url;">&vg-monitor-label;</ulink>,
+<ulink id="&vg-comment-id;"
+ xreflabel="&vg-comment-label;"
+ url="&vg-comment-url;">&vg-comment-label;</ulink>,
+<ulink id="&vg-pthreads-perf-sched-id;"
+ xreflabel="&vg-pthreads-perf-sched-label;"
+ url="&vg-pthreads-perf-sched-url;">&vg-pthreads-perf-sched-label;</ulink>.
</para>
</refsect1>
diff --git a/docs/xml/vg-entities.xml b/docs/xml/vg-entities.xml
index e65ed3e..f5994c1 100644
--- a/docs/xml/vg-entities.xml
+++ b/docs/xml/vg-entities.xml
@@ -23,4 +23,38 @@
<!ENTITY vg-docs-url "http://www.valgrind.org/docs/manual/index.html">
<!ENTITY cl-gui-url "http://kcachegrind.sourceforge.net/cgi-bin/show.cgi/KcacheGrindIndex">
+<!-- Some references are used between core manual manual and manpages. -->
+<!-- Define them here so the can easily be used in both places. -->
+<!-- See manual-core*.xml and valgrind-manpage.xml -->
+<!ENTITY vg-manual-url "http://www.valgrind.org/docs/manual/">
+
+<!ENTITY vg-gdbserver-manual "manual-core-adv">
+<!ENTITY vg-gdbserver-ref "gdbserver">
+<!ENTITY vg-gdbserver-label "Debugging your program using Valgrind's gdbserver and GDB">
+<!ENTITY vg-gdbserver-id "&vg-gdbserver-manual;.&vg-gdbserver-ref;">
+<!ENTITY vg-gdbserver-url "&vg-manual-url;&vg-gdbserver-manual;.html#&vg-gdbserver-id;">
+
+<!ENTITY vg-vgdb-manual "manual-core-adv">
+<!ENTITY vg-vgdb-ref "vgdb">
+<!ENTITY vg-vgdb-label "vgdb">
+<!ENTITY vg-vgdb-id "&vg-vgdb-manual;.&vg-vgdb-ref;">
+<!ENTITY vg-vgdb-url "&vg-manual-url;&vg-vgdb-manual;.html#&vg-vgdb-id;">
+
+<!ENTITY vg-monitor-manual "manual-core-adv">
+<!ENTITY vg-monitor-ref "valgrind-monitor-commands">
+<!ENTITY vg-monitor-label "Valgrind monitor commands">
+<!ENTITY vg-monitor-id "&vg-monitor-manual;.&vg-monitor-ref;">
+<!ENTITY vg-monitor-url "&vg-manual-url;&vg-monitor-manual;.html#&vg-monitor-id;">
+
+<!ENTITY vg-comment-manual "manual-core">
+<!ENTITY vg-comment-ref "comment">
+<!ENTITY vg-comment-label "The Commentary">
+<!ENTITY vg-comment-id "&vg-comment-manual;.&vg-comment-ref;">
+<!ENTITY vg-comment-url "&vg-manual-url;&vg-comment-manual;.html#&vg-comment-id;">
+
+<!ENTITY vg-pthreads-perf-sched-manual "manual-core">
+<!ENTITY vg-pthreads-perf-sched-ref "pthreads_perf_sched">
+<!ENTITY vg-pthreads-perf-sched-label "Scheduling and Multi-Thread Performance">
+<!ENTITY vg-pthreads-perf-sched-id "&vg-pthreads-perf-sched-manual;.&vg-pthreads-perf-sched-ref;">
+<!ENTITY vg-pthreads-perf-sched-url "&vg-manual-url;&vg-pthreads-perf-sched-manual;.html#&vg-pthreads-perf-sched-id;">
commit 90285ba7ed34f3fdef235d2976399bcd360d4515
Author: philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Sun Mar 10 16:20:10 2013 +0000
fix 315959 valgrind man page has bogus SGCHECK (and no BBV) OPTIONS section
PAtch from Mark Wielaard.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13323 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/exp-sgcheck/docs/sg-manual.xml b/exp-sgcheck/docs/sg-manual.xml
index 8632199..8b717e8 100644
--- a/exp-sgcheck/docs/sg-manual.xml
+++ b/exp-sgcheck/docs/sg-manual.xml
@@ -31,7 +31,7 @@ observation about the likely forms of stack and global array accesses.
<sect1 id="sg-manual.options" xreflabel="SGCheck Command-line Options">
<title>SGCheck Command-line Options</title>
-<para>There are no SGCheck-specific command-line options at present.</para>
+<para id="sg.opts.list">There are no SGCheck-specific command-line options at present.</para>
<!--
<para>SGCheck-specific command-line options are:</para>
commit e6bce130ae5da444da196cac75102554e80e9ce0
Author: philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Sun Mar 10 16:29:02 2013 +0000
Fix 316145 - callgrind command line options in manpage reference (unknown) callgrind manual
Patch by Mark Wielaard.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13324 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/cachegrind/docs/cg-manual.xml b/cachegrind/docs/cg-manual.xml
index fb6f978..13331d8 100644
--- a/cachegrind/docs/cg-manual.xml
+++ b/cachegrind/docs/cg-manual.xml
@@ -3,8 +3,8 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[ <!ENTITY % vg-entities SYSTEM "../../docs/xml/vg-entities.xml"> %vg-entities; ]>
-
-<chapter id="cg-manual" xreflabel="Cachegrind: a cache and branch-prediction profiler">
+<!-- Referenced from both the manual and manpage -->
+<chapter id="&vg-cg-manual-id;" xreflabel="&vg-cg-manual-label;">
<title>Cachegrind: a cache and branch-prediction profiler</title>
<para>To use this tool, you must specify
diff --git a/callgrind/docs/cl-manual.xml b/callgrind/docs/cl-manual.xml
index ab8d9bb..2f08ac8 100644
--- a/callgrind/docs/cl-manual.xml
+++ b/callgrind/docs/cl-manual.xml
@@ -88,7 +88,7 @@ optimization opportunities depend on changing code in the callers, in
particular by reducing the call count.</para>
<para>Callgrind's cache simulation is based on that of Cachegrind.
-Read the documentation for <xref linkend="cg-manual"/> first. The material
+Read the documentation for <xref linkend="&vg-cg-manual-id;"/> first. The material
below describes the features supported in addition to Cachegrind's
features.</para>
@@ -936,7 +936,7 @@ Also see <xref linkend="cl-manual.cycles"/>.</para>
Cache misses on instruction reads ("I1mr"/"ILmr"),
data read accesses ("Dr") and related cache misses ("D1mr"/"DLmr"),
data write accesses ("Dw") and related cache misses ("D1mw"/"DLmw").
- For more information, see <xref linkend="cg-manual"/>.
+ For more information, see <xref linkend="&vg-cg-manual-id;"/>.
</para>
</listitem>
</varlistentry>
diff --git a/docs/xml/valgrind-manpage.xml b/docs/xml/valgrind-manpage.xml
index bd4b924..a4b84ff 100644
--- a/docs/xml/valgrind-manpage.xml
+++ b/docs/xml/valgrind-manpage.xml
@@ -255,7 +255,10 @@ ms_print(1),
url="&vg-comment-url;">&vg-comment-label;</ulink>,
<ulink id="&vg-pthreads-perf-sched-id;"
xreflabel="&vg-pthreads-perf-sched-label;"
- url="&vg-pthreads-perf-sched-url;">&vg-pthreads-perf-sched-label;</ulink>.
+ url="&vg-pthreads-perf-sched-url;">&vg-pthreads-perf-sched-label;</ulink>,
+<ulink id="&vg-cg-manual-id;"
+ xreflabel="&vg-cg-manual-label;"
+ url="&vg-cg-manual-url;">&vg-cg-manual-label;</ulink>.
</para>
</refsect1>
diff --git a/docs/xml/vg-entities.xml b/docs/xml/vg-entities.xml
index f5994c1..29a337f 100644
--- a/docs/xml/vg-entities.xml
+++ b/docs/xml/vg-entities.xml
@@ -58,3 +58,7 @@
<!ENTITY vg-pthreads-perf-sched-id "&vg-pthreads-perf-sched-manual;.&vg-pthreads-perf-sched-ref;">
<!ENTITY vg-pthreads-perf-sched-url "&vg-manual-url;&vg-pthreads-perf-sched-manual;.html#&vg-pthreads-perf-sched-id;">
+
+<!ENTITY vg-cg-manual-id "cg-manual">
+<!ENTITY vg-cg-manual-label "Cachegrind: a cache and branch-prediction profiler">
+<!ENTITY vg-cg-manual-url "&vg-manual-url;&vg-cg-manual-id;.html">
diff -ur valgrind-3.8.1.orig/docs/callgrind_annotate.1 valgrind-3.8.1/docs/callgrind_annotate.1
--- valgrind-3.8.1.orig/docs/callgrind_annotate.1 2013-03-12 14:42:11.627471322 +0100
+++ valgrind-3.8.1/docs/callgrind_annotate.1 2013-03-12 14:42:28.762370486 +0100
@@ -1,13 +1,13 @@
'\" t
.\" Title: Callgrind Annotate
.\" Author: [see the "Author" section]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 09/18/2012
+.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
+.\" Date: 03/12/2013
.\" Manual: Release 3.8.0
.\" Source: Release 3.8.0
.\" Language: English
.\"
-.TH "CALLGRIND ANNOTATE" "1" "09/18/2012" "Release 3.8.0" "Release 3.8.0"
+.TH "CALLGRIND ANNOTATE" "1" "03/12/2013" "Release 3.8.1" "Release 3.8.1"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
diff -ur valgrind-3.8.1.orig/docs/callgrind_control.1 valgrind-3.8.1/docs/callgrind_control.1
--- valgrind-3.8.1.orig/docs/callgrind_control.1 2013-03-12 14:42:11.630471305 +0100
+++ valgrind-3.8.1/docs/callgrind_control.1 2013-03-12 14:42:28.778370392 +0100
@@ -1,13 +1,13 @@
'\" t
.\" Title: Callgrind Control
.\" Author: [see the "Author" section]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 09/18/2012
+.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
+.\" Date: 03/12/2013
.\" Manual: Release 3.8.0
.\" Source: Release 3.8.0
.\" Language: English
.\"
-.TH "CALLGRIND CONTROL" "1" "09/18/2012" "Release 3.8.0" "Release 3.8.0"
+.TH "CALLGRIND CONTROL" "1" "03/12/2013" "Release 3.8.1" "Release 3.8.1"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
diff -ur valgrind-3.8.1.orig/docs/cg_annotate.1 valgrind-3.8.1/docs/cg_annotate.1
--- valgrind-3.8.1.orig/docs/cg_annotate.1 2013-03-12 14:42:11.627471322 +0100
+++ valgrind-3.8.1/docs/cg_annotate.1 2013-03-12 14:42:28.745370586 +0100
@@ -1,13 +1,13 @@
'\" t
.\" Title: cg_annotate
.\" Author: [see the "Author" section]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 09/18/2012
+.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
+.\" Date: 03/12/2013
.\" Manual: Release 3.8.0
.\" Source: Release 3.8.0
.\" Language: English
.\"
-.TH "CG_ANNOTATE" "1" "09/18/2012" "Release 3.8.0" "Release 3.8.0"
+.TH "CG_ANNOTATE" "1" "03/12/2013" "Release 3.8.1" "Release 3.8.1"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
diff -ur valgrind-3.8.1.orig/docs/ms_print.1 valgrind-3.8.1/docs/ms_print.1
--- valgrind-3.8.1.orig/docs/ms_print.1 2013-03-12 14:42:11.627471322 +0100
+++ valgrind-3.8.1/docs/ms_print.1 2013-03-12 14:42:28.793370304 +0100
@@ -1,13 +1,13 @@
'\" t
.\" Title: ms_print
.\" Author: [see the "Author" section]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 09/18/2012
+.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
+.\" Date: 03/12/2013
.\" Manual: Release 3.8.0
.\" Source: Release 3.8.0
.\" Language: English
.\"
-.TH "MS_PRINT" "1" "09/18/2012" "Release 3.8.0" "Release 3.8.0"
+.TH "MS_PRINT" "1" "03/12/2013" "Release 3.8.1" "Release 3.8.1"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
diff -ur valgrind-3.8.1.orig/docs/valgrind.1 valgrind-3.8.1/docs/valgrind.1
--- valgrind-3.8.1.orig/docs/valgrind.1 2013-03-12 14:42:11.626471328 +0100
+++ valgrind-3.8.1/docs/valgrind.1 2013-03-12 14:42:28.728370686 +0100
@@ -1,13 +1,13 @@
'\" t
.\" Title: VALGRIND
.\" Author: [see the "Author" section]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 09/18/2012
+.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
+.\" Date: 03/12/2013
.\" Manual: Release 3.8.0
.\" Source: Release 3.8.0
.\" Language: English
.\"
-.TH "VALGRIND" "1" "09/18/2012" "Release 3.8.0" "Release 3.8.0"
+.TH "VALGRIND" "1" "03/12/2013" "Release 3.8.1" "Release 3.8.1"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -134,13 +134,13 @@
is specified\&. This allows an external GNU GDB debugger to control and debug your program when it runs on Valgrind\&.
\fB\-\-vgdb=full\fR
incurs significant performance overheads, but provides more precise breakpoints and watchpoints\&. See
-???
+Debugging your program using Valgrind's gdbserver and GDB
for a detailed description\&.
.sp
If the embedded gdbserver is enabled but no gdb is currently being used, the
-???
+vgdb
command line utility can send "monitor commands" to Valgrind from a shell\&. The Valgrind core provides a set of
-???\&. A tool can optionally provide tool specific monitor commands, which are documented in the tool specific chapter\&.
+Valgrind monitor commands\&. A tool can optionally provide tool specific monitor commands, which are documented in the tool specific chapter\&.
.RE
.PP
\fB\-\-vgdb\-error=<number> [default: 999999999] \fR
@@ -300,6 +300,15 @@
Specifies an alternative exit code to return if Valgrind reported any errors in the run\&. When set to the default value (zero), the return value from Valgrind will always be the return value of the process being simulated\&. When set to a nonzero value, that value is returned instead, if Valgrind detects any errors\&. This is useful for using Valgrind as part of an automated test suite, since it makes it easy to detect test cases for which Valgrind has reported errors, just by inspecting return codes\&.
.RE
.PP
+\fB\-\-sigill\-diagnostics=<yes|no> [default: yes] \fR
+.RS 4
+Enable/disable printing of illegal instruction diagnostics\&. Enabled by default, but defaults to disabled when
+\fB\-\-quiet\fR
+is given\&. The default can always be explicitly overridden by giving this option\&.
+.sp
+When enabled a warning message will be printed with some diagnostics whenever some instruction is encountered that valgrind cannot decode or translate before the program is given a SIGILL signal\&. Often an illegal instruction indicates a bug in the program or missing support for the particular instruction in Valgrind\&. But some programs do deliberately try to execute an instruction that might be missing and trap the SIGILL signal to detect processor features\&.
+.RE
+.PP
\fB\-\-show\-below\-main=<yes|no> [default: no] \fR
.RS 4
By default, stack traces for errors do not show any functions that appear beneath
@@ -755,7 +764,7 @@
The
\fB\-\-fair\-sched\fR
option controls the locking mechanism used by Valgrind to serialise thread execution\&. The locking mechanism controls the way the threads are scheduled, and different settings give different trade\-offs between fairness and performance\&. For more details about the Valgrind thread serialisation scheme and its impact on performance and thread scheduling, see
-???\&.
+Scheduling and Multi-Thread Performance\&.
.sp
.RS 4
.ie n \{\
@@ -1242,7 +1251,7 @@
\fB\-\-cache\-sim=<yes|no> [default: no] \fR
.RS 4
Specify if you want to do full cache simulation\&. By default, only instruction read accesses will be counted ("Ir")\&. With cache simulation, further event counters are enabled: Cache misses on instruction reads ("I1mr"/"ILmr"), data read accesses ("Dr") and related cache misses ("D1mr"/"DLmr"), data write accesses ("Dw") and related cache misses ("D1mw"/"DLmw")\&. For more information, see
-???\&.
+Cachegrind: a cache and branch-prediction profiler\&.
.RE
.PP
\fB\-\-branch\-sim=<yes|no> [default: no] \fR
@@ -1568,7 +1577,9 @@
\fB--log-file\fR\&.
.RE
.SH "SGCHECK OPTIONS"
-<xi:include></xi:include>.SH "BBV OPTIONS"
+.PP
+There are no SGCheck\-specific command\-line options at present\&.
+.SH "BBV OPTIONS"
.PP
\fB\-\-bb\-out\-file=<name> [default: bb\&.out\&.%p] \fR
.RS 4
@@ -1705,9 +1716,46 @@
cg_annotate(1), callgrind_annotate(1), callgrind_control(1), ms_print(1),
$INSTALL/share/doc/valgrind/html/index\&.html
or
-http://www\&.valgrind\&.org/docs/manual/index\&.html\&.
+http://www\&.valgrind\&.org/docs/manual/index\&.html,
+\m[blue]\fBDebugging your program using Valgrind\*(Aqs gdbserver and GDB\fR\m[]\&\s-2\u[1]\d\s+2
+\m[blue]\fBvgdb\fR\m[]\&\s-2\u[2]\d\s+2,
+\m[blue]\fBValgrind monitor commands\fR\m[]\&\s-2\u[3]\d\s+2,
+\m[blue]\fBThe Commentary\fR\m[]\&\s-2\u[4]\d\s+2,
+\m[blue]\fBScheduling and Multi\-Thread Performance\fR\m[]\&\s-2\u[5]\d\s+2,
+\m[blue]\fBCachegrind: a cache and branch\-prediction profiler\fR\m[]\&\s-2\u[6]\d\s+2\&.
.SH "AUTHOR"
.PP
The Valgrind developers\&.
.PP
This manpage was written by Andres Roldan <aroldan@debian\&.org> and the Valgrind developers\&.
+.SH "NOTES"
+.IP " 1." 4
+Debugging your program using Valgrind's gdbserver and GDB
+.RS 4
+\%http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver
+.RE
+.IP " 2." 4
+vgdb
+.RS 4
+\%http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.vgdb
+.RE
+.IP " 3." 4
+Valgrind monitor commands
+.RS 4
+\%http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.valgrind-monitor-commands
+.RE
+.IP " 4." 4
+The Commentary
+.RS 4
+\%http://www.valgrind.org/docs/manual/manual-core.html#manual-core.comment
+.RE
+.IP " 5." 4
+Scheduling and Multi-Thread Performance
+.RS 4
+\%http://www.valgrind.org/docs/manual/manual-core.html#manual-core.pthreads_perf_sched
+.RE
+.IP " 6." 4
+Cachegrind: a cache and branch-prediction profiler
+.RS 4
+\%http://www.valgrind.org/docs/manual/cg-manual.html
+.RE

View File

@ -1,11 +0,0 @@
--- valgrind/memcheck/mc_translate.c (revision 12883)
+++ valgrind/memcheck/mc_translate.c (revision 12884)
@@ -3313,6 +3313,8 @@
case Iop_DivModS128to64:
return mkLazy2(mce, Ity_I128, vatom1, vatom2);
+ case Iop_8HLto16:
+ return assignNew('V', mce, Ity_I16, binop(op, vatom1, vatom2));
case Iop_16HLto32:
return assignNew('V', mce, Ity_I32, binop(op, vatom1, vatom2));
case Iop_32HLto64:

View File

@ -1,975 +0,0 @@
commit a4b7b67db47021c424c18a5729f250016d34df27
Author: mjw <mjw@8f6e269a-dfd6-0310-a8e1-e2731360e62c>
Date: Tue Aug 27 10:19:03 2013 +0000
Support mmxext (integer sse) subset on i386 (athlon).
Some processors like the AMD Athlon "Classic" support mmxext,
a sse1 subset. This subset is not properly detected by VEX.
The subset uses the same encoding as the sse1 instructions.
The subset is described at:
http://support.amd.com/us/Embedded_TechDocs/22466.pdf
https://en.wikipedia.org/wiki/3DNow!#3DNow.21_extensions
This introduces a new VEX_HWCAPS_X86_MMXEXT that sits between
the baseline (0) and VEX_HWCAPS_X86_SSE1. There is also a new
x86g_dirtyhelper_CPUID_mmxext to mimics a Athlon "Classic"
(Model 2, K75 "Pluto/Orion").
Groups all mmxext instructions together in one block.
git-svn-id: svn://svn.valgrind.org/vex/trunk@2745 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/VEX/priv/guest_x86_defs.h b/VEX/priv/guest_x86_defs.h
index 389e6bb..1a16a0b 100644
--- a/VEX/priv/guest_x86_defs.h
+++ b/VEX/priv/guest_x86_defs.h
@@ -144,6 +144,7 @@ extern ULong x86g_dirtyhelper_loadF80le ( UInt );
extern void x86g_dirtyhelper_storeF80le ( UInt, ULong );
extern void x86g_dirtyhelper_CPUID_sse0 ( VexGuestX86State* );
+extern void x86g_dirtyhelper_CPUID_mmxext ( VexGuestX86State* );
extern void x86g_dirtyhelper_CPUID_sse1 ( VexGuestX86State* );
extern void x86g_dirtyhelper_CPUID_sse2 ( VexGuestX86State* );
diff --git a/VEX/priv/guest_x86_helpers.c b/VEX/priv/guest_x86_helpers.c
index 9c26794..e87e89f 100644
--- a/VEX/priv/guest_x86_helpers.c
+++ b/VEX/priv/guest_x86_helpers.c
@@ -2207,6 +2207,63 @@ void x86g_dirtyhelper_CPUID_sse0 ( VexGuestX86State* st )
/* CALLED FROM GENERATED CODE */
/* DIRTY HELPER (modifies guest state) */
+/* Claim to be a Athlon "Classic" (Model 2, K75 "Pluto/Orion") */
+/* But without 3DNow support (weird, but we really don't support it). */
+void x86g_dirtyhelper_CPUID_mmxext ( VexGuestX86State* st )
+{
+ switch (st->guest_EAX) {
+ /* vendor ID */
+ case 0:
+ st->guest_EAX = 0x1;
+ st->guest_EBX = 0x68747541;
+ st->guest_ECX = 0x444d4163;
+ st->guest_EDX = 0x69746e65;
+ break;
+ /* feature bits */
+ case 1:
+ st->guest_EAX = 0x621;
+ st->guest_EBX = 0x0;
+ st->guest_ECX = 0x0;
+ st->guest_EDX = 0x183f9ff;
+ break;
+ /* Highest Extended Function Supported (0x80000004 brand string) */
+ case 0x80000000:
+ st->guest_EAX = 0x80000004;
+ st->guest_EBX = 0x68747541;
+ st->guest_ECX = 0x444d4163;
+ st->guest_EDX = 0x69746e65;
+ break;
+ /* Extended Processor Info and Feature Bits */
+ case 0x80000001:
+ st->guest_EAX = 0x721;
+ st->guest_EBX = 0x0;
+ st->guest_ECX = 0x0;
+ st->guest_EDX = 0x1c3f9ff; /* Note no 3DNow. */
+ break;
+ /* Processor Brand String "AMD Athlon(tm) Processor" */
+ case 0x80000002:
+ st->guest_EAX = 0x20444d41;
+ st->guest_EBX = 0x6c687441;
+ st->guest_ECX = 0x74286e6f;
+ st->guest_EDX = 0x5020296d;
+ break;
+ case 0x80000003:
+ st->guest_EAX = 0x65636f72;
+ st->guest_EBX = 0x726f7373;
+ st->guest_ECX = 0x0;
+ st->guest_EDX = 0x0;
+ break;
+ default:
+ st->guest_EAX = 0x0;
+ st->guest_EBX = 0x0;
+ st->guest_ECX = 0x0;
+ st->guest_EDX = 0x0;
+ break;
+ }
+}
+
+/* CALLED FROM GENERATED CODE */
+/* DIRTY HELPER (modifies guest state) */
/* Claim to be the following SSE1-capable CPU:
vendor_id : GenuineIntel
cpu family : 6
diff --git a/VEX/priv/guest_x86_toIR.c b/VEX/priv/guest_x86_toIR.c
index 90499b0..e98f19c 100644
--- a/VEX/priv/guest_x86_toIR.c
+++ b/VEX/priv/guest_x86_toIR.c
@@ -8318,7 +8318,18 @@ DisResult disInstr_X86_WRK (
guest subarchitecture. */
if (archinfo->hwcaps == 0/*baseline, no sse at all*/)
goto after_sse_decoders;
-
+
+ /* With mmxext only some extended MMX instructions are recognized.
+ The mmxext instructions are MASKMOVQ MOVNTQ PAVGB PAVGW PMAXSW
+ PMAXUB PMINSW PMINUB PMULHUW PSADBW PSHUFW PEXTRW PINSRW PMOVMSKB
+ PREFETCHNTA PREFETCHT0 PREFETCHT1 PREFETCHT2 SFENCE
+
+ http://support.amd.com/us/Embedded_TechDocs/22466.pdf
+ https://en.wikipedia.org/wiki/3DNow!#3DNow.21_extensions */
+
+ if (archinfo->hwcaps == VEX_HWCAPS_X86_MMXEXT/*integer only sse1 subset*/)
+ goto mmxext;
+
/* Otherwise we must be doing sse1 or sse2, so we can at least try
for SSE1 here. */
@@ -8627,6 +8638,11 @@ DisResult disInstr_X86_WRK (
goto decode_success;
}
+
+ /* mmxext sse1 subset starts here. mmxext only arches will parse
+ only this subset of the sse1 instructions. */
+ mmxext:
+
/* ***--- this is an MMX class insn introduced in SSE1 ---*** */
/* 0F F7 = MASKMOVQ -- 8x8 masked store */
if (sz == 4 && insn[0] == 0x0F && insn[1] == 0xF7) {
@@ -8637,203 +8653,6 @@ DisResult disInstr_X86_WRK (
goto decode_success;
}
- /* 0F 5F = MAXPS -- max 32Fx4 from R/M to R */
- if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x5F) {
- delta = dis_SSE_E_to_G_all( sorb, delta+2, "maxps", Iop_Max32Fx4 );
- goto decode_success;
- }
-
- /* F3 0F 5F = MAXSS -- max 32F0x4 from R/M to R */
- if (insn[0] == 0xF3 && insn[1] == 0x0F && insn[2] == 0x5F) {
- vassert(sz == 4);
- delta = dis_SSE_E_to_G_lo32( sorb, delta+3, "maxss", Iop_Max32F0x4 );
- goto decode_success;
- }
-
- /* 0F 5D = MINPS -- min 32Fx4 from R/M to R */
- if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x5D) {
- delta = dis_SSE_E_to_G_all( sorb, delta+2, "minps", Iop_Min32Fx4 );
- goto decode_success;
- }
-
- /* F3 0F 5D = MINSS -- min 32F0x4 from R/M to R */
- if (insn[0] == 0xF3 && insn[1] == 0x0F && insn[2] == 0x5D) {
- vassert(sz == 4);
- delta = dis_SSE_E_to_G_lo32( sorb, delta+3, "minss", Iop_Min32F0x4 );
- goto decode_success;
- }
-
- /* 0F 28 = MOVAPS -- move from E (mem or xmm) to G (xmm). */
- /* 0F 10 = MOVUPS -- move from E (mem or xmm) to G (xmm). */
- if (sz == 4 && insn[0] == 0x0F && (insn[1] == 0x28 || insn[1] == 0x10)) {
- modrm = getIByte(delta+2);
- if (epartIsReg(modrm)) {
- putXMMReg( gregOfRM(modrm),
- getXMMReg( eregOfRM(modrm) ));
- DIP("mov[ua]ps %s,%s\n", nameXMMReg(eregOfRM(modrm)),
- nameXMMReg(gregOfRM(modrm)));
- delta += 2+1;
- } else {
- addr = disAMode ( &alen, sorb, delta+2, dis_buf );
- if (insn[1] == 0x28/*movaps*/)
- gen_SEGV_if_not_16_aligned( addr );
- putXMMReg( gregOfRM(modrm),
- loadLE(Ity_V128, mkexpr(addr)) );
- DIP("mov[ua]ps %s,%s\n", dis_buf,
- nameXMMReg(gregOfRM(modrm)));
- delta += 2+alen;
- }
- goto decode_success;
- }
-
- /* 0F 29 = MOVAPS -- move from G (xmm) to E (mem or xmm). */
- /* 0F 11 = MOVUPS -- move from G (xmm) to E (mem or xmm). */
- if (sz == 4 && insn[0] == 0x0F
- && (insn[1] == 0x29 || insn[1] == 0x11)) {
- modrm = getIByte(delta+2);
- if (epartIsReg(modrm)) {
- /* fall through; awaiting test case */
- } else {
- addr = disAMode ( &alen, sorb, delta+2, dis_buf );
- if (insn[1] == 0x29/*movaps*/)
- gen_SEGV_if_not_16_aligned( addr );
- storeLE( mkexpr(addr), getXMMReg(gregOfRM(modrm)) );
- DIP("mov[ua]ps %s,%s\n", nameXMMReg(gregOfRM(modrm)),
- dis_buf );
- delta += 2+alen;
- goto decode_success;
- }
- }
-
- /* 0F 16 = MOVHPS -- move from mem to high half of XMM. */
- /* 0F 16 = MOVLHPS -- move from lo half to hi half of XMM. */
- if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x16) {
- modrm = getIByte(delta+2);
- if (epartIsReg(modrm)) {
- delta += 2+1;
- putXMMRegLane64( gregOfRM(modrm), 1/*upper lane*/,
- getXMMRegLane64( eregOfRM(modrm), 0 ) );
- DIP("movhps %s,%s\n", nameXMMReg(eregOfRM(modrm)),
- nameXMMReg(gregOfRM(modrm)));
- } else {
- addr = disAMode ( &alen, sorb, delta+2, dis_buf );
- delta += 2+alen;
- putXMMRegLane64( gregOfRM(modrm), 1/*upper lane*/,
- loadLE(Ity_I64, mkexpr(addr)) );
- DIP("movhps %s,%s\n", dis_buf,
- nameXMMReg( gregOfRM(modrm) ));
- }
- goto decode_success;
- }
-
- /* 0F 17 = MOVHPS -- move from high half of XMM to mem. */
- if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x17) {
- if (!epartIsReg(insn[2])) {
- delta += 2;
- addr = disAMode ( &alen, sorb, delta, dis_buf );
- delta += alen;
- storeLE( mkexpr(addr),
- getXMMRegLane64( gregOfRM(insn[2]),
- 1/*upper lane*/ ) );
- DIP("movhps %s,%s\n", nameXMMReg( gregOfRM(insn[2]) ),
- dis_buf);
- goto decode_success;
- }
- /* else fall through */
- }
-
- /* 0F 12 = MOVLPS -- move from mem to low half of XMM. */
- /* OF 12 = MOVHLPS -- from from hi half to lo half of XMM. */
- if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x12) {
- modrm = getIByte(delta+2);
- if (epartIsReg(modrm)) {
- delta += 2+1;
- putXMMRegLane64( gregOfRM(modrm),
- 0/*lower lane*/,
- getXMMRegLane64( eregOfRM(modrm), 1 ));
- DIP("movhlps %s, %s\n", nameXMMReg(eregOfRM(modrm)),
- nameXMMReg(gregOfRM(modrm)));
- } else {
- addr = disAMode ( &alen, sorb, delta+2, dis_buf );
- delta += 2+alen;
- putXMMRegLane64( gregOfRM(modrm), 0/*lower lane*/,
- loadLE(Ity_I64, mkexpr(addr)) );
- DIP("movlps %s, %s\n",
- dis_buf, nameXMMReg( gregOfRM(modrm) ));
- }
- goto decode_success;
- }
-
- /* 0F 13 = MOVLPS -- move from low half of XMM to mem. */
- if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x13) {
- if (!epartIsReg(insn[2])) {
- delta += 2;
- addr = disAMode ( &alen, sorb, delta, dis_buf );
- delta += alen;
- storeLE( mkexpr(addr),
- getXMMRegLane64( gregOfRM(insn[2]),
- 0/*lower lane*/ ) );
- DIP("movlps %s, %s\n", nameXMMReg( gregOfRM(insn[2]) ),
- dis_buf);
- goto decode_success;
- }
- /* else fall through */
- }
-
- /* 0F 50 = MOVMSKPS - move 4 sign bits from 4 x F32 in xmm(E)
- to 4 lowest bits of ireg(G) */
- if (insn[0] == 0x0F && insn[1] == 0x50) {
- modrm = getIByte(delta+2);
- if (sz == 4 && epartIsReg(modrm)) {
- Int src;
- t0 = newTemp(Ity_I32);
- t1 = newTemp(Ity_I32);
- t2 = newTemp(Ity_I32);
- t3 = newTemp(Ity_I32);
- delta += 2+1;
- src = eregOfRM(modrm);
- assign( t0, binop( Iop_And32,
- binop(Iop_Shr32, getXMMRegLane32(src,0), mkU8(31)),
- mkU32(1) ));
- assign( t1, binop( Iop_And32,
- binop(Iop_Shr32, getXMMRegLane32(src,1), mkU8(30)),
- mkU32(2) ));
- assign( t2, binop( Iop_And32,
- binop(Iop_Shr32, getXMMRegLane32(src,2), mkU8(29)),
- mkU32(4) ));
- assign( t3, binop( Iop_And32,
- binop(Iop_Shr32, getXMMRegLane32(src,3), mkU8(28)),
- mkU32(8) ));
- putIReg(4, gregOfRM(modrm),
- binop(Iop_Or32,
- binop(Iop_Or32, mkexpr(t0), mkexpr(t1)),
- binop(Iop_Or32, mkexpr(t2), mkexpr(t3))
- )
- );
- DIP("movmskps %s,%s\n", nameXMMReg(src),
- nameIReg(4, gregOfRM(modrm)));
- goto decode_success;
- }
- /* else fall through */
- }
-
- /* 0F 2B = MOVNTPS -- for us, just a plain SSE store. */
- /* 66 0F 2B = MOVNTPD -- for us, just a plain SSE store. */
- if (insn[0] == 0x0F && insn[1] == 0x2B) {
- modrm = getIByte(delta+2);
- if (!epartIsReg(modrm)) {
- addr = disAMode ( &alen, sorb, delta+2, dis_buf );
- gen_SEGV_if_not_16_aligned( addr );
- storeLE( mkexpr(addr), getXMMReg(gregOfRM(modrm)) );
- DIP("movntp%s %s,%s\n", sz==2 ? "d" : "s",
- dis_buf,
- nameXMMReg(gregOfRM(modrm)));
- delta += 2+alen;
- goto decode_success;
- }
- /* else fall through */
- }
-
/* ***--- this is an MMX class insn introduced in SSE1 ---*** */
/* 0F E7 = MOVNTQ -- for us, just a plain MMX store. Note, the
Intel manual does not say anything about the usual business of
@@ -8854,70 +8673,6 @@ DisResult disInstr_X86_WRK (
/* else fall through */
}
- /* F3 0F 10 = MOVSS -- move 32 bits from E (mem or lo 1/4 xmm) to G
- (lo 1/4 xmm). If E is mem, upper 3/4 of G is zeroed out. */
- if (insn[0] == 0xF3 && insn[1] == 0x0F && insn[2] == 0x10) {
- vassert(sz == 4);
- modrm = getIByte(delta+3);
- if (epartIsReg(modrm)) {
- putXMMRegLane32( gregOfRM(modrm), 0,
- getXMMRegLane32( eregOfRM(modrm), 0 ));
- DIP("movss %s,%s\n", nameXMMReg(eregOfRM(modrm)),
- nameXMMReg(gregOfRM(modrm)));
- delta += 3+1;
- } else {
- addr = disAMode ( &alen, sorb, delta+3, dis_buf );
- /* zero bits 127:64 */
- putXMMRegLane64( gregOfRM(modrm), 1, mkU64(0) );
- /* zero bits 63:32 */
- putXMMRegLane32( gregOfRM(modrm), 1, mkU32(0) );
- /* write bits 31:0 */
- putXMMRegLane32( gregOfRM(modrm), 0,
- loadLE(Ity_I32, mkexpr(addr)) );
- DIP("movss %s,%s\n", dis_buf,
- nameXMMReg(gregOfRM(modrm)));
- delta += 3+alen;
- }
- goto decode_success;
- }
-
- /* F3 0F 11 = MOVSS -- move 32 bits from G (lo 1/4 xmm) to E (mem
- or lo 1/4 xmm). */
- if (insn[0] == 0xF3 && insn[1] == 0x0F && insn[2] == 0x11) {
- vassert(sz == 4);
- modrm = getIByte(delta+3);
- if (epartIsReg(modrm)) {
- /* fall through, we don't yet have a test case */
- } else {
- addr = disAMode ( &alen, sorb, delta+3, dis_buf );
- storeLE( mkexpr(addr),
- getXMMRegLane32(gregOfRM(modrm), 0) );
- DIP("movss %s,%s\n", nameXMMReg(gregOfRM(modrm)),
- dis_buf);
- delta += 3+alen;
- goto decode_success;
- }
- }
-
- /* 0F 59 = MULPS -- mul 32Fx4 from R/M to R */
- if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x59) {
- delta = dis_SSE_E_to_G_all( sorb, delta+2, "mulps", Iop_Mul32Fx4 );
- goto decode_success;
- }
-
- /* F3 0F 59 = MULSS -- mul 32F0x4 from R/M to R */
- if (insn[0] == 0xF3 && insn[1] == 0x0F && insn[2] == 0x59) {
- vassert(sz == 4);
- delta = dis_SSE_E_to_G_lo32( sorb, delta+3, "mulss", Iop_Mul32F0x4 );
- goto decode_success;
- }
-
- /* 0F 56 = ORPS -- G = G and E */
- if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x56) {
- delta = dis_SSE_E_to_G_all( sorb, delta+2, "orps", Iop_OrV128 );
- goto decode_success;
- }
-
/* ***--- this is an MMX class insn introduced in SSE1 ---*** */
/* 0F E0 = PAVGB -- 8x8 unsigned Packed Average, with rounding */
if (sz == 4 && insn[0] == 0x0F && insn[1] == 0xE0) {
@@ -9173,6 +8928,284 @@ DisResult disInstr_X86_WRK (
goto decode_success;
}
+ /* 0F AE /7 = SFENCE -- flush pending operations to memory */
+ if (insn[0] == 0x0F && insn[1] == 0xAE
+ && epartIsReg(insn[2]) && gregOfRM(insn[2]) == 7) {
+ vassert(sz == 4);
+ delta += 3;
+ /* Insert a memory fence. It's sometimes important that these
+ are carried through to the generated code. */
+ stmt( IRStmt_MBE(Imbe_Fence) );
+ DIP("sfence\n");
+ goto decode_success;
+ }
+
+ /* End of mmxext sse1 subset. No more sse parsing for mmxext only arches. */
+ if (archinfo->hwcaps == VEX_HWCAPS_X86_MMXEXT/*integer only sse1 subset*/)
+ goto after_sse_decoders;
+
+
+ /* 0F 5F = MAXPS -- max 32Fx4 from R/M to R */
+ if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x5F) {
+ delta = dis_SSE_E_to_G_all( sorb, delta+2, "maxps", Iop_Max32Fx4 );
+ goto decode_success;
+ }
+
+ /* F3 0F 5F = MAXSS -- max 32F0x4 from R/M to R */
+ if (insn[0] == 0xF3 && insn[1] == 0x0F && insn[2] == 0x5F) {
+ vassert(sz == 4);
+ delta = dis_SSE_E_to_G_lo32( sorb, delta+3, "maxss", Iop_Max32F0x4 );
+ goto decode_success;
+ }
+
+ /* 0F 5D = MINPS -- min 32Fx4 from R/M to R */
+ if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x5D) {
+ delta = dis_SSE_E_to_G_all( sorb, delta+2, "minps", Iop_Min32Fx4 );
+ goto decode_success;
+ }
+
+ /* F3 0F 5D = MINSS -- min 32F0x4 from R/M to R */
+ if (insn[0] == 0xF3 && insn[1] == 0x0F && insn[2] == 0x5D) {
+ vassert(sz == 4);
+ delta = dis_SSE_E_to_G_lo32( sorb, delta+3, "minss", Iop_Min32F0x4 );
+ goto decode_success;
+ }
+
+ /* 0F 28 = MOVAPS -- move from E (mem or xmm) to G (xmm). */
+ /* 0F 10 = MOVUPS -- move from E (mem or xmm) to G (xmm). */
+ if (sz == 4 && insn[0] == 0x0F && (insn[1] == 0x28 || insn[1] == 0x10)) {
+ modrm = getIByte(delta+2);
+ if (epartIsReg(modrm)) {
+ putXMMReg( gregOfRM(modrm),
+ getXMMReg( eregOfRM(modrm) ));
+ DIP("mov[ua]ps %s,%s\n", nameXMMReg(eregOfRM(modrm)),
+ nameXMMReg(gregOfRM(modrm)));
+ delta += 2+1;
+ } else {
+ addr = disAMode ( &alen, sorb, delta+2, dis_buf );
+ if (insn[1] == 0x28/*movaps*/)
+ gen_SEGV_if_not_16_aligned( addr );
+ putXMMReg( gregOfRM(modrm),
+ loadLE(Ity_V128, mkexpr(addr)) );
+ DIP("mov[ua]ps %s,%s\n", dis_buf,
+ nameXMMReg(gregOfRM(modrm)));
+ delta += 2+alen;
+ }
+ goto decode_success;
+ }
+
+ /* 0F 29 = MOVAPS -- move from G (xmm) to E (mem or xmm). */
+ /* 0F 11 = MOVUPS -- move from G (xmm) to E (mem or xmm). */
+ if (sz == 4 && insn[0] == 0x0F
+ && (insn[1] == 0x29 || insn[1] == 0x11)) {
+ modrm = getIByte(delta+2);
+ if (epartIsReg(modrm)) {
+ /* fall through; awaiting test case */
+ } else {
+ addr = disAMode ( &alen, sorb, delta+2, dis_buf );
+ if (insn[1] == 0x29/*movaps*/)
+ gen_SEGV_if_not_16_aligned( addr );
+ storeLE( mkexpr(addr), getXMMReg(gregOfRM(modrm)) );
+ DIP("mov[ua]ps %s,%s\n", nameXMMReg(gregOfRM(modrm)),
+ dis_buf );
+ delta += 2+alen;
+ goto decode_success;
+ }
+ }
+
+ /* 0F 16 = MOVHPS -- move from mem to high half of XMM. */
+ /* 0F 16 = MOVLHPS -- move from lo half to hi half of XMM. */
+ if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x16) {
+ modrm = getIByte(delta+2);
+ if (epartIsReg(modrm)) {
+ delta += 2+1;
+ putXMMRegLane64( gregOfRM(modrm), 1/*upper lane*/,
+ getXMMRegLane64( eregOfRM(modrm), 0 ) );
+ DIP("movhps %s,%s\n", nameXMMReg(eregOfRM(modrm)),
+ nameXMMReg(gregOfRM(modrm)));
+ } else {
+ addr = disAMode ( &alen, sorb, delta+2, dis_buf );
+ delta += 2+alen;
+ putXMMRegLane64( gregOfRM(modrm), 1/*upper lane*/,
+ loadLE(Ity_I64, mkexpr(addr)) );
+ DIP("movhps %s,%s\n", dis_buf,
+ nameXMMReg( gregOfRM(modrm) ));
+ }
+ goto decode_success;
+ }
+
+ /* 0F 17 = MOVHPS -- move from high half of XMM to mem. */
+ if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x17) {
+ if (!epartIsReg(insn[2])) {
+ delta += 2;
+ addr = disAMode ( &alen, sorb, delta, dis_buf );
+ delta += alen;
+ storeLE( mkexpr(addr),
+ getXMMRegLane64( gregOfRM(insn[2]),
+ 1/*upper lane*/ ) );
+ DIP("movhps %s,%s\n", nameXMMReg( gregOfRM(insn[2]) ),
+ dis_buf);
+ goto decode_success;
+ }
+ /* else fall through */
+ }
+
+ /* 0F 12 = MOVLPS -- move from mem to low half of XMM. */
+ /* OF 12 = MOVHLPS -- from from hi half to lo half of XMM. */
+ if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x12) {
+ modrm = getIByte(delta+2);
+ if (epartIsReg(modrm)) {
+ delta += 2+1;
+ putXMMRegLane64( gregOfRM(modrm),
+ 0/*lower lane*/,
+ getXMMRegLane64( eregOfRM(modrm), 1 ));
+ DIP("movhlps %s, %s\n", nameXMMReg(eregOfRM(modrm)),
+ nameXMMReg(gregOfRM(modrm)));
+ } else {
+ addr = disAMode ( &alen, sorb, delta+2, dis_buf );
+ delta += 2+alen;
+ putXMMRegLane64( gregOfRM(modrm), 0/*lower lane*/,
+ loadLE(Ity_I64, mkexpr(addr)) );
+ DIP("movlps %s, %s\n",
+ dis_buf, nameXMMReg( gregOfRM(modrm) ));
+ }
+ goto decode_success;
+ }
+
+ /* 0F 13 = MOVLPS -- move from low half of XMM to mem. */
+ if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x13) {
+ if (!epartIsReg(insn[2])) {
+ delta += 2;
+ addr = disAMode ( &alen, sorb, delta, dis_buf );
+ delta += alen;
+ storeLE( mkexpr(addr),
+ getXMMRegLane64( gregOfRM(insn[2]),
+ 0/*lower lane*/ ) );
+ DIP("movlps %s, %s\n", nameXMMReg( gregOfRM(insn[2]) ),
+ dis_buf);
+ goto decode_success;
+ }
+ /* else fall through */
+ }
+
+ /* 0F 50 = MOVMSKPS - move 4 sign bits from 4 x F32 in xmm(E)
+ to 4 lowest bits of ireg(G) */
+ if (insn[0] == 0x0F && insn[1] == 0x50) {
+ modrm = getIByte(delta+2);
+ if (sz == 4 && epartIsReg(modrm)) {
+ Int src;
+ t0 = newTemp(Ity_I32);
+ t1 = newTemp(Ity_I32);
+ t2 = newTemp(Ity_I32);
+ t3 = newTemp(Ity_I32);
+ delta += 2+1;
+ src = eregOfRM(modrm);
+ assign( t0, binop( Iop_And32,
+ binop(Iop_Shr32, getXMMRegLane32(src,0), mkU8(31)),
+ mkU32(1) ));
+ assign( t1, binop( Iop_And32,
+ binop(Iop_Shr32, getXMMRegLane32(src,1), mkU8(30)),
+ mkU32(2) ));
+ assign( t2, binop( Iop_And32,
+ binop(Iop_Shr32, getXMMRegLane32(src,2), mkU8(29)),
+ mkU32(4) ));
+ assign( t3, binop( Iop_And32,
+ binop(Iop_Shr32, getXMMRegLane32(src,3), mkU8(28)),
+ mkU32(8) ));
+ putIReg(4, gregOfRM(modrm),
+ binop(Iop_Or32,
+ binop(Iop_Or32, mkexpr(t0), mkexpr(t1)),
+ binop(Iop_Or32, mkexpr(t2), mkexpr(t3))
+ )
+ );
+ DIP("movmskps %s,%s\n", nameXMMReg(src),
+ nameIReg(4, gregOfRM(modrm)));
+ goto decode_success;
+ }
+ /* else fall through */
+ }
+
+ /* 0F 2B = MOVNTPS -- for us, just a plain SSE store. */
+ /* 66 0F 2B = MOVNTPD -- for us, just a plain SSE store. */
+ if (insn[0] == 0x0F && insn[1] == 0x2B) {
+ modrm = getIByte(delta+2);
+ if (!epartIsReg(modrm)) {
+ addr = disAMode ( &alen, sorb, delta+2, dis_buf );
+ gen_SEGV_if_not_16_aligned( addr );
+ storeLE( mkexpr(addr), getXMMReg(gregOfRM(modrm)) );
+ DIP("movntp%s %s,%s\n", sz==2 ? "d" : "s",
+ dis_buf,
+ nameXMMReg(gregOfRM(modrm)));
+ delta += 2+alen;
+ goto decode_success;
+ }
+ /* else fall through */
+ }
+
+ /* F3 0F 10 = MOVSS -- move 32 bits from E (mem or lo 1/4 xmm) to G
+ (lo 1/4 xmm). If E is mem, upper 3/4 of G is zeroed out. */
+ if (insn[0] == 0xF3 && insn[1] == 0x0F && insn[2] == 0x10) {
+ vassert(sz == 4);
+ modrm = getIByte(delta+3);
+ if (epartIsReg(modrm)) {
+ putXMMRegLane32( gregOfRM(modrm), 0,
+ getXMMRegLane32( eregOfRM(modrm), 0 ));
+ DIP("movss %s,%s\n", nameXMMReg(eregOfRM(modrm)),
+ nameXMMReg(gregOfRM(modrm)));
+ delta += 3+1;
+ } else {
+ addr = disAMode ( &alen, sorb, delta+3, dis_buf );
+ /* zero bits 127:64 */
+ putXMMRegLane64( gregOfRM(modrm), 1, mkU64(0) );
+ /* zero bits 63:32 */
+ putXMMRegLane32( gregOfRM(modrm), 1, mkU32(0) );
+ /* write bits 31:0 */
+ putXMMRegLane32( gregOfRM(modrm), 0,
+ loadLE(Ity_I32, mkexpr(addr)) );
+ DIP("movss %s,%s\n", dis_buf,
+ nameXMMReg(gregOfRM(modrm)));
+ delta += 3+alen;
+ }
+ goto decode_success;
+ }
+
+ /* F3 0F 11 = MOVSS -- move 32 bits from G (lo 1/4 xmm) to E (mem
+ or lo 1/4 xmm). */
+ if (insn[0] == 0xF3 && insn[1] == 0x0F && insn[2] == 0x11) {
+ vassert(sz == 4);
+ modrm = getIByte(delta+3);
+ if (epartIsReg(modrm)) {
+ /* fall through, we don't yet have a test case */
+ } else {
+ addr = disAMode ( &alen, sorb, delta+3, dis_buf );
+ storeLE( mkexpr(addr),
+ getXMMRegLane32(gregOfRM(modrm), 0) );
+ DIP("movss %s,%s\n", nameXMMReg(gregOfRM(modrm)),
+ dis_buf);
+ delta += 3+alen;
+ goto decode_success;
+ }
+ }
+
+ /* 0F 59 = MULPS -- mul 32Fx4 from R/M to R */
+ if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x59) {
+ delta = dis_SSE_E_to_G_all( sorb, delta+2, "mulps", Iop_Mul32Fx4 );
+ goto decode_success;
+ }
+
+ /* F3 0F 59 = MULSS -- mul 32F0x4 from R/M to R */
+ if (insn[0] == 0xF3 && insn[1] == 0x0F && insn[2] == 0x59) {
+ vassert(sz == 4);
+ delta = dis_SSE_E_to_G_lo32( sorb, delta+3, "mulss", Iop_Mul32F0x4 );
+ goto decode_success;
+ }
+
+ /* 0F 56 = ORPS -- G = G and E */
+ if (sz == 4 && insn[0] == 0x0F && insn[1] == 0x56) {
+ delta = dis_SSE_E_to_G_all( sorb, delta+2, "orps", Iop_OrV128 );
+ goto decode_success;
+ }
+
/* 0F 53 = RCPPS -- approx reciprocal 32Fx4 from R/M to R */
if (insn[0] == 0x0F && insn[1] == 0x53) {
vassert(sz == 4);
@@ -9205,18 +9238,6 @@ DisResult disInstr_X86_WRK (
goto decode_success;
}
- /* 0F AE /7 = SFENCE -- flush pending operations to memory */
- if (insn[0] == 0x0F && insn[1] == 0xAE
- && epartIsReg(insn[2]) && gregOfRM(insn[2]) == 7) {
- vassert(sz == 4);
- delta += 3;
- /* Insert a memory fence. It's sometimes important that these
- are carried through to the generated code. */
- stmt( IRStmt_MBE(Imbe_Fence) );
- DIP("sfence\n");
- goto decode_success;
- }
-
/* 0F C6 /r ib = SHUFPS -- shuffle packed F32s */
if (sz == 4 && insn[0] == 0x0F && insn[1] == 0xC6) {
Int select;
@@ -14674,6 +14695,11 @@ DisResult disInstr_X86_WRK (
fAddr = &x86g_dirtyhelper_CPUID_sse1;
}
else
+ if (archinfo->hwcaps & VEX_HWCAPS_X86_MMXEXT) {
+ fName = "x86g_dirtyhelper_CPUID_mmxext";
+ fAddr = &x86g_dirtyhelper_CPUID_mmxext;
+ }
+ else
if (archinfo->hwcaps == 0/*no SSE*/) {
fName = "x86g_dirtyhelper_CPUID_sse0";
fAddr = &x86g_dirtyhelper_CPUID_sse0;
diff --git a/VEX/priv/host_x86_defs.c b/VEX/priv/host_x86_defs.c
index 21a05a9..693eaa2 100644
--- a/VEX/priv/host_x86_defs.c
+++ b/VEX/priv/host_x86_defs.c
@@ -727,7 +727,8 @@ X86Instr* X86Instr_MFence ( UInt hwcaps ) {
X86Instr* i = LibVEX_Alloc(sizeof(X86Instr));
i->tag = Xin_MFence;
i->Xin.MFence.hwcaps = hwcaps;
- vassert(0 == (hwcaps & ~(VEX_HWCAPS_X86_SSE1
+ vassert(0 == (hwcaps & ~(VEX_HWCAPS_X86_MMXEXT
+ |VEX_HWCAPS_X86_SSE1
|VEX_HWCAPS_X86_SSE2
|VEX_HWCAPS_X86_SSE3
|VEX_HWCAPS_X86_LZCNT)));
@@ -2695,7 +2696,7 @@ Int emit_X86Instr ( /*MB_MOD*/Bool* is_profInc,
*p++ = 0x0F; *p++ = 0xAE; *p++ = 0xF0;
goto done;
}
- if (i->Xin.MFence.hwcaps & VEX_HWCAPS_X86_SSE1) {
+ if (i->Xin.MFence.hwcaps & VEX_HWCAPS_X86_MMXEXT) {
/* sfence */
*p++ = 0x0F; *p++ = 0xAE; *p++ = 0xF8;
/* lock addl $0,0(%esp) */
diff --git a/VEX/priv/host_x86_defs.h b/VEX/priv/host_x86_defs.h
index f810ab4..e03becf 100644
--- a/VEX/priv/host_x86_defs.h
+++ b/VEX/priv/host_x86_defs.h
@@ -360,7 +360,7 @@ typedef
Xin_Store, /* store 16/8 bit value in memory */
Xin_Set32, /* convert condition code to 32-bit value */
Xin_Bsfr32, /* 32-bit bsf/bsr */
- Xin_MFence, /* mem fence (not just sse2, but sse0 and 1 too) */
+ Xin_MFence, /* mem fence (not just sse2, but sse0 and 1/mmxext too) */
Xin_ACAS, /* 8/16/32-bit lock;cmpxchg */
Xin_DACAS, /* lock;cmpxchg8b (doubleword ACAS, 2 x 32-bit only) */
@@ -508,13 +508,13 @@ typedef
HReg src;
HReg dst;
} Bsfr32;
- /* Mem fence (not just sse2, but sse0 and 1 too). In short,
- an insn which flushes all preceding loads and stores as
- much as possible before continuing. On SSE2 we emit a
- real "mfence", on SSE1 "sfence ; lock addl $0,0(%esp)" and
- on SSE0 "lock addl $0,0(%esp)". This insn therefore
- carries the host's hwcaps so the assembler knows what to
- emit. */
+ /* Mem fence (not just sse2, but sse0 and sse1/mmxext too).
+ In short, an insn which flushes all preceding loads and
+ stores as much as possible before continuing. On SSE2
+ we emit a real "mfence", on SSE1 or the MMXEXT subset
+ "sfence ; lock addl $0,0(%esp)" and on SSE0
+ "lock addl $0,0(%esp)". This insn therefore carries the
+ host's hwcaps so the assembler knows what to emit. */
struct {
UInt hwcaps;
} MFence;
diff --git a/VEX/priv/host_x86_isel.c b/VEX/priv/host_x86_isel.c
index 086aefc..90bc563 100644
--- a/VEX/priv/host_x86_isel.c
+++ b/VEX/priv/host_x86_isel.c
@@ -3251,7 +3251,8 @@ static HReg iselVecExpr_wrk ( ISelEnv* env, IRExpr* e )
{
# define REQUIRE_SSE1 \
- do { if (env->hwcaps == 0/*baseline, no sse*/) \
+ do { if (env->hwcaps == 0/*baseline, no sse*/ \
+ || env->hwcaps == VEX_HWCAPS_X86_MMXEXT /*Integer SSE*/) \
goto vec_fail; \
} while (0)
@@ -4388,7 +4389,8 @@ HInstrArray* iselSB_X86 ( IRSB* bb,
/* sanity ... */
vassert(arch_host == VexArchX86);
vassert(0 == (hwcaps_host
- & ~(VEX_HWCAPS_X86_SSE1
+ & ~(VEX_HWCAPS_X86_MMXEXT
+ | VEX_HWCAPS_X86_SSE1
| VEX_HWCAPS_X86_SSE2
| VEX_HWCAPS_X86_SSE3
| VEX_HWCAPS_X86_LZCNT)));
diff --git a/VEX/priv/main_main.c b/VEX/priv/main_main.c
index e425950..5bb762f 100644
--- a/VEX/priv/main_main.c
+++ b/VEX/priv/main_main.c
@@ -1086,23 +1086,25 @@
static HChar* show_hwcaps_x86 ( UInt hwcaps )
{
- /* Monotonic, SSE3 > SSE2 > SSE1 > baseline. */
+ /* Monotonic, LZCNT > SSE3 > SSE2 > SSE1 > MMXEXT > baseline. */
switch (hwcaps) {
case 0:
return "x86-sse0";
- case VEX_HWCAPS_X86_SSE1:
- return "x86-sse1";
- case VEX_HWCAPS_X86_SSE1 | VEX_HWCAPS_X86_SSE2:
- return "x86-sse1-sse2";
- case VEX_HWCAPS_X86_SSE1 | VEX_HWCAPS_X86_SSE2
+ case VEX_HWCAPS_X86_MMXEXT:
+ return "x86-mmxext";
+ case VEX_HWCAPS_X86_MMXEXT | VEX_HWCAPS_X86_SSE1:
+ return "x86-mmxext-sse1";
+ case VEX_HWCAPS_X86_MMXEXT | VEX_HWCAPS_X86_SSE1 | VEX_HWCAPS_X86_SSE2:
+ return "x86-mmxext-sse1-sse2";
+ case VEX_HWCAPS_X86_MMXEXT | VEX_HWCAPS_X86_SSE1 | VEX_HWCAPS_X86_SSE2
| VEX_HWCAPS_X86_LZCNT:
- return "x86-sse1-sse2-lzcnt";
- case VEX_HWCAPS_X86_SSE1 | VEX_HWCAPS_X86_SSE2
+ return "x86-mmxext-sse1-sse2-lzcnt";
+ case VEX_HWCAPS_X86_MMXEXT | VEX_HWCAPS_X86_SSE1 | VEX_HWCAPS_X86_SSE2
| VEX_HWCAPS_X86_SSE3:
- return "x86-sse1-sse2-sse3";
- case VEX_HWCAPS_X86_SSE1 | VEX_HWCAPS_X86_SSE2
+ return "x86-mmxext-sse1-sse2-sse3";
+ case VEX_HWCAPS_X86_MMXEXT | VEX_HWCAPS_X86_SSE1 | VEX_HWCAPS_X86_SSE2
| VEX_HWCAPS_X86_SSE3 | VEX_HWCAPS_X86_LZCNT:
- return "x86-sse1-sse2-sse3-lzcnt";
+ return "x86-mmxext-sse1-sse2-sse3-lzcnt";
default:
return NULL;
}
diff --git a/VEX/pub/libvex.h b/VEX/pub/libvex.h
index 4b36727..c8b5892 100644
--- a/VEX/pub/libvex.h
+++ b/VEX/pub/libvex.h
@@ -71,11 +71,12 @@ typedef
combinations. */
/* x86: baseline capability is Pentium-1 (FPU, MMX, but no SSE), with
- cmpxchg8b. */
-#define VEX_HWCAPS_X86_SSE1 (1<<1) /* SSE1 support (Pentium III) */
-#define VEX_HWCAPS_X86_SSE2 (1<<2) /* SSE2 support (Pentium 4) */
-#define VEX_HWCAPS_X86_SSE3 (1<<3) /* SSE3 support (>= Prescott) */
-#define VEX_HWCAPS_X86_LZCNT (1<<4) /* SSE4a LZCNT insn */
+ cmpxchg8b. MMXEXT is a special AMD only subset of SSE1 (Integer SSE). */
+#define VEX_HWCAPS_X86_MMXEXT (1<<1) /* A subset of SSE1 on early AMD */
+#define VEX_HWCAPS_X86_SSE1 (1<<2) /* SSE1 support (Pentium III) */
+#define VEX_HWCAPS_X86_SSE2 (1<<3) /* SSE2 support (Pentium 4) */
+#define VEX_HWCAPS_X86_SSE3 (1<<4) /* SSE3 support (>= Prescott) */
+#define VEX_HWCAPS_X86_LZCNT (1<<5) /* SSE4a LZCNT insn */
/* amd64: baseline capability is SSE2, with cmpxchg8b but not
cmpxchg16b. */
commit 4c6f0638553e69b7f70c17a64a8f60114d6f6230
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Tue Aug 27 10:23:23 2013 +0000
Support mmxext (integer sse) subset on i386 (athlon). Bug #323713
Some processors like the AMD Athlon "Classic" support mmxext,
a sse1 subset. This subset is not properly detected by VEX.
The subset uses the same encoding as the sse1 instructions.
The subset is described at:
http://support.amd.com/us/Embedded_TechDocs/22466.pdf
https://en.wikipedia.org/wiki/3DNow!#3DNow.21_extensions
Detects mmxext subset from cpuid information (and enables it
when full sse1 is found). Also fixes the prereq of
none/tests/x86/insn_mmxext.vgtest so that it also runs when
full sse1 (and not just the mmxext subset) is found.
It already passed on such configurations. With the VEX patch
(r2745) it also passes with just the mmxext subset.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13515 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_machine.c b/coregrind/m_machine.c
index 353c05b..2fd5f07 100644
--- a/coregrind/m_machine.c
+++ b/coregrind/m_machine.c
@@ -685,7 +685,7 @@
LibVEX_default_VexArchInfo(&vai);
#if defined(VGA_x86)
- { Bool have_sse1, have_sse2, have_cx8, have_lzcnt;
+ { Bool have_sse1, have_sse2, have_cx8, have_lzcnt, have_mmxext;
UInt eax, ebx, ecx, edx, max_extended;
UChar vstr[13];
vstr[0] = 0;
@@ -722,17 +722,27 @@
if (!have_cx8)
return False;
- /* Figure out if this is an AMD that can do LZCNT. */
+ /* Figure out if this is an AMD that can do mmxext and/or LZCNT. */
+ have_mmxext = False;
have_lzcnt = False;
if (0 == VG_(strcmp)(vstr, "AuthenticAMD")
&& max_extended >= 0x80000001) {
VG_(cpuid)(0x80000001, 0, &eax, &ebx, &ecx, &edx);
have_lzcnt = (ecx & (1<<5)) != 0; /* True => have LZCNT */
+
+ /* Some older AMD processors support a sse1 subset (Integer SSE). */
+ have_mmxext = !have_sse1 && ((edx & (1<<22)) != 0);
}
- if (have_sse2 && have_sse1) {
+ /* Intel processors don't define the mmxext extension, but since it
+ is just a sse1 subset always define it when we have sse1. */
+ if (have_sse1)
+ have_mmxext = True;
+
+ if (have_sse2 && have_sse1 && have_mmxext) {
va = VexArchX86;
- vai.hwcaps = VEX_HWCAPS_X86_SSE1;
+ vai.hwcaps = VEX_HWCAPS_X86_MMXEXT;
+ vai.hwcaps |= VEX_HWCAPS_X86_SSE1;
vai.hwcaps |= VEX_HWCAPS_X86_SSE2;
if (have_lzcnt)
vai.hwcaps |= VEX_HWCAPS_X86_LZCNT;
@@ -740,13 +750,21 @@
return True;
}
- if (have_sse1) {
+ if (have_sse1 && have_mmxext) {
va = VexArchX86;
- vai.hwcaps = VEX_HWCAPS_X86_SSE1;
+ vai.hwcaps = VEX_HWCAPS_X86_MMXEXT;
+ vai.hwcaps |= VEX_HWCAPS_X86_SSE1;
VG_(machine_x86_have_mxcsr) = 1;
return True;
}
+ if (have_mmxext) {
+ va = VexArchX86;
+ vai.hwcaps = VEX_HWCAPS_X86_MMXEXT;
+ VG_(machine_x86_have_mxcsr) = 0;
+ return True;
+ }
+
va = VexArchX86;
vai.hwcaps = 0; /*baseline - no sse at all*/
VG_(machine_x86_have_mxcsr) = 0;
diff --git a/none/tests/x86/insn_mmxext.vgtest b/none/tests/x86/insn_mmxext.vgtest
index ad48b6e..e3627d6 100644
--- a/none/tests/x86/insn_mmxext.vgtest
+++ b/none/tests/x86/insn_mmxext.vgtest
@@ -1,3 +1,4 @@
prog: ../../../none/tests/x86/insn_mmxext
-prereq: ../../../tests/x86_amd64_features x86-mmxext
+# mmxext is an old AMD subset of sse1, so either will do.
+prereq: ../../../tests/x86_amd64_features x86-mmxext || ../../../tests/x86_amd64_features x86-sse
vgopts: -q

View File

@ -1,40 +0,0 @@
commit 6c07dca0af0527226ec9784fbb703526887f09c0
Author: sewardj <sewardj@8f6e269a-dfd6-0310-a8e1-e2731360e62c>
Date: Tue Mar 26 10:27:39 2013 +0000
Implement SSE4 MOVNTDQA insn. Fixes #316503.
(Patrick J. LoPresti, lopresti@gmail.com)
git-svn-id: svn://svn.valgrind.org/vex/trunk@2700 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c
index 1034971..7e98e76 100644
--- a/VEX/priv/guest_amd64_toIR.c
+++ b/VEX/priv/guest_amd64_toIR.c
@@ -16378,6 +16378,25 @@ Long dis_ESC_0F38__SSE4 ( Bool* decode_OK,
}
break;
+ case 0x2A:
+ /* 66 0F 38 2A = MOVNTDQA
+ "non-temporal" "streaming" load
+ Handle like MOVDQA but only memory operand is allowed */
+ if (have66noF2noF3(pfx) && sz == 2) {
+ modrm = getUChar(delta);
+ if (!epartIsReg(modrm)) {
+ addr = disAMode ( &alen, vbi, pfx, delta, dis_buf, 0 );
+ gen_SEGV_if_not_16_aligned( addr );
+ putXMMReg( gregOfRexRM(pfx,modrm),
+ loadLE(Ity_V128, mkexpr(addr)) );
+ DIP("movntdqa %s,%s\n", dis_buf,
+ nameXMMReg(gregOfRexRM(pfx,modrm)));
+ delta += alen;
+ goto decode_success;
+ }
+ }
+ break;
+
case 0x2B:
/* 66 0f 38 2B /r = PACKUSDW xmm1, xmm2/m128
2x 32x4 S->U saturating narrow from xmm2/m128 to xmm1 */

File diff suppressed because it is too large Load Diff

View File

@ -1,38 +0,0 @@
Testcase:
#define _GNU_SOURCE
#include <fcntl.h>
#include <unistd.h>
int
main (void)
{
int dfd = open ("/tmp", O_RDONLY);
int fd1 = openat (dfd, "abc", O_RDONLY);
int fd2 = openat (0x12345678, "/tmp/abc", O_RDONLY);
int fd3 = openat (AT_FDCWD, "abc", O_RDONLY);
/* This is the only one that should warn. */
int fd4 = openat (0x12345678, "abc", O_RDONLY);
return 0;
}
--- valgrind-3.8.1/coregrind/m_syswrap/syswrap-linux.c.jj 2007-12-11 00:18:43.000000000 +0100
+++ valgrind-3.8.1/coregrind/m_syswrap/syswrap-linux.c 2008-03-03 11:35:15.000000000 +0100
@@ -3308,10 +3308,15 @@ PRE(sys_openat)
int, dfd, const char *, filename, int, flags);
}
- if (ARG1 != VKI_AT_FDCWD && !ML_(fd_allowed)(ARG1, "openat", tid, False))
+ PRE_MEM_RASCIIZ( "openat(filename)", ARG2 );
+
+ /* For absolute filenames, dfd is ignored. If dfd is AT_FDCWD,
+ filename is relative to cwd. */
+ if (ML_(safe_to_deref)( (void*)ARG2, 1 )
+ && *(Char *)ARG2 != '/'
+ && ARG1 != VKI_AT_FDCWD
+ && !ML_(fd_allowed)(ARG1, "openat", tid, False))
SET_STATUS_Failure( VKI_EBADF );
- else
- PRE_MEM_RASCIIZ( "openat(filename)", ARG2 );
/* Handle the case where the open is of /proc/self/cmdline or
/proc/<pid>/cmdline, and just give it a copy of the fd for the

View File

@ -1,39 +0,0 @@
--- valgrind/memcheck/tests/filter_memcpy (revision 0)
+++ valgrind/memcheck/tests/filter_memcpy (working copy)
@@ -0,0 +1,5 @@
+#! /bin/sh
+
+# mc_replace_strmem.c intercepts various memcpy glibc versions.
+./filter_stderr "$@" |
+perl -p -e "s/: memcpy\@\@?GLIBC_[.1-9]+ \(mc_replace_strmem.c:...\)/: memcpy \(mc_replace_strmem.c:...\)/"
--- valgrind/memcheck/tests/overlap.vgtest (revision 13010)
+++ valgrind/memcheck/tests/overlap.vgtest (working copy)
@@ -1,2 +1,3 @@
prog: overlap
vgopts: -q
+stderr_filter: filter_memcpy
--- valgrind/memcheck/tests/Makefile.am 2012-09-25 10:02:30.798819187 +0200
+++ valgrind/memcheck/tests/Makefile.am 2012-09-25 10:03:00.358251560 +0200
@@ -44,7 +44,8 @@
filter_leak_cases_possible \
filter_stderr filter_xml \
filter_varinfo3 \
- filter_memcheck
+ filter_memcheck \
+ filter_memcpy
noinst_HEADERS = leak.h
--- valgrind/memcheck/tests/Makefile.in 2012-09-25 10:02:30.797819171 +0200
+++ valgrind/memcheck/tests/Makefile.in 2012-09-25 10:03:28.620664967 +0200
@@ -971,7 +971,8 @@
filter_leak_cases_possible \
filter_stderr filter_xml \
filter_varinfo3 \
- filter_memcheck
+ filter_memcheck \
+ filter_memcpy
noinst_HEADERS = leak.h
EXTRA_DIST = \

View File

@ -1,40 +0,0 @@
From eb8d355b64e72bfdf1c8dd2534b1625d5d0118e0 Mon Sep 17 00:00:00 2001
From: Dodji Seketeli <dodji@seketeli.org>
Date: Thu, 13 Jan 2011 16:04:39 +0100
Subject: [PATCH] Fix crash loading certain binaries on ppc64
Increase the space left for VDSO on ppc64 compiled with 64KB page
size. the size of VDSO is at least 2 pages: one for the code and one
for the data. We ought to leave more than two page space then. The
patch leaves 8 pages space to comply with what is done already for 4KB
page sizes.
---
coregrind/m_ume/elf.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
--- valgrind/coregrind/m_ume/elf.c
+++ valgrind/coregrind/m_ume/elf.c
@@ -327,6 +327,7 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info)
/* The kernel maps position-independent executables at TASK_SIZE*2/3;
duplicate this behavior as close as we can. */
if (e->e.e_type == ET_DYN && ebase == 0) {
+ ESZ(Addr) hacky_load_address;
ebase = VG_PGROUNDDN(info->exe_base
+ (info->exe_end - info->exe_base) * 2 / 3);
/* We really don't want to load PIEs at zero or too close. It
@@ -336,10 +337,11 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info)
nonpointers. So, hackily, move it above 1MB. */
/* Later .. is appears ppc32-linux tries to put [vdso] at 1MB,
which totally screws things up, because nothing else can go
- there. So bump the hacky load addess along by 0x8000, to
- 0x108000. */
- if (ebase < 0x108000)
- ebase = 0x108000;
+ there. The size of [vdso] is around 2 or 3 pages, so bump
+ the hacky load addess along by 8 * VKI_PAGE_SIZE to be safe. */
+ hacky_load_address = 0x100000 + 8 * VKI_PAGE_SIZE;
+ if (ebase < hacky_load_address)
+ ebase = hacky_load_address;
}
info->phnum = e->e.e_phnum;

View File

@ -1,11 +0,0 @@
--- valgrind/valgrind.pc.in (revision 13016)
+++ valgrind/valgrind.pc.in (working copy)
@@ -5,7 +5,7 @@
arch=@VGCONF_ARCH_PRI@
os=@VGCONF_OS@
platform=@VGCONF_ARCH_PRI@-@VGCONF_OS@
-valt_load_address=@VALT_LOAD_ADDRESS@
+valt_load_address=@VALT_LOAD_ADDRESS_PRI@
Name: Valgrind
Description: A dynamic binary instrumentation framework

View File

@ -1,602 +0,0 @@
commit 13b3c5c25500879aad0a682c6cced934def56e53
Author: carll <carll@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Fri Aug 9 21:55:45 2013 +0000
The following instructions were introduced in the Power ISA 2.05
(i.e., POWER6) - lfdp - stfdp - lfdpx - stfdpx These instructions were promptly
deprecated (phased out) in ISA 2.06 (i.e., POWER7). Recent updates in binutils
no longer supports these instructions unless the assembler is invoked with
'-mpower6'. When 'make check' is run on valgrind when using such a newer
binutils and running on a ppc64 system newer than POWER6, you get the
following build error:
y
pc64_linux=1 -DVGPV_ppc64_linux_vanilla=1 -DVGA_SEC_ppc32=1 -DVGP_SEC_ppc64_linux=1 -Winline -Wall -Wshadow -g -Winline -Wall -Wshadow -g -I../../../include -m64 -Wno-long-long -Wwrite-strings -fno-stack-protector -Wno-write-strings -MT power_ISA2_05-power_ISA2_05.o -MD -MP -MF .deps/power_ISA2_05-power_ISA2_05.Tpo -c -o power_ISA2_05-power_ISA2_05.o `test -f 'power_ISA2_05.c' || echo './'`power_ISA2_05.c
/tmp/cciGIkGG.s:Assembler messages:
/tmp/cciGIkGG.s:387: Error: operand out of domain (31 is not a multiple of 4)
/tmp/cciGIkGG.s:387: Error: syntax error; found `,', expected `('
/tmp/cciGIkGG.s:387: Error: junk at end of line: `,9'
/tmp/cciGIkGG.s:478: Error: operand out of domain (31 is not a multiple of 4)
/tmp/cciGIkGG.s:478: Error: syntax error; found `,', expected `('
/tmp/cciGIkGG.s:478: Error: junk at end of line: `,9'
make[2]: *** [power_ISA2_05-power_ISA2_05.o] Error 1
make[2]: Leaving directory `/tmp/Valgrind_review/valgrind_ISA2_05/memcheck/tests/ppc64'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/tmp/Valgrind_review/valgrind_ISA2_05/memcheck/tests/ppc64' make: *** [check-recursive] Error 1
This patch fixes the problem by adding a configure check to determine if these
phased out instructions are supported by the binutils, and the result of that
configure check is used to decide whether or not to compile in the source for
testing these instructions.
Bugzilla 323116
committed by Carl Love, carll@us.ibm.com
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13490 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.in b/configure.in
index 6ac32b0..5cf28a1 100644
--- a/configure.in
+++ b/configure.in
@@ -1771,6 +1771,28 @@ if test x$ac_have_as_ppc_mftocrf = xyes ; then
fi
+# does the ppc assembler support "lfdp" and other phased out floating point insns?
+AC_MSG_CHECKING([if ppc32/64 asm supports phased out floating point instructions])
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ do { typedef struct {
+ double hi;
+ double lo;
+ } dbl_pair_t;
+ dbl_pair_t dbl_pair[3];
+ __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0]));
+ } while (0)
+]])], [
+ac_have_as_ppc_fpPO=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_as_ppc_fpPO=no
+AC_MSG_RESULT([no])
+])
+if test x$ac_have_as_ppc_fpPO = xyes ; then
+ AC_DEFINE(HAVE_AS_PPC_FPPO, 1, [Define to 1 if as supports floating point phased out category.])
+fi
+
CFLAGS=$safe_CFLAGS
# does the x86/amd64 assembler understand SSE3 instructions?
diff --git a/memcheck/tests/ppc32/Makefile.am b/memcheck/tests/ppc32/Makefile.am
index 40033fc..bd70eea 100644
--- a/memcheck/tests/ppc32/Makefile.am
+++ b/memcheck/tests/ppc32/Makefile.am
@@ -4,7 +4,8 @@ include $(top_srcdir)/Makefile.tool-tests.am
dist_noinst_SCRIPTS = filter_stderr
EXTRA_DIST = $(noinst_SCRIPTS) \
- power_ISA2_05.stderr.exp power_ISA2_05.stdout.exp power_ISA2_05.vgtest
+ power_ISA2_05.stderr.exp power_ISA2_05.stdout.exp power_ISA2_05.vgtest \
+ power_ISA2_05.stdout.exp_Without_FPPO
check_PROGRAMS = \
power_ISA2_05
diff --git a/memcheck/tests/ppc32/power_ISA2_05.c b/memcheck/tests/ppc32/power_ISA2_05.c
index 0178452..3736c27 100644
--- a/memcheck/tests/ppc32/power_ISA2_05.c
+++ b/memcheck/tests/ppc32/power_ISA2_05.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <config.h>
double foo = -1.0;
double FRT1;
@@ -65,9 +66,15 @@ void test_lfiwax()
** FPp = leftmost 64 bits stored at DS(RA)
** FPp+1= rightmost 64 bits stored at DS(RA)
** FPp must be an even float register
+**
+** The [st|l]fdp[x] instructions were put into the "Floating-Point.Phased-Out"
+** category in ISA 2.06 (i.e., POWER7 timeframe). If valgrind and its
+** testsuite are built with -mcpu=power7 (or later), then the assembler will
+** not recognize those phased out instructions.
*/
void test_double_pair_instrs()
{
+#ifdef HAVE_AS_PPC_FPPO
typedef struct {
double hi;
double lo;
@@ -122,6 +129,7 @@ void test_double_pair_instrs()
__asm__ volatile ("stfdpx 10, 20, 21");
printf("stfdpx (%f, %f) => F_hi=%f, F_lo=%f\n",
FRT1, FRT2, dbl_pair[2].hi, dbl_pair[2].lo);
+#endif
}
diff --git a/memcheck/tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO b/memcheck/tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO
new file mode 120000
index 0000000..da5c109
--- /dev/null
+++ b/memcheck/tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO
@@ -0,0 +1 @@
+../ppc64/power_ISA2_05.stdout.exp_Without_FPPO
\ No newline at end of file
diff --git a/memcheck/tests/ppc64/Makefile.am b/memcheck/tests/ppc64/Makefile.am
index a18afd7..96eb576 100644
--- a/memcheck/tests/ppc64/Makefile.am
+++ b/memcheck/tests/ppc64/Makefile.am
@@ -4,7 +4,8 @@ include $(top_srcdir)/Makefile.tool-tests.am
dist_noinst_SCRIPTS = filter_stderr
EXTRA_DIST = $(noinst_SCRIPTS) \
- power_ISA2_05.stderr.exp power_ISA2_05.stdout.exp power_ISA2_05.vgtest
+ power_ISA2_05.stderr.exp power_ISA2_05.stdout.exp power_ISA2_05.vgtest \
+ power_ISA2_05.stdout.exp_Without_FPPO
check_PROGRAMS = \
power_ISA2_05
diff --git a/memcheck/tests/ppc64/power_ISA2_05.c b/memcheck/tests/ppc64/power_ISA2_05.c
index 8c0eab9..f552dc4 100644
--- a/memcheck/tests/ppc64/power_ISA2_05.c
+++ b/memcheck/tests/ppc64/power_ISA2_05.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <config.h>
double foo = -1.0;
double FRT1;
@@ -63,9 +64,16 @@ void test_lfiwax()
** FPp = leftmost 64 bits stored at DS(RA)
** FPp+1= rightmost 64 bits stored at DS(RA)
** FPp must be an even float register
+**
+** The [st|l]fdp[x] instructions were put into the "Floating-Point.Phased-Out"
+** category in ISA 2.06 (i.e., POWER7 timeframe). If valgrind and its
+** testsuite are built with -mcpu=power7 (or later), then the assembler will
+** not recognize those phased out instructions.
+**
*/
void test_double_pair_instrs()
{
+#ifdef HAVE_AS_PPC_FPPO
typedef struct {
double hi;
double lo;
@@ -120,6 +128,7 @@ void test_double_pair_instrs()
__asm__ volatile ("stfdpx 10, 20, 21");
printf("stfdpx (%f, %f) => F_hi=%f, F_lo=%f\n",
FRT1, FRT2, dbl_pair[2].hi, dbl_pair[2].lo);
+#endif
}
diff --git a/memcheck/tests/ppc64/power_ISA2_05.stdout.exp_Without_FPPO b/memcheck/tests/ppc64/power_ISA2_05.stdout.exp_Without_FPPO
new file mode 100644
index 0000000..1945526
--- /dev/null
+++ b/memcheck/tests/ppc64/power_ISA2_05.stdout.exp_Without_FPPO
@@ -0,0 +1,119 @@
+lwarx => 0
+ldarx => bad0beef
+fcpsgn sign=10.101010, base=11.111111 => 11.111111
+fcpsgn sign=10.101010, base=-0.000000 => 0.000000
+fcpsgn sign=10.101010, base=0.000000 => 0.000000
+fcpsgn sign=10.101010, base=-11.111111 => 11.111111
+fcpsgn sign=-0.000000, base=11.111111 => -11.111111
+fcpsgn sign=-0.000000, base=-0.000000 => -0.000000
+fcpsgn sign=-0.000000, base=0.000000 => -0.000000
+fcpsgn sign=-0.000000, base=-11.111111 => -11.111111
+fcpsgn sign=0.000000, base=11.111111 => 11.111111
+fcpsgn sign=0.000000, base=-0.000000 => 0.000000
+fcpsgn sign=0.000000, base=0.000000 => 0.000000
+fcpsgn sign=0.000000, base=-11.111111 => 11.111111
+fcpsgn sign=-10.101010, base=11.111111 => -11.111111
+fcpsgn sign=-10.101010, base=-0.000000 => -0.000000
+fcpsgn sign=-10.101010, base=0.000000 => -0.000000
+fcpsgn sign=-10.101010, base=-11.111111 => -11.111111
+lfiwax (-1024.000000) => FRT=(ffffffff, c0900000)
+prtyd (0) => parity=0
+prtyw (0) => parity=0
+prtyd (1) => parity=1
+prtyw (1) => parity=1
+prtyd (2) => parity=0
+prtyw (2) => parity=0
+prtyd (3) => parity=1
+prtyw (3) => parity=1
+prtyd (4) => parity=0
+prtyw (4) => parity=0
+prtyd (5) => parity=1
+prtyw (5) => parity=1
+prtyd (6) => parity=0
+prtyw (6) => parity=0
+prtyd (7) => parity=1
+prtyw (7) => parity=1
+prtyd (8) => parity=0
+prtyw (8) => parity=0
+prtyd (9) => parity=1
+prtyw (9) => parity=1
+prtyd (a) => parity=0
+prtyw (a) => parity=0
+prtyd (b) => parity=1
+prtyw (b) => parity=1
+prtyd (c) => parity=0
+prtyw (c) => parity=0
+prtyd (d) => parity=1
+prtyw (d) => parity=1
+prtyd (e) => parity=0
+prtyw (e) => parity=0
+prtyd (f) => parity=1
+prtyw (f) => parity=1
+prtyd (10) => parity=0
+prtyw (10) => parity=0
+prtyd (11) => parity=1
+prtyw (11) => parity=1
+prtyd (12) => parity=0
+prtyw (12) => parity=0
+prtyd (13) => parity=1
+prtyw (13) => parity=1
+prtyd (14) => parity=0
+prtyw (14) => parity=0
+prtyd (15) => parity=1
+prtyw (15) => parity=1
+prtyd (16) => parity=0
+prtyw (16) => parity=0
+prtyd (17) => parity=1
+prtyw (17) => parity=1
+prtyd (18) => parity=0
+prtyw (18) => parity=0
+prtyd (19) => parity=1
+prtyw (19) => parity=1
+prtyd (1a) => parity=0
+prtyw (1a) => parity=0
+prtyd (1b) => parity=1
+prtyw (1b) => parity=1
+prtyd (1c) => parity=0
+prtyw (1c) => parity=0
+prtyd (1d) => parity=1
+prtyw (1d) => parity=1
+prtyd (1e) => parity=0
+prtyw (1e) => parity=0
+prtyd (1f) => parity=1
+prtyw (1f) => parity=1
+prtyd (20) => parity=0
+prtyw (20) => parity=0
+prtyd (21) => parity=1
+prtyw (21) => parity=1
+prtyd (22) => parity=0
+prtyw (22) => parity=0
+prtyd (23) => parity=1
+prtyw (23) => parity=1
+prtyd (24) => parity=0
+prtyw (24) => parity=0
+prtyd (25) => parity=1
+prtyw (25) => parity=1
+prtyd (26) => parity=0
+prtyw (26) => parity=0
+prtyd (27) => parity=1
+prtyw (27) => parity=1
+prtyd (28) => parity=0
+prtyw (28) => parity=0
+prtyd (29) => parity=1
+prtyw (29) => parity=1
+prtyd (2a) => parity=0
+prtyw (2a) => parity=0
+prtyd (2b) => parity=1
+prtyw (2b) => parity=1
+prtyd (2c) => parity=0
+prtyw (2c) => parity=0
+prtyd (2d) => parity=1
+prtyw (2d) => parity=1
+prtyd (2e) => parity=0
+prtyw (2e) => parity=0
+prtyd (2f) => parity=1
+prtyw (2f) => parity=1
+prtyd (30) => parity=0
+prtyw (30) => parity=0
+prtyd (31) => parity=1
+prtyw (31) => parity=1
diff -ur valgrind-3.8.1.orig/config.h.in valgrind-3.8.1/config.h.in
--- valgrind-3.8.1.orig/config.h.in 2013-08-14 17:58:25.970210332 +0200
+++ valgrind-3.8.1/config.h.in 2013-08-14 17:59:26.000000000 +0200
@@ -81,6 +81,9 @@
/* Define to 1 if you have the <asm/unistd.h> header file. */
#undef HAVE_ASM_UNISTD_H
+/* Define to 1 if as supports floating point phased out category. */
+#undef HAVE_AS_PPC_FPPO
+
/* Define to 1 if as supports mtocrf/mfocrf. */
#undef HAVE_AS_PPC_MFTOCRF
Only in valgrind-3.8.1: config.h.in~
diff -ur valgrind-3.8.1.orig/configure valgrind-3.8.1/configure
--- valgrind-3.8.1.orig/configure 2013-08-14 17:58:25.970210332 +0200
+++ valgrind-3.8.1/configure 2013-08-14 17:59:32.537941678 +0200
@@ -8134,6 +8134,49 @@
fi
+# does the ppc assembler support "lfdp" and other phased out floating point insns?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ppc32/64 asm supports phased out floating point instructions" >&5
+$as_echo_n "checking if ppc32/64 asm supports phased out floating point instructions... " >&6; }
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ do { typedef struct {
+ double hi;
+ double lo;
+ } dbl_pair_t;
+ dbl_pair_t dbl_pair[3];
+ __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0]));
+ } while (0)
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ac_have_as_ppc_fpPO=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ac_have_as_ppc_fpPO=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test x$ac_have_as_ppc_fpPO = xyes ; then
+
+$as_echo "#define HAVE_AS_PPC_FPPO 1" >>confdefs.h
+
+fi
+
CFLAGS=$safe_CFLAGS
# does the x86/amd64 assembler understand SSE3 instructions?
diff -ur valgrind-3.8.1.orig/memcheck/tests/ppc32/Makefile.in valgrind-3.8.1/memcheck/tests/ppc32/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/ppc32/Makefile.in 2013-08-14 17:58:25.794211043 +0200
+++ valgrind-3.8.1/memcheck/tests/ppc32/Makefile.in 2013-08-14 17:59:30.729948971 +0200
@@ -362,7 +362,8 @@
@VGCONF_OS_IS_DARWIN_TRUE@noinst_DSYMS = $(check_PROGRAMS)
dist_noinst_SCRIPTS = filter_stderr
EXTRA_DIST = $(noinst_SCRIPTS) \
- power_ISA2_05.stderr.exp power_ISA2_05.stdout.exp power_ISA2_05.vgtest
+ power_ISA2_05.stderr.exp power_ISA2_05.stdout.exp power_ISA2_05.vgtest \
+ power_ISA2_05.stdout.exp_Without_FPPO
power_ISA2_05_CFLAGS = $(AM_CFLAGS) $(WERROR) -Winline -Wall -Wshadow -g \
-I$(top_srcdir)/include @FLAG_M32@
diff -ur valgrind-3.8.1.orig/memcheck/tests/ppc64/Makefile.in valgrind-3.8.1/memcheck/tests/ppc64/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/ppc64/Makefile.in 2013-08-14 17:58:25.789211063 +0200
+++ valgrind-3.8.1/memcheck/tests/ppc64/Makefile.in 2013-08-14 17:59:30.785948745 +0200
@@ -362,7 +362,8 @@
@VGCONF_OS_IS_DARWIN_TRUE@noinst_DSYMS = $(check_PROGRAMS)
dist_noinst_SCRIPTS = filter_stderr
EXTRA_DIST = $(noinst_SCRIPTS) \
- power_ISA2_05.stderr.exp power_ISA2_05.stdout.exp power_ISA2_05.vgtest
+ power_ISA2_05.stderr.exp power_ISA2_05.stdout.exp power_ISA2_05.vgtest \
+ power_ISA2_05.stdout.exp_Without_FPPO
power_ISA2_05_CFLAGS = $(AM_CFLAGS) $(WERROR) -Winline -Wall -Wshadow -g \
-I$(top_srcdir)/include @FLAG_M64@
commit 5d0d52118210671d3eeff94fd3f5cc3807bd2a44
Author: sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Tue Jan 29 22:14:01 2013 +0000
test_reservation(), test_double_pair_instrs(): Fix broken inline assembly
causing segfaults with gcc-4.7. The inline assembly still isn't right,
but it's better than it was before.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13279 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/ppc32/power_ISA2_05.c b/memcheck/tests/ppc32/power_ISA2_05.c
index a95f427..0178452 100644
--- a/memcheck/tests/ppc32/power_ISA2_05.c
+++ b/memcheck/tests/ppc32/power_ISA2_05.c
@@ -103,8 +103,8 @@ void test_double_pair_instrs()
FRT2 = -1.0;
base = (unsigned long) &dbl_pair;
offset = (unsigned long) &dbl_pair[1] - base;
- __asm__ volatile ("or 20, 0, %0"::"r" (base));
- __asm__ volatile ("or 21, 0, %0"::"r" (offset));
+ __asm__ volatile ("ori 20, %0, 0"::"r" (base));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
__asm__ volatile ("lfdpx 10, 20, 21");
__asm__ volatile ("fmr %0, 10":"=f" (FRT1));
__asm__ volatile ("fmr %0, 11":"=f" (FRT2));
@@ -115,8 +115,8 @@ void test_double_pair_instrs()
FRT2 = -16.1024;
base = (unsigned long) &dbl_pair;
offset = (unsigned long) &dbl_pair[2] - base;
- __asm__ volatile ("or 20, 0, %0"::"r" (base));
- __asm__ volatile ("or 21, 0, %0"::"r" (offset));
+ __asm__ volatile ("ori 20, %0, 0"::"r" (base));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
__asm__ volatile ("fmr %0, 10":"=f" (FRT1));
__asm__ volatile ("fmr %0, 11":"=f" (FRT2));
__asm__ volatile ("stfdpx 10, 20, 21");
@@ -168,14 +168,14 @@ void test_reservation()
base = (unsigned long) &arr;
offset = (unsigned long) &arr[1] - base;
- __asm__ volatile ("or 20, 0, %0"::"r" (base));
- __asm__ volatile ("or 21, 0, %0"::"r" (offset));
+ __asm__ volatile ("ori 20, %0, 0"::"r" (base));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
__asm__ volatile ("lwarx %0, 20, 21, 1":"=r" (RT));
printf("lwarx => %x\n", RT);
#ifdef __powerpc64__
offset = (unsigned long) &arr[1] - base;
- __asm__ volatile ("or 21, 0, %0"::"r" (offset));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
__asm__ volatile ("ldarx %0, 20, 21, 1":"=r" (RT));
printf("ldarx => %x\n", RT);
#endif
diff --git a/memcheck/tests/ppc64/power_ISA2_05.c b/memcheck/tests/ppc64/power_ISA2_05.c
index dcf0e7a..8c0eab9 100644
--- a/memcheck/tests/ppc64/power_ISA2_05.c
+++ b/memcheck/tests/ppc64/power_ISA2_05.c
@@ -101,8 +101,8 @@ void test_double_pair_instrs()
FRT2 = -1.0;
base = (unsigned long) &dbl_pair;
offset = (unsigned long) &dbl_pair[1] - base;
- __asm__ volatile ("or 20, 0, %0"::"r" (base));
- __asm__ volatile ("or 21, 0, %0"::"r" (offset));
+ __asm__ volatile ("ori 20, %0, 0"::"r" (base));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
__asm__ volatile ("lfdpx 10, 20, 21");
__asm__ volatile ("fmr %0, 10":"=f" (FRT1));
__asm__ volatile ("fmr %0, 11":"=f" (FRT2));
@@ -113,8 +113,8 @@ void test_double_pair_instrs()
FRT2 = -16.1024;
base = (unsigned long) &dbl_pair;
offset = (unsigned long) &dbl_pair[2] - base;
- __asm__ volatile ("or 20, 0, %0"::"r" (base));
- __asm__ volatile ("or 21, 0, %0"::"r" (offset));
+ __asm__ volatile ("ori 20, %0, 0"::"r" (base));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
__asm__ volatile ("fmr %0, 10":"=f" (FRT1));
__asm__ volatile ("fmr %0, 11":"=f" (FRT2));
__asm__ volatile ("stfdpx 10, 20, 21");
@@ -166,14 +166,14 @@ void test_reservation()
base = (unsigned long) &arr;
offset = (unsigned long) &arr[1] - base;
- __asm__ volatile ("or 20, 0, %0"::"r" (base));
- __asm__ volatile ("or 21, 0, %0"::"r" (offset));
+ __asm__ volatile ("ori 20, %0, 0"::"r" (base));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
__asm__ volatile ("lwarx %0, 20, 21, 1":"=r" (RT));
printf("lwarx => %x\n", RT);
#ifdef __powerpc64__
offset = (unsigned long) &arr[1] - base;
- __asm__ volatile ("or 21, 0, %0"::"r" (offset));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
__asm__ volatile ("ldarx %0, 20, 21, 1":"=r" (RT));
printf("ldarx => %x\n", RT);
#endif
commit 28b37cc93e8b7a851f005a217752073bb8ac7dca
Author: carll <carll@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Wed Aug 21 19:46:50 2013 +0000
The file tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO was a link
to file tests/ppc64/power_ISA2_05.stdout.exp_Without_FPPO. That was a
commit error as the output for ppc32 and ppc64 are different. Remove
the file and commit to remove the link.
See bugzilla 81535.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13505 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO b/memcheck/tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO
deleted file mode 120000
index da5c109..0000000
--- a/memcheck/tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO
+++ /dev/null
@@ -1 +0,0 @@
-../ppc64/power_ISA2_05.stdout.exp_Without_FPPO
\ No newline at end of file
commit bfde541a949ff59db394b0ce26f370215e94e30a
Author: carll <carll@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Wed Aug 21 19:47:19 2013 +0000
The file tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO was a link
to file tests/ppc64/power_ISA2_05.stdout.exp_Without_FPPO. That was a
commit error as the output for ppc32 and ppc64 are different. Replaced
the link with the correct real file of expected results. See bugzilla
81535.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13506 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO b/memcheck/tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO
new file mode 100644
index 0000000..f9e934e
--- /dev/null
+++ b/memcheck/tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO
@@ -0,0 +1,68 @@
+lwarx => bad0beef
+fcpsgn sign=10.101010, base=11.111111 => 11.111111
+fcpsgn sign=10.101010, base=-0.000000 => 0.000000
+fcpsgn sign=10.101010, base=0.000000 => 0.000000
+fcpsgn sign=10.101010, base=-11.111111 => 11.111111
+fcpsgn sign=-0.000000, base=11.111111 => -11.111111
+fcpsgn sign=-0.000000, base=-0.000000 => -0.000000
+fcpsgn sign=-0.000000, base=0.000000 => -0.000000
+fcpsgn sign=-0.000000, base=-11.111111 => -11.111111
+fcpsgn sign=0.000000, base=11.111111 => 11.111111
+fcpsgn sign=0.000000, base=-0.000000 => 0.000000
+fcpsgn sign=0.000000, base=0.000000 => 0.000000
+fcpsgn sign=0.000000, base=-11.111111 => 11.111111
+fcpsgn sign=-10.101010, base=11.111111 => -11.111111
+fcpsgn sign=-10.101010, base=-0.000000 => -0.000000
+fcpsgn sign=-10.101010, base=0.000000 => -0.000000
+fcpsgn sign=-10.101010, base=-11.111111 => -11.111111
+lfiwax (-1024.000000) => FRT=(ffffffff, c0900000)
+prtyw (0) => parity=0
+prtyw (1) => parity=1
+prtyw (2) => parity=0
+prtyw (3) => parity=1
+prtyw (4) => parity=0
+prtyw (5) => parity=1
+prtyw (6) => parity=0
+prtyw (7) => parity=1
+prtyw (8) => parity=0
+prtyw (9) => parity=1
+prtyw (a) => parity=0
+prtyw (b) => parity=1
+prtyw (c) => parity=0
+prtyw (d) => parity=1
+prtyw (e) => parity=0
+prtyw (f) => parity=1
+prtyw (10) => parity=0
+prtyw (11) => parity=1
+prtyw (12) => parity=0
+prtyw (13) => parity=1
+prtyw (14) => parity=0
+prtyw (15) => parity=1
+prtyw (16) => parity=0
+prtyw (17) => parity=1
+prtyw (18) => parity=0
+prtyw (19) => parity=1
+prtyw (1a) => parity=0
+prtyw (1b) => parity=1
+prtyw (1c) => parity=0
+prtyw (1d) => parity=1
+prtyw (1e) => parity=0
+prtyw (1f) => parity=1
+prtyw (20) => parity=0
+prtyw (21) => parity=1
+prtyw (22) => parity=0
+prtyw (23) => parity=1
+prtyw (24) => parity=0
+prtyw (25) => parity=1
+prtyw (26) => parity=0
+prtyw (27) => parity=1
+prtyw (28) => parity=0
+prtyw (29) => parity=1
+prtyw (2a) => parity=0
+prtyw (2b) => parity=1
+prtyw (2c) => parity=0
+prtyw (2d) => parity=1
+prtyw (2e) => parity=0
+prtyw (2f) => parity=1
+prtyw (30) => parity=0
+prtyw (31) => parity=1

View File

@ -1,260 +0,0 @@
commit 12053bd517d2c5ab55de4ffaa4833ef9a865d8d5
Author: carll <carll@8f6e269a-dfd6-0310-a8e1-e2731360e62c>
Date: Mon Oct 29 20:23:41 2012 +0000
Valgrind, ppc: Fix missing checks for 64-bit instructions operating in 32-bit mode, Bugzilla 308573
A number of the POWER instructions are only intended to run on 64-bit
hardware. These instructions will give a SIGILL instruction on 32-bit
hardware. The check for 32-bit mode on some of these instructions is
missing. Although, the 64-bit hardware will execute these instructions
on 64-bit hardware without generating a SIGILL the use of these
instructions in 32-bit mode on 64-bit hardware is typically indicative of
a programming error. There are cases where these instructions are used
to determine if the code is running on 32-bit hardware or not. In these
cases, the instruction needs to generate a SIGILL for the error handler
to properly determine the hardware is running in 32-bit mode.
This patch adds the 32-bit mode check for those 64-bit instructions that
do not have the check. If the check fails, the instruction is flagged
as an unsupported instruction and a SIGILL message is generated.
This patch fixes the bug reported in:
Bug 308573 - Internal Valgrind error on 64-bit instruction executed in
32-bit mode
Note, there is an accompaning fix to memcheck/tests/ppc32/power_ISA2_05.c
to only execute the 64-bit instruction prtyd test in 64-bit mode.
Carl Love cel@us.ibm.com
git-svn-id: svn://svn.valgrind.org/vex/trunk@2558 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/guest_ppc_toIR.c b/priv/guest_ppc_toIR.c
index 800f8ef..565bfe5 100644
--- a/VEX/priv/guest_ppc_toIR.c
+++ b/VEX/priv/guest_ppc_toIR.c
@@ -16653,6 +16653,7 @@ DisResult disInstr_PPC_WRK (
/* 64bit Integer Rotate Instructions */
case 0x1E: // rldcl, rldcr, rldic, rldicl, rldicr, rldimi
+ if (!mode64) goto decode_failure;
if (dis_int_rot( theInstr )) goto decode_success;
goto decode_failure;
@@ -16687,7 +16688,12 @@ DisResult disInstr_PPC_WRK (
goto decode_failure;
/* Trap Instructions */
- case 0x02: case 0x03: // tdi, twi
+ case 0x02: // tdi
+ if (!mode64) goto decode_failure;
+ if (dis_trapi(theInstr, &dres)) goto decode_success;
+ goto decode_failure;
+
+ case 0x03: // twi
if (dis_trapi(theInstr, &dres)) goto decode_success;
goto decode_failure;
@@ -17288,7 +17294,12 @@ DisResult disInstr_PPC_WRK (
goto decode_failure;
/* 64bit Integer Parity Instructions */
- case 0xba: case 0x9a: // prtyd, prtyw
+ case 0xba: // prtyd
+ if (!mode64) goto decode_failure;
+ if (dis_int_parity( theInstr )) goto decode_success;
+ goto decode_failure;
+
+ case 0x9a: // prtyw
if (dis_int_parity( theInstr )) goto decode_success;
goto decode_failure;
@@ -17333,9 +17344,13 @@ DisResult disInstr_PPC_WRK (
goto decode_failure;
/* Integer Load and Store with Byte Reverse Instructions */
- case 0x316: case 0x216: case 0x396: // lhbrx, lwbrx, sthbrx
- case 0x296: case 0x214: // stwbrx, ldbrx
- case 0x294: // stdbrx
+ case 0x214: case 0x294: // ldbrx, stdbrx
+ if (!mode64) goto decode_failure;
+ if (dis_int_ldst_rev( theInstr )) goto decode_success;
+ goto decode_failure;
+
+ case 0x216: case 0x316: case 0x296: // lwbrx, lhbrx, stwbrx
+ case 0x396: // sthbrx
if (dis_int_ldst_rev( theInstr )) goto decode_success;
goto decode_failure;
@@ -17385,7 +17400,12 @@ DisResult disInstr_PPC_WRK (
//zz goto decode_failure;
/* Trap Instructions */
- case 0x004: case 0x044: // tw, td
+ case 0x004: // tw
+ if (dis_trap(theInstr, &dres)) goto decode_success;
+ goto decode_failure;
+
+ case 0x044: // td
+ if (!mode64) goto decode_failure;
if (dis_trap(theInstr, &dres)) goto decode_success;
goto decode_failure;
@@ -17479,6 +17499,7 @@ DisResult disInstr_PPC_WRK (
goto decode_failure;
case 0x0FC: // bpermd
+ if (!mode64) goto decode_failure;
if (dis_int_logic( theInstr )) goto decode_success;
goto decode_failure;
commit 1fe353c602722e727fe4497037d2b9c1d646b9b7
Author: carll <carll@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Mon Oct 29 20:39:18 2012 +0000
Valgrind, ppc: Fix test for 32-bit testsuite.
The 32-bit testsuite executes the 64-bit class instruction prtyd. This
instruction should not be tested in 32-bit mode. The change also updates
the expected output for the test. Note, 32-bit HW will generate a SIGILL
when the prtyd instruction is executed. However, the 64-bit HW executing
a 32-bit application does execute the instruction but only the lower 32-bits
of the result are valid. In general, the 64-bit class instructions should
not be executed in 32-bit binaries.
This fix accompanies the VEX fix in revision 2558 to add the 64-bit mode test
to make sure the 64-bit class instructions are only executed in 64-bit mode.
The VEX bugzilla is:
Bug 308573 - Internal Valgrind error on 64-bit instruction executed in
32-bit mode
Carl Love cel@us.ibm.com
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13091 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/ppc32/power_ISA2_05.c b/memcheck/tests/ppc32/power_ISA2_05.c
index f85b547..0cc60f6 100644
--- a/memcheck/tests/ppc32/power_ISA2_05.c
+++ b/memcheck/tests/ppc32/power_ISA2_05.c
@@ -29,9 +29,11 @@ void test_parity_instrs()
for (i = 0; i < 50; i++) {
word = base256(i);
+#ifdef __powerpc64__
long_word = word;
__asm__ volatile ("prtyd %0, %1":"=r" (parity):"r"(long_word));
printf("prtyd (%x) => parity=%x\n", i, parity);
+#endif
__asm__ volatile ("prtyw %0, %1":"=r" (parity):"r"(word));
printf("prtyw (%x) => parity=%x\n", i, parity);
}
diff --git a/memcheck/tests/ppc32/power_ISA2_05.stdout.exp b/memcheck/tests/ppc32/power_ISA2_05.stdout.exp
index 5513960..e4975fb 100644
--- a/memcheck/tests/ppc32/power_ISA2_05.stdout.exp
+++ b/memcheck/tests/ppc32/power_ISA2_05.stdout.exp
@@ -20,103 +20,53 @@ stfdp (2.204800, -4.102400) => F_hi=2.204800, F_lo=-4.102400
lfdpx (2.204800, -4.102400) => F_hi=2.204800, F_lo=-4.102400
stfdpx (2.204800, 2.204800) => F_hi=2.204800, F_lo=2.204800
lfiwax (-1024.000000) => FRT=(ffffffff, c0900000)
-prtyd (0) => parity=0
prtyw (0) => parity=0
-prtyd (1) => parity=1
prtyw (1) => parity=1
-prtyd (2) => parity=0
prtyw (2) => parity=0
-prtyd (3) => parity=1
prtyw (3) => parity=1
-prtyd (4) => parity=0
prtyw (4) => parity=0
-prtyd (5) => parity=1
prtyw (5) => parity=1
-prtyd (6) => parity=0
prtyw (6) => parity=0
-prtyd (7) => parity=1
prtyw (7) => parity=1
-prtyd (8) => parity=0
prtyw (8) => parity=0
-prtyd (9) => parity=1
prtyw (9) => parity=1
-prtyd (a) => parity=0
prtyw (a) => parity=0
-prtyd (b) => parity=1
prtyw (b) => parity=1
-prtyd (c) => parity=0
prtyw (c) => parity=0
-prtyd (d) => parity=1
prtyw (d) => parity=1
-prtyd (e) => parity=0
prtyw (e) => parity=0
-prtyd (f) => parity=1
prtyw (f) => parity=1
-prtyd (10) => parity=0
prtyw (10) => parity=0
-prtyd (11) => parity=1
prtyw (11) => parity=1
-prtyd (12) => parity=0
prtyw (12) => parity=0
-prtyd (13) => parity=1
prtyw (13) => parity=1
-prtyd (14) => parity=0
prtyw (14) => parity=0
-prtyd (15) => parity=1
prtyw (15) => parity=1
-prtyd (16) => parity=0
prtyw (16) => parity=0
-prtyd (17) => parity=1
prtyw (17) => parity=1
-prtyd (18) => parity=0
prtyw (18) => parity=0
-prtyd (19) => parity=1
prtyw (19) => parity=1
-prtyd (1a) => parity=0
prtyw (1a) => parity=0
-prtyd (1b) => parity=1
prtyw (1b) => parity=1
-prtyd (1c) => parity=0
prtyw (1c) => parity=0
-prtyd (1d) => parity=1
prtyw (1d) => parity=1
-prtyd (1e) => parity=0
prtyw (1e) => parity=0
-prtyd (1f) => parity=1
prtyw (1f) => parity=1
-prtyd (20) => parity=0
prtyw (20) => parity=0
-prtyd (21) => parity=1
prtyw (21) => parity=1
-prtyd (22) => parity=0
prtyw (22) => parity=0
-prtyd (23) => parity=1
prtyw (23) => parity=1
-prtyd (24) => parity=0
prtyw (24) => parity=0
-prtyd (25) => parity=1
prtyw (25) => parity=1
-prtyd (26) => parity=0
prtyw (26) => parity=0
-prtyd (27) => parity=1
prtyw (27) => parity=1
-prtyd (28) => parity=0
prtyw (28) => parity=0
-prtyd (29) => parity=1
prtyw (29) => parity=1
-prtyd (2a) => parity=0
prtyw (2a) => parity=0
-prtyd (2b) => parity=1
prtyw (2b) => parity=1
-prtyd (2c) => parity=0
prtyw (2c) => parity=0
-prtyd (2d) => parity=1
prtyw (2d) => parity=1
-prtyd (2e) => parity=0
prtyw (2e) => parity=0
-prtyd (2f) => parity=1
prtyw (2f) => parity=1
-prtyd (30) => parity=0
prtyw (30) => parity=0
-prtyd (31) => parity=1
prtyw (31) => parity=1

View File

@ -1,43 +0,0 @@
commit 2f456f6524ad5edb7af6bdff8d2766738f3c76cc
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Fri Jul 5 09:50:26 2013 +0000
Bug 321969. Support [lf]setxattr on ppc32 and ppc64 linux kernel.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13449 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
index c866fae..cf714cb 100644
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
@@ -1130,9 +1130,9 @@ static SyscallTableEntry syscall_table[] = {
GENXY(__NR_mincore, sys_mincore), // 206
LINX_(__NR_gettid, sys_gettid), // 207
//.. LINX_(__NR_tkill, sys_tkill), // 208 */Linux
-//.. LINX_(__NR_setxattr, sys_setxattr), // 209
-//.. LINX_(__NR_lsetxattr, sys_lsetxattr), // 210
-//.. LINX_(__NR_fsetxattr, sys_fsetxattr), // 211
+ LINX_(__NR_setxattr, sys_setxattr), // 209
+ LINX_(__NR_lsetxattr, sys_lsetxattr), // 210
+ LINX_(__NR_fsetxattr, sys_fsetxattr), // 211
LINXY(__NR_getxattr, sys_getxattr), // 212
LINXY(__NR_lgetxattr, sys_lgetxattr), // 213
LINXY(__NR_fgetxattr, sys_fgetxattr), // 214
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
index d3a5b0f..7310b2a 100644
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
@@ -927,10 +927,10 @@ static SyscallTableEntry syscall_table[] = {
// _____(__NR_mincore, sys_mincore), // 206
LINX_(__NR_gettid, sys_gettid), // 207
// _____(__NR_tkill, sys_tkill), // 208
-// _____(__NR_setxattr, sys_setxattr), // 209
+ LINX_(__NR_setxattr, sys_setxattr), // 209
-// _____(__NR_lsetxattr, sys_lsetxattr), // 210
-// _____(__NR_fsetxattr, sys_fsetxattr), // 211
+ LINX_(__NR_lsetxattr, sys_lsetxattr), // 210
+ LINX_(__NR_fsetxattr, sys_fsetxattr), // 211
LINXY(__NR_getxattr, sys_getxattr), // 212
LINXY(__NR_lgetxattr, sys_lgetxattr), // 213
LINXY(__NR_fgetxattr, sys_fgetxattr), // 214

View File

@ -1,321 +0,0 @@
Index: valgrind/coregrind/m_clientstate.c
===================================================================
--- valgrind/coregrind/m_clientstate.c (revision 13015)
+++ valgrind/coregrind/m_clientstate.c (working copy)
@@ -64,6 +64,9 @@
/* A fd which refers to the fake /proc/<pid>/cmdline in /tmp. */
Int VG_(cl_cmdline_fd) = -1;
+/* A fd which refers to the fake /proc/<pid>/auxv in /tmp. */
+Int VG_(cl_auxv_fd) = -1;
+
// Command line pieces, after they have been extracted from argv in
// m_main.main(). The payload vectors are allocated in VG_AR_TOOL
// (the default arena). They are never freed.
Index: valgrind/coregrind/m_main.c
===================================================================
--- valgrind/coregrind/m_main.c (revision 13015)
+++ valgrind/coregrind/m_main.c (working copy)
@@ -1871,14 +1871,17 @@
setup_file_descriptors();
//--------------------------------------------------------------
- // create the fake /proc/<pid>/cmdline file and then unlink it,
- // but hold onto the fd, so we can hand it out to the client
- // when it tries to open /proc/<pid>/cmdline for itself.
+ // create fake /proc/<pid>/cmdline and /proc/<pid>/auxv files
+ // and then unlink them, but hold onto the fds, so we can handr
+ // them out to the client when it tries to open
+ // /proc/<pid>/cmdline or /proc/<pid>/auxv for itself.
// p: setup file descriptors
+ // p: ii_create_image for VG_(client_auxv) setup.
//--------------------------------------------------------------
#if !defined(VGO_linux)
// client shouldn't be using /proc!
VG_(cl_cmdline_fd) = -1;
+ VG_(cl_auxv_fd) = -1;
#else
if (!need_help) {
HChar buf[50], buf2[50+64];
@@ -1915,6 +1918,34 @@
VG_(err_config_error)("Can't delete client cmdline file in %s\n", buf2);
VG_(cl_cmdline_fd) = fd;
+
+ VG_(debugLog)(1, "main", "Create fake /proc/<pid>/auxv\n");
+
+ VG_(sprintf)(buf, "proc_%d_auxv", VG_(getpid)());
+ fd = VG_(mkstemp)( buf, buf2 );
+ if (fd == -1)
+ VG_(err_config_error)("Can't create client auxv file in %s\n", buf2);
+
+ UWord *client_auxv = VG_(client_auxv);
+ unsigned int client_auxv_len = 0;
+ while (*client_auxv != 0) {
+ client_auxv++;
+ client_auxv++;
+ client_auxv_len += 2 * sizeof(UWord);
+ }
+ client_auxv_len += 2 * sizeof(UWord);
+
+ VG_(write)(fd, VG_(client_auxv), client_auxv_len);
+
+ /* Don't bother to seek the file back to the start; instead do
+ it every time a copy of it is given out (by PRE(sys_open)).
+ That is probably more robust across fork() etc. */
+
+ /* Now delete it, but hang on to the fd. */
+ r = VG_(unlink)( buf2 );
+ if (r)
+ VG_(err_config_error)("Can't delete client cmdline file in %s\n", buf2);
+ VG_(cl_auxv_fd) = fd;
}
#endif
Index: valgrind/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- valgrind/coregrind/m_syswrap/syswrap-generic.c (revision 13015)
+++ valgrind/coregrind/m_syswrap/syswrap-generic.c (working copy)
@@ -3633,6 +3633,31 @@
return;
}
}
+
+ /* Handle the case where the open is of /proc/self/auxv or
+ /proc/<pid>/auxv, and just give it a copy of the fd for the
+ fake file we cooked up at startup (in m_main). Also, seek the
+ cloned fd back to the start. */
+ {
+ HChar name[30];
+ Char* arg1s = (Char*) ARG1;
+ SysRes sres;
+
+ VG_(sprintf)(name, "/proc/%d/auxv", VG_(getpid)());
+ if (ML_(safe_to_deref)( arg1s, 1 ) &&
+ (VG_STREQ(arg1s, name) || VG_STREQ(arg1s, "/proc/self/auxv"))
+ )
+ {
+ sres = VG_(dup)( VG_(cl_auxv_fd) );
+ SET_STATUS_from_SysRes( sres );
+ if (!sr_isError(sres)) {
+ OffT off = VG_(lseek)( sr_Res(sres), 0, VKI_SEEK_SET );
+ if (off < 0)
+ SET_STATUS_Failure( VKI_EMFILE );
+ }
+ return;
+ }
+ }
#endif // defined(VGO_linux)
/* Otherwise handle normally */
Index: valgrind/coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- valgrind/coregrind/m_syswrap/syswrap-linux.c (revision 13015)
+++ valgrind/coregrind/m_syswrap/syswrap-linux.c (working copy)
@@ -3332,6 +3332,22 @@
return;
}
+ /* Do the same for /proc/self/auxv or /proc/<pid>/auxv case. */
+
+ VG_(sprintf)(name, "/proc/%d/auxv", VG_(getpid)());
+ if (ML_(safe_to_deref)( (void*)ARG2, 1 )
+ && (VG_(strcmp)((Char *)ARG2, name) == 0
+ || VG_(strcmp)((Char *)ARG2, "/proc/self/auxv") == 0)) {
+ sres = VG_(dup)( VG_(cl_auxv_fd) );
+ SET_STATUS_from_SysRes( sres );
+ if (!sr_isError(sres)) {
+ OffT off = VG_(lseek)( sr_Res(sres), 0, VKI_SEEK_SET );
+ if (off < 0)
+ SET_STATUS_Failure( VKI_EMFILE );
+ }
+ return;
+ }
+
/* Otherwise handle normally */
*flags |= SfMayBlock;
}
Index: valgrind/coregrind/pub_core_clientstate.h
===================================================================
--- valgrind/coregrind/pub_core_clientstate.h (revision 13015)
+++ valgrind/coregrind/pub_core_clientstate.h (working copy)
@@ -67,6 +67,9 @@
the file contents alive exactly until the process exits. */
extern Int VG_(cl_cmdline_fd);
+/* Same as above, but for /proc/<pid>/auxv. */
+extern Int VG_(cl_auxv_fd);
+
// Client's original rlimit data and rlimit stack
extern struct vki_rlimit VG_(client_rlimit_data);
extern struct vki_rlimit VG_(client_rlimit_stack);
Index: valgrind/memcheck/tests/linux/Makefile.am
===================================================================
--- valgrind/memcheck/tests/linux/Makefile.am (revision 13015)
+++ valgrind/memcheck/tests/linux/Makefile.am (working copy)
@@ -15,7 +15,8 @@
syscalls-2007.vgtest syscalls-2007.stderr.exp \
syslog-syscall.vgtest syslog-syscall.stderr.exp \
timerfd-syscall.vgtest timerfd-syscall.stderr.exp \
- with-space.stderr.exp with-space.stdout.exp with-space.vgtest
+ with-space.stderr.exp with-space.stdout.exp with-space.vgtest \
+ proc-auxv.vgtest proc-auxv.stderr.exp
check_PROGRAMS = \
brk \
@@ -27,7 +28,8 @@
stack_switch \
syscalls-2007 \
syslog-syscall \
- timerfd-syscall
+ timerfd-syscall \
+ proc-auxv
AM_CFLAGS += $(AM_FLAG_M3264_PRI)
Index: memcheck/tests/linux/proc-auxv.c
===================================================================
--- valgrind/memcheck/tests/linux/proc-auxv.c (revision 0)
+++ valgrind/memcheck/tests/linux/proc-auxv.c (working copy)
@@ -0,0 +1,62 @@
+#include <elf.h>
+#include <link.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+int
+main (int argc, char **argv, char **envp)
+{
+ ElfW(auxv_t) auxv;
+ ElfW(auxv_t) *auxv_p;
+
+ void *entry0 = NULL;
+ void *entry1 = NULL;
+
+ char *platform0 = NULL;
+ char *platform1 = NULL;
+
+ // First try the "traditional" way.
+ while (*envp++ != NULL)
+ ; /* Skip, skip, skip... and after finding a NULL we have the auxv. */
+
+ for (auxv_p = (ElfW(auxv_t) *) envp;
+ auxv_p->a_type != AT_NULL;
+ auxv_p++)
+ {
+ if (auxv_p->a_type == AT_ENTRY)
+ entry0 = (void *) auxv_p->a_un.a_val;
+ if (auxv_p->a_type == AT_PLATFORM)
+ platform0 = strdup((char *) auxv_p->a_un.a_val);
+ }
+
+ // Now the /proc way as often used in libraries.
+ int fd = open("/proc/self/auxv", O_RDONLY);
+ if (fd == -1)
+ return -1;
+
+ while (read(fd, &auxv, sizeof(auxv)) == sizeof(auxv))
+ {
+ if (auxv.a_type == AT_ENTRY)
+ entry1 = (void *) auxv.a_un.a_val;
+ if (auxv.a_type == AT_PLATFORM)
+ platform1 = strdup((char *) auxv.a_un.a_val);
+ }
+ close(fd);
+
+ if (entry0 == entry1 && entry0 != NULL)
+ fprintf(stderr, "entries OK\n");
+
+ if (strcmp (platform0, platform1) == 0)
+ fprintf(stderr, "platform OK\n");
+
+ free (platform0);
+ free (platform1);
+
+ return 0;
+}
Index: valgrind/memcheck/tests/linux/proc-auxv.stderr.exp
===================================================================
--- valgrind/memcheck/tests/linux/proc-auxv.stderr.exp (revision 0)
+++ valgrind/memcheck/tests/linux/proc-auxv.stderr.exp (working copy)
@@ -0,0 +1,2 @@
+entries OK
+platform OK
Index: valgrind/memcheck/tests/linux/proc-auxv.vgtest
===================================================================
--- valgrind/memcheck/tests/linux/proc-auxv.vgtest (revision 0)
+++ valgrind/memcheck/tests/linux/proc-auxv.vgtest (working copy)
@@ -0,0 +1,2 @@
+prog: proc-auxv
+vgopts: -q
--- valgrind-3.8.1.orig/memcheck/tests/linux/Makefile.in 2012-09-18 21:19:20.000000000 +0200
+++ valgrind-3.8.1/memcheck/tests/linux/Makefile.in 2012-10-03 19:18:09.543945571 +0200
@@ -57,7 +57,8 @@
check_PROGRAMS = brk$(EXEEXT) capget$(EXEEXT) lsframe1$(EXEEXT) \
lsframe2$(EXEEXT) sigqueue$(EXEEXT) stack_changes$(EXEEXT) \
stack_switch$(EXEEXT) syscalls-2007$(EXEEXT) \
- syslog-syscall$(EXEEXT) timerfd-syscall$(EXEEXT)
+ syslog-syscall$(EXEEXT) timerfd-syscall$(EXEEXT) \
+ proc-auxv$(EXEEXT)
subdir = memcheck/tests/linux
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
@@ -79,6 +80,9 @@
lsframe2_SOURCES = lsframe2.c
lsframe2_OBJECTS = lsframe2.$(OBJEXT)
lsframe2_LDADD = $(LDADD)
+proc_auxv_SOURCES = proc-auxv.c
+proc_auxv_OBJECTS = proc-auxv.$(OBJEXT)
+proc_auxv_LDADD = $(LDADD)
sigqueue_SOURCES = sigqueue.c
sigqueue_OBJECTS = sigqueue.$(OBJEXT)
sigqueue_LDADD = $(LDADD)
@@ -106,11 +110,11 @@
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = brk.c capget.c lsframe1.c lsframe2.c sigqueue.c \
+SOURCES = brk.c capget.c lsframe1.c lsframe2.c proc-auxv.c sigqueue.c \
stack_changes.c stack_switch.c syscalls-2007.c \
syslog-syscall.c timerfd-syscall.c
-DIST_SOURCES = brk.c capget.c lsframe1.c lsframe2.c sigqueue.c \
- stack_changes.c stack_switch.c syscalls-2007.c \
+DIST_SOURCES = brk.c capget.c lsframe1.c lsframe2.c proc-auxv.c \
+ sigqueue.c stack_changes.c stack_switch.c syscalls-2007.c \
syslog-syscall.c timerfd-syscall.c
ETAGS = etags
CTAGS = ctags
@@ -404,7 +408,8 @@
syscalls-2007.vgtest syscalls-2007.stderr.exp \
syslog-syscall.vgtest syslog-syscall.stderr.exp \
timerfd-syscall.vgtest timerfd-syscall.stderr.exp \
- with-space.stderr.exp with-space.stdout.exp with-space.vgtest
+ with-space.stderr.exp with-space.stdout.exp with-space.vgtest \
+ proc-auxv.vgtest proc-auxv.stderr.exp
stack_switch_LDADD = -lpthread
timerfd_syscall_LDADD = -lrt
@@ -457,6 +462,9 @@
lsframe2$(EXEEXT): $(lsframe2_OBJECTS) $(lsframe2_DEPENDENCIES)
@rm -f lsframe2$(EXEEXT)
$(LINK) $(lsframe2_OBJECTS) $(lsframe2_LDADD) $(LIBS)
+proc-auxv$(EXEEXT): $(proc_auxv_OBJECTS) $(proc_auxv_DEPENDENCIES)
+ @rm -f proc-auxv$(EXEEXT)
+ $(LINK) $(proc_auxv_OBJECTS) $(proc_auxv_LDADD) $(LIBS)
sigqueue$(EXEEXT): $(sigqueue_OBJECTS) $(sigqueue_DEPENDENCIES)
@rm -f sigqueue$(EXEEXT)
$(LINK) $(sigqueue_OBJECTS) $(sigqueue_LDADD) $(LIBS)
@@ -486,6 +494,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capget.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsframe1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsframe2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc-auxv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigqueue.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack_changes.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack_switch.Po@am__quote@

View File

@ -1,187 +0,0 @@
commit e40952a7bbfa5ddbd5c4dc00392363a7069d3c15
Author: philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Thu Jul 25 20:40:17 2013 +0000
do not include linux/ptrace.h in vgdb.c
Include of linux/ptrace.h was added in revision r11740,
to avoid compilation error on s390x (fedora and suse).
The compilation error was retrieved thanks to archeological research
done by Christian Borntraeger: without this include, the following was given:
error: 'PT_ENDREGS' undeclared
There was also some errors on ppc64 around the same time:
error: 'PTRACE_GETREGS' undeclared
Currently, the inclusion of linux/ptrace.h gives a problem on amd64/fedora20:
/usr/include/linux/ptrace.h:58:8: error: redefinition of struct ptrace_peeksiginfo_args
/usr/include/sys/ptrace.h:191:8: note: originally defined here
According to man ptrace, it is good enough to include sys/ptrace.h
(which should avoid the problem on amd64/f20).
The linux/ptrace.h is deemed not necessary anymore as:
1. Christian has tested on sles11sp2 on s390x.
2. since linux/ptrace.h was added in vgdb.c, #ifdef PT_ENDREGS and
#ifdef PTRACE_GETREGS were added
=> remove the linux/ptrace.h
(tested on x86/f12, ppc64/f18, amd64/deb6, sles11sp2/s390x)
Thanks to Christian for the investigations
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13471 a5019735-40e9-0310-863c-91ae7b9d1cf9
commit f03cccfa732b9890860ba7fb743c5f0938515ab9
Author: philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Sat Aug 3 20:34:58 2013 +0000
Update configure machinery to detect PTRACE_GETREGS
Using #ifdef PTRACE_GETREGS gives difficulties as in some
platforms (e.g. mips) PTRACE_GETREGS is not defined as a
preprocessor symbols unless linux/ptrace.h is included.
However, including linux/ptrace.h causes compilation error on some
other platforms
=> better detect that PTRACE_GETREGS can be used using the
configure machinery.
This should make vgdb PTRACE_GETREGS working again on
various platforms (x86/amd64/mips/...) as PTRACE_GETREGS
was disabled on all of these following r13471
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13482 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff -ur valgrind-3.8.1.orig/config.h.in valgrind-3.8.1/config.h.in
--- valgrind-3.8.1.orig/config.h.in 2013-08-08 13:32:08.086267278 +0200
+++ valgrind-3.8.1/config.h.in 2013-08-08 13:49:16.000000000 +0200
@@ -207,6 +207,9 @@
/* Define to 1 if you have the `pthread_yield' function. */
#undef HAVE_PTHREAD_YIELD
+/* Define to 1 if you have the `PTRACE_GETREGS' ptrace request. */
+#undef HAVE_PTRACE_GETREGS
+
/* Define to 1 if you have the `readlinkat' function. */
#undef HAVE_READLINKAT
diff -ur valgrind-3.8.1.orig/configure valgrind-3.8.1/configure
--- valgrind-3.8.1.orig/configure 2013-08-08 13:32:08.122267596 +0200
+++ valgrind-3.8.1/configure 2013-08-08 13:49:21.697522489 +0200
@@ -6731,6 +6731,45 @@
# Checking for various library functions and other definitions
#----------------------------------------------------------------------------
+# Check for PTRACE_GETREGS
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTRACE_GETREGS" >&5
+$as_echo_n "checking for PTRACE_GETREGS... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stddef.h>
+#include <sys/ptrace.h>
+#include <sys/user.h>
+
+int
+main ()
+{
+
+ void *p;
+ long res = ptrace (PTRACE_GETREGS, 0, p, p);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PTRACE_GETREGS 1" >>confdefs.h
+
+
+else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
# Check for CLOCK_MONOTONIC
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLOCK_MONOTONIC" >&5
diff -ur valgrind-3.8.1.orig/configure.in valgrind-3.8.1/configure.in
--- valgrind-3.8.1.orig/configure.in 2013-08-08 13:32:08.086267278 +0200
+++ valgrind-3.8.1/configure.in 2013-08-08 13:32:29.283455153 +0200
@@ -1004,6 +1004,25 @@
# Checking for various library functions and other definitions
#----------------------------------------------------------------------------
+# Check for PTRACE_GETREGS
+
+AC_MSG_CHECKING([for PTRACE_GETREGS])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stddef.h>
+#include <sys/ptrace.h>
+#include <sys/user.h>
+]], [[
+ void *p;
+ long res = ptrace (PTRACE_GETREGS, 0, p, p);
+]])], [
+AC_MSG_RESULT([yes])
+AC_DEFINE([HAVE_PTRACE_GETREGS], 1,
+ [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.])
+], [
+AC_MSG_RESULT([no])
+])
+
+
# Check for CLOCK_MONOTONIC
AC_MSG_CHECKING([for CLOCK_MONOTONIC])
diff -ur valgrind-3.8.1.orig/coregrind/vgdb.c valgrind-3.8.1/coregrind/vgdb.c
--- valgrind-3.8.1.orig/coregrind/vgdb.c 2013-08-08 13:32:08.080267224 +0200
+++ valgrind-3.8.1/coregrind/vgdb.c 2013-08-08 13:34:39.247611009 +0200
@@ -102,7 +102,6 @@
#include <sys/user.h>
#if defined(VGO_linux)
# include <sys/prctl.h>
-# include <linux/ptrace.h>
#endif
#endif
@@ -696,7 +695,7 @@
// runtime check not yet done.
// 0 : PTRACE_GETREGS runtime check has failed.
// 1 : PTRACE_GETREGS defined and runtime check ok.
-#ifdef PTRACE_GETREGS
+#ifdef HAVE_PTRACE_GETREGS
static int has_working_ptrace_getregs = -1;
#endif
@@ -707,7 +706,7 @@
Bool getregs (int pid, void *regs, long regs_bsz)
{
DEBUG(1, "getregs regs_bsz %ld\n", regs_bsz);
-# ifdef PTRACE_GETREGS
+# ifdef HAVE_PTRACE_GETREGS
if (has_working_ptrace_getregs) {
// Platforms having GETREGS
long res;
@@ -778,7 +777,7 @@
DEBUG(1, "setregs regs_bsz %ld\n", regs_bsz);
// Note : the below is checking for GETREGS, not SETREGS
// as if one is defined and working, the other one should also work.
-# ifdef PTRACE_GETREGS
+# ifdef HAVE_PTRACE_GETREGS
if (has_working_ptrace_getregs) {
// Platforms having SETREGS
long res;

View File

@ -1,481 +0,0 @@
commit 7be84ee45ccc827a63353868558bed6c824b4a68
Author: cborntra <cborntra@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Thu Nov 8 19:42:00 2012 +0000
Add ptrace getreset testcase from Andreas Arnez
arnez AT linux DOT vnet DOT ibm DOT com
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13110 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/linux/getregset.c b/memcheck/tests/linux/getregset.c
new file mode 100644
index 0000000..70b5ce2
--- /dev/null
+++ b/memcheck/tests/linux/getregset.c
@@ -0,0 +1,76 @@
+/* -*- mode: C; c-basic-offset: 3; -*- */
+
+#include <assert.h>
+#include <elf.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/ptrace.h>
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <sys/user.h>
+#include <sys/wait.h>
+
+static int
+err_out(const char *msg)
+{
+ perror(msg);
+ return 1;
+}
+
+static int
+non_empty(const char *buf, size_t len)
+{
+ size_t i;
+ int c;
+ volatile const char *p = buf;
+
+ for (i = 0; i != len; i++)
+ c |= p[i];
+ return c;
+}
+
+static int
+do_child(void)
+{
+ if (ptrace(PTRACE_TRACEME, 0, NULL, NULL) == -1)
+ return err_out("ptrace traceme");
+ raise(SIGUSR1);
+ return 0;
+}
+
+int
+main(void)
+{
+ char buf[1024];
+ struct iovec iov;
+ pid_t cpid, pid;
+ int status;
+
+ cpid = fork();
+ if (cpid == -1)
+ return err_out("fork");
+ if (cpid == 0)
+ return do_child();
+
+ pid = wait(&status);
+ if (pid == -1)
+ return err_out("wait");
+
+ /* Intentionally provide an uninitialized buffer to ptrace. */
+ iov.iov_len = sizeof(buf);
+ iov.iov_base = buf;
+ if (ptrace(0x4204, cpid, NT_PRSTATUS, &iov) == -1)
+ return err_out("ptrace getregset");
+
+ assert(iov.iov_base == buf);
+ assert(iov.iov_len > 0 && iov.iov_len < sizeof(buf));
+
+ /* We're assuming here that NT_PRSTATUS never contains
+ all-zeros. */
+ assert(non_empty(buf, iov.iov_len));
+ puts("OK");
+ return 0;
+}
diff --git a/memcheck/tests/linux/getregset.stderr.exp b/memcheck/tests/linux/getregset.stderr.exp
new file mode 100644
index 0000000..e69de29
diff --git a/memcheck/tests/linux/getregset.stdout.exp b/memcheck/tests/linux/getregset.stdout.exp
new file mode 100644
index 0000000..d86bac9
--- /dev/null
+++ b/memcheck/tests/linux/getregset.stdout.exp
@@ -0,0 +1 @@
+OK
diff --git a/memcheck/tests/linux/getregset.vgtest b/memcheck/tests/linux/getregset.vgtest
new file mode 100644
index 0000000..73f52f7
--- /dev/null
+++ b/memcheck/tests/linux/getregset.vgtest
@@ -0,0 +1,2 @@
+prog: getregset
+vgopts: -q
\ No newline at end of file
commit e48a444c9dfdf8083da562e87521c54876f8edc3
Author: cborntra <cborntra@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Thu Nov 8 20:10:10 2012 +0000
add s390 specific fix for getregset
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13112 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h
index 6638f14..ea043d7 100644
--- a/coregrind/m_syswrap/priv_syswrap-linux.h
+++ b/coregrind/m_syswrap/priv_syswrap-linux.h
@@ -290,6 +290,11 @@ extern void ML_(linux_POST_sys_msgctl) ( TId, UW, UW, UW, UW );
extern void ML_(linux_PRE_sys_getsockopt) ( TId, UW, UW, UW, UW, UW );
extern void ML_(linux_POST_sys_getsockopt) ( TId, SR, UW, UW, UW, UW, UW );
+// Linux-specific (but non-arch-specific) ptrace wrapper helpers
+extern void ML_(linux_PRE_getregset) ( ThreadId, long, long );
+extern void ML_(linux_PRE_setregset) ( ThreadId, long, long );
+extern void ML_(linux_POST_getregset)( ThreadId, long, long );
+
#undef TId
#undef UW
#undef SR
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index cec1c20..18bb548 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -7230,6 +7230,46 @@ ML_(linux_POST_sys_getsockopt) ( ThreadId tid,
}
}
+/* ---------------------------------------------------------------------
+ ptrace wrapper helpers
+ ------------------------------------------------------------------ */
+
+void
+ML_(linux_PRE_getregset) ( ThreadId tid, long arg3, long arg4 )
+{
+ struct vki_iovec *iov = (struct vki_iovec *) arg4;
+
+ PRE_MEM_READ("ptrace(getregset iovec->iov_base)",
+ (unsigned long) &iov->iov_base, sizeof(iov->iov_base));
+ PRE_MEM_READ("ptrace(getregset iovec->iov_len)",
+ (unsigned long) &iov->iov_len, sizeof(iov->iov_len));
+ PRE_MEM_WRITE("ptrace(getregset *(iovec->iov_base))",
+ (unsigned long) iov->iov_base, iov->iov_len);
+}
+
+void
+ML_(linux_PRE_setregset) ( ThreadId tid, long arg3, long arg4 )
+{
+ struct vki_iovec *iov = (struct vki_iovec *) arg4;
+
+ PRE_MEM_READ("ptrace(setregset iovec->iov_base)",
+ (unsigned long) &iov->iov_base, sizeof(iov->iov_base));
+ PRE_MEM_READ("ptrace(setregset iovec->iov_len)",
+ (unsigned long) &iov->iov_len, sizeof(iov->iov_len));
+ PRE_MEM_READ("ptrace(setregset *(iovec->iov_base))",
+ (unsigned long) iov->iov_base, iov->iov_len);
+}
+
+void
+ML_(linux_POST_getregset) ( ThreadId tid, long arg3, long arg4 )
+{
+ struct vki_iovec *iov = (struct vki_iovec *) arg4;
+
+ /* XXX: The actual amount of data written by the kernel might be
+ less than iov_len, depending on the regset (arg3). */
+ POST_MEM_WRITE((unsigned long) iov->iov_base, iov->iov_len);
+}
+
#undef PRE
#undef POST
diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
index 10d83e7..84c2f29 100644
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
@@ -345,10 +345,13 @@ DECL_TEMPLATE(s390x_linux, sys_sigreturn);
DECL_TEMPLATE(s390x_linux, sys_rt_sigreturn);
DECL_TEMPLATE(s390x_linux, sys_fadvise64);
-// PEEK TEXT,DATA and USER are common to all architectures
-// PEEKUSR_AREA and POKEUSR_AREA are special, having a memory area
-// containing the real addr, data, and len field pointed to by ARG3
-// instead of ARG4
+/* PEEK TEXT,DATA and USER are common to all architectures.
+ PEEKUSR_AREA and POKEUSR_AREA are special, having a memory area
+ containing the real addr, data, and len field pointed to by ARG3
+ instead of ARG4.
+ GETREGSET and SETREGSET use a struct iovec (pointed to by ARG4) for
+ the address and size of the user buffer. */
+
PRE(sys_ptrace)
{
PRINT("sys_ptrace ( %ld, %ld, %#lx, %#lx )", ARG1,ARG2,ARG3,ARG4);
@@ -404,6 +407,12 @@ PRE(sys_ptrace)
pa->vki_process_addr, pa->vki_len);
break;
}
+ case VKI_PTRACE_GETREGSET:
+ ML_(linux_PRE_getregset)(tid, ARG3, ARG4);
+ break;
+ case VKI_PTRACE_SETREGSET:
+ ML_(linux_PRE_setregset)(tid, ARG3, ARG4);
+ break;
default:
break;
}
@@ -432,7 +441,11 @@ POST(sys_ptrace)
pa = (vki_ptrace_area *) ARG3;
POST_MEM_WRITE(pa->vki_process_addr, pa->vki_len);
+ break;
}
+ case VKI_PTRACE_GETREGSET:
+ ML_(linux_POST_getregset)(tid, ARG3, ARG4);
+ break;
default:
break;
}
diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h
index 64ba6a4..cee687d 100644
--- a/include/vki/vki-linux.h
+++ b/include/vki/vki-linux.h
@@ -2251,6 +2251,8 @@ typedef __vki_kernel_uid32_t vki_qid_t; /* Type in which we store ids in memory
#define VKI_PTRACE_GETEVENTMSG 0x4201
#define VKI_PTRACE_GETSIGINFO 0x4202
#define VKI_PTRACE_SETSIGINFO 0x4203
+#define VKI_PTRACE_GETREGSET 0x4204
+#define VKI_PTRACE_SETREGSET 0x4205
//----------------------------------------------------------------------
// From linux-2.6.14/include/sound/asound.h
diff --git a/memcheck/tests/linux/getregset.c b/memcheck/tests/linux/getregset.c
index 70b5ce2..3a67663 100644
--- a/memcheck/tests/linux/getregset.c
+++ b/memcheck/tests/linux/getregset.c
@@ -24,7 +24,7 @@ static int
non_empty(const char *buf, size_t len)
{
size_t i;
- int c;
+ int c = 0;
volatile const char *p = buf;
for (i = 0; i != len; i++)
commit b2cd1bc0abb95119df1b9b8e6dcc71e48b828a94
Author: cborntra <cborntra@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Thu Nov 8 20:27:05 2012 +0000
also wire up arm, x86 and amd64 regarding ptrace regsets
original patch from
Andreas Arnez <arnez AT linux DOT vnet DOT ibm DOT com>
Seems that ppc and mips dont have ptrace support....
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13113 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
index 035f7b8..2f2b0a4 100644
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
@@ -617,6 +617,12 @@ PRE(sys_ptrace)
case VKI_PTRACE_SETSIGINFO:
PRE_MEM_READ( "ptrace(setsiginfo)", ARG4, sizeof(vki_siginfo_t));
break;
+ case VKI_PTRACE_GETREGSET:
+ ML_(linux_PRE_getregset)(tid, ARG3, ARG4);
+ break;
+ case VKI_PTRACE_SETREGSET:
+ ML_(linux_PRE_setregset)(tid, ARG3, ARG4);
+ break;
default:
break;
}
@@ -645,6 +651,9 @@ POST(sys_ptrace)
*/
POST_MEM_WRITE( ARG4, sizeof(vki_siginfo_t));
break;
+ case VKI_PTRACE_GETREGSET:
+ ML_(linux_POST_getregset)(tid, ARG3, ARG4);
+ break;
default:
break;
}
diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
index 27ecc8c..f60d771 100644
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
@@ -1110,6 +1110,12 @@ PRE(sys_ptrace)
case VKI_PTRACE_SETSIGINFO:
PRE_MEM_READ( "ptrace(setsiginfo)", ARG4, sizeof(vki_siginfo_t));
break;
+ case VKI_PTRACE_GETREGSET:
+ ML_(linux_PRE_getregset)(tid, ARG3, ARG4);
+ break;
+ case VKI_PTRACE_SETREGSET:
+ ML_(linux_PRE_setregset)(tid, ARG3, ARG4);
+ break;
default:
break;
}
@@ -1149,6 +1155,9 @@ POST(sys_ptrace)
*/
POST_MEM_WRITE( ARG4, sizeof(vki_siginfo_t));
break;
+ case VKI_PTRACE_GETREGSET:
+ ML_(linux_POST_getregset)(tid, ARG3, ARG4);
+ break;
default:
break;
}
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
index 8f47efd..b9f94b6 100644
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
@@ -1139,6 +1139,12 @@ PRE(sys_ptrace)
case VKI_PTRACE_SETSIGINFO:
PRE_MEM_READ( "ptrace(setsiginfo)", ARG4, sizeof(vki_siginfo_t));
break;
+ case VKI_PTRACE_GETREGSET:
+ ML_(linux_PRE_getregset)(tid, ARG3, ARG4);
+ break;
+ case VKI_PTRACE_SETREGSET:
+ ML_(linux_PRE_setregset)(tid, ARG3, ARG4);
+ break;
default:
break;
}
@@ -1170,6 +1176,9 @@ POST(sys_ptrace)
*/
POST_MEM_WRITE( ARG4, sizeof(vki_siginfo_t));
break;
+ case VKI_PTRACE_GETREGSET:
+ ML_(linux_POST_getregset)(tid, ARG3, ARG4);
+ break;
default:
break;
}
commit 49cc754d63a30accef06cd9a18315051b206373c
Author: cborntra <cborntra@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Fri Nov 9 08:06:14 2012 +0000
GETREGSET was introduced with 2.6.33.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13115 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/linux/getregset.vgtest b/memcheck/tests/linux/getregset.vgtest
index 73f52f7..14be523 100644
--- a/memcheck/tests/linux/getregset.vgtest
+++ b/memcheck/tests/linux/getregset.vgtest
@@ -1,2 +1,4 @@
prog: getregset
-vgopts: -q
\ No newline at end of file
+vgopts: -q
+prereq: ../../../tests/os_test linux 2.6.33
+
commit a9a475d568840ecdfcc312cc4b02c29e20b81fab
Author: cborntra <cborntra@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Thu Nov 8 19:46:29 2012 +0000
wire up testcase
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13111 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am
index b59afae..5885ab0 100644
--- a/memcheck/tests/linux/Makefile.am
+++ b/memcheck/tests/linux/Makefile.am
@@ -16,11 +16,13 @@ EXTRA_DIST = \
syslog-syscall.vgtest syslog-syscall.stderr.exp \
timerfd-syscall.vgtest timerfd-syscall.stderr.exp \
with-space.stderr.exp with-space.stdout.exp with-space.vgtest \
- proc-auxv.vgtest proc-auxv.stderr.exp
+ proc-auxv.vgtest proc-auxv.stderr.exp getregset.vgtest \
+ getregset.stderr.exp getregset.stdout.exp
check_PROGRAMS = \
brk \
capget \
+ getregset \
lsframe1 \
lsframe2 \
sigqueue \
--- valgrind-3.8.1/memcheck/tests/linux/Makefile.in.orig 2013-02-19 15:22:18.550589954 +0100
+++ valgrind-3.8.1/memcheck/tests/linux/Makefile.in 2013-02-19 15:22:30.941543855 +0100
@@ -54,11 +54,11 @@
@VGCONF_HAVE_PLATFORM_SEC_TRUE@am__append_2 = -DVGA_SEC_@VGCONF_ARCH_SEC@=1 \
@VGCONF_HAVE_PLATFORM_SEC_TRUE@ -DVGP_SEC_@VGCONF_ARCH_PRI@_@VGCONF_OS@=1
-check_PROGRAMS = brk$(EXEEXT) capget$(EXEEXT) lsframe1$(EXEEXT) \
- lsframe2$(EXEEXT) sigqueue$(EXEEXT) stack_changes$(EXEEXT) \
- stack_switch$(EXEEXT) syscalls-2007$(EXEEXT) \
- syslog-syscall$(EXEEXT) timerfd-syscall$(EXEEXT) \
- proc-auxv$(EXEEXT)
+check_PROGRAMS = brk$(EXEEXT) capget$(EXEEXT) getregset$(EXEEXT) \
+ lsframe1$(EXEEXT) lsframe2$(EXEEXT) sigqueue$(EXEEXT) \
+ stack_changes$(EXEEXT) stack_switch$(EXEEXT) \
+ syscalls-2007$(EXEEXT) syslog-syscall$(EXEEXT) \
+ timerfd-syscall$(EXEEXT) proc-auxv$(EXEEXT)
subdir = memcheck/tests/linux
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
@@ -74,6 +74,9 @@
capget_SOURCES = capget.c
capget_OBJECTS = capget.$(OBJEXT)
capget_LDADD = $(LDADD)
+getregset_SOURCES = getregset.c
+getregset_OBJECTS = getregset.$(OBJEXT)
+getregset_LDADD = $(LDADD)
lsframe1_SOURCES = lsframe1.c
lsframe1_OBJECTS = lsframe1.$(OBJEXT)
lsframe1_LDADD = $(LDADD)
@@ -110,12 +113,12 @@
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = brk.c capget.c lsframe1.c lsframe2.c proc-auxv.c sigqueue.c \
- stack_changes.c stack_switch.c syscalls-2007.c \
- syslog-syscall.c timerfd-syscall.c
-DIST_SOURCES = brk.c capget.c lsframe1.c lsframe2.c proc-auxv.c \
+SOURCES = brk.c capget.c getregset.c lsframe1.c lsframe2.c proc-auxv.c \
sigqueue.c stack_changes.c stack_switch.c syscalls-2007.c \
syslog-syscall.c timerfd-syscall.c
+DIST_SOURCES = brk.c capget.c getregset.c lsframe1.c lsframe2.c \
+ proc-auxv.c sigqueue.c stack_changes.c stack_switch.c \
+ syscalls-2007.c syslog-syscall.c timerfd-syscall.c
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -409,7 +412,8 @@
syslog-syscall.vgtest syslog-syscall.stderr.exp \
timerfd-syscall.vgtest timerfd-syscall.stderr.exp \
with-space.stderr.exp with-space.stdout.exp with-space.vgtest \
- proc-auxv.vgtest proc-auxv.stderr.exp
+ proc-auxv.vgtest proc-auxv.stderr.exp getregset.vgtest \
+ getregset.stderr.exp getregset.stdout.exp
stack_switch_LDADD = -lpthread
timerfd_syscall_LDADD = -lrt
@@ -456,6 +460,9 @@
capget$(EXEEXT): $(capget_OBJECTS) $(capget_DEPENDENCIES)
@rm -f capget$(EXEEXT)
$(LINK) $(capget_OBJECTS) $(capget_LDADD) $(LIBS)
+getregset$(EXEEXT): $(getregset_OBJECTS) $(getregset_DEPENDENCIES)
+ @rm -f getregset$(EXEEXT)
+ $(LINK) $(getregset_OBJECTS) $(getregset_LDADD) $(LIBS)
lsframe1$(EXEEXT): $(lsframe1_OBJECTS) $(lsframe1_DEPENDENCIES)
@rm -f lsframe1$(EXEEXT)
$(LINK) $(lsframe1_OBJECTS) $(lsframe1_LDADD) $(LIBS)
@@ -492,6 +499,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brk.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capget.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getregset.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsframe1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsframe2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc-auxv.Po@am__quote@

View File

@ -1,58 +0,0 @@
commit f666d20249ff381dfc9bf5a621c544560527af40
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Wed May 22 10:21:08 2013 +0000
Support PTRACE_GET/SET_THREAD_AREA on x86.
BZ#320063. (Josh Stone, jistone@redhat.com)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13403 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
index 7e75899..ed60a15 100644
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
@@ -1118,6 +1118,10 @@ PRE(sys_ptrace)
PRE_MEM_WRITE( "ptrace(getfpxregs)", ARG4,
sizeof(struct vki_user_fxsr_struct) );
break;
+ case VKI_PTRACE_GET_THREAD_AREA:
+ PRE_MEM_WRITE( "ptrace(get_thread_area)", ARG4,
+ sizeof(struct vki_user_desc) );
+ break;
case VKI_PTRACE_SETREGS:
PRE_MEM_READ( "ptrace(setregs)", ARG4,
sizeof (struct vki_user_regs_struct));
@@ -1130,6 +1134,10 @@ PRE(sys_ptrace)
PRE_MEM_READ( "ptrace(setfpxregs)", ARG4,
sizeof(struct vki_user_fxsr_struct) );
break;
+ case VKI_PTRACE_SET_THREAD_AREA:
+ PRE_MEM_READ( "ptrace(set_thread_area)", ARG4,
+ sizeof(struct vki_user_desc) );
+ break;
case VKI_PTRACE_GETEVENTMSG:
PRE_MEM_WRITE( "ptrace(geteventmsg)", ARG4, sizeof(unsigned long));
break;
@@ -1167,6 +1175,9 @@ POST(sys_ptrace)
case VKI_PTRACE_GETFPXREGS:
POST_MEM_WRITE( ARG4, sizeof(struct vki_user_fxsr_struct) );
break;
+ case VKI_PTRACE_GET_THREAD_AREA:
+ POST_MEM_WRITE( ARG4, sizeof(struct vki_user_desc) );
+ break;
case VKI_PTRACE_GETEVENTMSG:
POST_MEM_WRITE( ARG4, sizeof(unsigned long));
break;
diff --git a/include/vki/vki-x86-linux.h b/include/vki/vki-x86-linux.h
index 7c072d6..adfcb08 100644
--- a/include/vki/vki-x86-linux.h
+++ b/include/vki/vki-x86-linux.h
@@ -812,6 +812,8 @@ struct vki_shminfo64 {
#define VKI_PTRACE_SETFPREGS 15
#define VKI_PTRACE_GETFPXREGS 18
#define VKI_PTRACE_SETFPXREGS 19
+#define VKI_PTRACE_GET_THREAD_AREA 25
+#define VKI_PTRACE_SET_THREAD_AREA 26
//----------------------------------------------------------------------
// From linux-2.6.15.4/include/asm-i386/vm86.h

View File

@ -1,55 +0,0 @@
commit 6f0b0c294b995df6c32edc75f90dfac3ad04114a
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Thu Mar 28 22:52:13 2013 +0000
memcheck/tests/strchr test should not depend on line numbers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13348 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/strchr.stderr.exp3 b/memcheck/tests/strchr.stderr.exp3
index 9f90e69..e1832fa 100644
--- a/memcheck/tests/strchr.stderr.exp3
+++ b/memcheck/tests/strchr.stderr.exp3
@@ -1,9 +1,9 @@
Conditional jump or move depends on uninitialised value(s)
- at 0x........: __GI_strchr (mc_replace_strmem.c:211)
+ at 0x........: __GI_strchr (mc_replace_strmem.c:...)
by 0x........: main (strchr.c:15)
Conditional jump or move depends on uninitialised value(s)
- at 0x........: __GI_strchr (mc_replace_strmem.c:211)
+ at 0x........: __GI_strchr (mc_replace_strmem.c:...)
by 0x........: main (strchr.c:15)
Conditional jump or move depends on uninitialised value(s)
diff --git a/memcheck/tests/strchr.vgtest b/memcheck/tests/strchr.vgtest
index e914726..152c97e 100644
--- a/memcheck/tests/strchr.vgtest
+++ b/memcheck/tests/strchr.vgtest
@@ -1,2 +1,3 @@
prog: strchr
vgopts: -q
+stderr_filter_args: strchr.c
commit 48b0ae338abe2dcd726e1733532a971837049ceb
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Thu Mar 28 22:52:14 2013 +0000
For memcheck overlap filter_memcpy str[n]cpy and __GI_str[n]cpy are equal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13349 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/filter_memcpy b/memcheck/tests/filter_memcpy
index 47741ba..737304c 100755
--- a/memcheck/tests/filter_memcpy
+++ b/memcheck/tests/filter_memcpy
@@ -1,5 +1,8 @@
#! /bin/sh
# mc_replace_strmem.c intercepts various memcpy glibc versions.
+# mc_replace_strmem.c str[n]cpy and __GI_str[n]cpy are the same.
./filter_stderr "$@" |
-perl -p -e "s/: memcpy\@\@?GLIBC_[.1-9]+ \(mc_replace_strmem.c:...\)/: memcpy \(mc_replace_strmem.c:...\)/"
+perl -p -e "s/: memcpy\@\@?GLIBC_[.1-9]+ \(mc_replace_strmem.c:...\)/: memcpy \(mc_replace_strmem.c:...\)/" |
+sed -e "s/: __GI_strcpy (mc_replace_strmem.c:/: strcpy (mc_replace_strmem.c:/" |
+sed -e "s/: __GI_strncpy (mc_replace_strmem.c:/: strncpy (mc_replace_strmem.c:/"

View File

@ -1,141 +0,0 @@
commit d2c954603a211e11c35db7d8b3fdd60675483738
Author: florian <florian@8f6e269a-dfd6-0310-a8e1-e2731360e62c>
Date: Tue Dec 4 04:45:32 2012 +0000
In the past, the implementation of STFLE returned the facilities of the host
machine. This was not consistent in the following sense: Suppose the host
has a facility F installed and this facility implies the availability of an
insn X. Suppose further, that insn X is not supported in valgrind.
An application progrm that tests the availability of insn X by checking
for its associated facility F will fail under valgrind when using X because
valgrind will SIGILL. Not so good.
This patch changes the STFLE behaviour to adjust the facilities of the
virtual machine according to what the set of insns that is actually
supported. It's an approximation, because for some facilities we only
support a subset of the insns enabled by that facility.
Fixes BZ 310931.
git-svn-id: svn://svn.valgrind.org/vex/trunk@2579 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/VEX/priv/guest_s390_helpers.c b/priv/guest_s390_helpers.c
index 8169916..b0c0225 100644
--- a/VEX/priv/guest_s390_helpers.c
+++ b/VEX/priv/guest_s390_helpers.c
@@ -292,6 +292,22 @@ ULong s390x_dirtyhelper_STCKE(ULong *addr) {return 3;}
/*--- Dirty helper for Store Facility instruction ---*/
/*------------------------------------------------------------*/
#if defined(VGA_s390x)
+static void
+s390_set_facility_bit(ULong *addr, UInt bitno, UInt value)
+{
+ addr += bitno / 64;
+ bitno = bitno % 64;
+
+ ULong mask = 1;
+ mask <<= (63 - bitno);
+
+ if (value == 1) {
+ *addr |= mask; // set
+ } else {
+ *addr &= ~mask; // clear
+ }
+}
+
ULong
s390x_dirtyhelper_STFLE(VexGuestS390XState *guest_state, ULong *addr)
{
@@ -313,9 +329,56 @@ s390x_dirtyhelper_STFLE(VexGuestS390XState *guest_state, ULong *addr)
/* Update guest register 0 with what STFLE set r0 to */
guest_state->guest_r0 = reg0;
+ /* Set default: VM facilities = host facilities */
for (i = 0; i < num_dw; ++i)
addr[i] = hoststfle[i];
+ /* Enumerators for interesting facilities. The value of the enumerator
+ is the number of the facility bit as per POP. */
+ enum {
+ S390_FAC_MSA = 17, // message-security-assist
+ S390_FAC_LDISP = 18, // long displacement
+ S390_FAC_HFPMAS = 20, // HFP multiply-and-add-subtract
+ S390_FAC_EIMM = 21, // extended immediate
+ S390_FAC_HFPUNX = 23, // HFP unnormalized extension
+ S390_FAC_ETF2 = 24, // ETF2-enhancement
+ S390_FAC_PENH = 26, // parsing-enhancement
+ S390_FAC_ETF3 = 30, // ETF3-enhancement
+ S390_FAC_XCPUT = 31, // extract-CPU-time
+ S390_FAC_GIE = 34, // general insn extension
+ S390_FAC_EXEXT = 35, // execute extension
+ S390_FAC_DFP = 42, // decimal floating point
+ S390_FAC_PFPO = 44, // perform floating point operation insn
+ S390_FAC_HIGHW = 45, // high-word extension
+ S390_FAC_DFPZC = 48, // DFP zoned-conversion
+ S390_FAC_MISC = 49, // miscellaneous insn
+ S390_FAC_CTREXE = 50, // constrained transactional execution
+ S390_FAC_TREXE = 73, // transactional execution
+ S390_FAC_MSA4 = 77 // message-security-assist 4
+ };
+
+ /* Now adjust the VM facilities according to what the VM supports */
+ s390_set_facility_bit(addr, S390_FAC_LDISP, 1);
+ s390_set_facility_bit(addr, S390_FAC_EIMM, 1);
+ s390_set_facility_bit(addr, S390_FAC_ETF2, 1);
+ s390_set_facility_bit(addr, S390_FAC_ETF3, 1);
+ s390_set_facility_bit(addr, S390_FAC_GIE, 1);
+ s390_set_facility_bit(addr, S390_FAC_EXEXT, 1);
+ s390_set_facility_bit(addr, S390_FAC_HIGHW, 1);
+
+ s390_set_facility_bit(addr, S390_FAC_HFPMAS, 0);
+ s390_set_facility_bit(addr, S390_FAC_HFPUNX, 0);
+ s390_set_facility_bit(addr, S390_FAC_XCPUT, 0);
+ s390_set_facility_bit(addr, S390_FAC_MSA, 0);
+ s390_set_facility_bit(addr, S390_FAC_PENH, 0);
+ s390_set_facility_bit(addr, S390_FAC_DFP, 0);
+ s390_set_facility_bit(addr, S390_FAC_PFPO, 0);
+ s390_set_facility_bit(addr, S390_FAC_DFPZC, 0);
+ s390_set_facility_bit(addr, S390_FAC_MISC, 0);
+ s390_set_facility_bit(addr, S390_FAC_CTREXE, 0);
+ s390_set_facility_bit(addr, S390_FAC_TREXE, 0);
+ s390_set_facility_bit(addr, S390_FAC_MSA4, 0);
+
return cc;
}
commit a53843d425a9cc64159bd46833e93febb0a8d797
Author: florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Tue Dec 4 04:46:52 2012 +0000
Beef up testcase. Announce fix.
Part of fixing BZ 310931.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13150 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/none/tests/s390x/stfle.c b/none/tests/s390x/stfle.c
index 7bfe2d6..6c8007b 100644
--- a/none/tests/s390x/stfle.c
+++ b/none/tests/s390x/stfle.c
@@ -52,5 +52,11 @@ int main()
else
printf("The z/Architecture architectural mode is not installed\n");
+ /* Test #4: Message security assist */
+ if (stfle(dw, 17)) {
+ printf("MSA facility is present\n");
+ } else {
+ printf("No MSA facility available\n");
+ }
return 0;
}
diff --git a/none/tests/s390x/stfle.stdout.exp b/none/tests/s390x/stfle.stdout.exp
index c4653a9..00c2c75 100644
--- a/none/tests/s390x/stfle.stdout.exp
+++ b/none/tests/s390x/stfle.stdout.exp
@@ -6,3 +6,4 @@ STFLE facility is installed
the value of cc is 3 and #double words is 2
the value of cc is 3 and #double words is 2
The z/Architecture architectural mode is installed and active
+No MSA facility available

View File

@ -1,19 +0,0 @@
--- valgrind-3.8.1/glibc-2.X.supp.in.orig 2012-10-15 14:10:24.646984028 +0200
+++ valgrind-3.8.1/glibc-2.X.supp.in 2012-10-15 14:13:58.505147375 +0200
@@ -213,6 +213,16 @@
obj:/*libc-@GLIBC_VERSION@*.so
}
+## ---------------------------------------------------------------------##
+# Workaround for Bug 308427 - s390 memcheck reports tsearch conditional
+# jump or move depends on uninitialized value.
+{
+ s390x-tsearch-node_t-red
+ Memcheck:Cond
+ fun:tsearch
+ obj:/*libc-@GLIBC_VERSION@*.so
+}
+
##----------------------------------------------------------------------##
# MontaVista Linux 4.0.1 on ppc32
{

View File

@ -1,289 +0,0 @@
commit fc75e5ea3e57d58bbbbd3fd8fff3a71de9a1b172
Author: tom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Thu Feb 28 12:50:55 2013 +0000
Don't check the flags word in msghdr for sendmsg as the
kernel will neither read nor write it.
Patch from Mark Wielaard to fix BZ#315441.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13294 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/filter_stderr b/memcheck/tests/filter_stderr
index abd6792..3d62d94 100755
--- a/memcheck/tests/filter_stderr
+++ b/memcheck/tests/filter_stderr
@@ -22,6 +22,9 @@ sed "s/checked [0-9,]* bytes./checked ... bytes./" |
# records. So we filter out the loss record numbers.
perl -p -e "s/in loss record \d+ of \d+/in loss record ... of .../" |
+# Filter out glibc debuginfo if installed.
+perl -p -e "s/\(syscall-template.S:[0-9]*\)/(in \/...libc...)/" |
+
$dir/../../memcheck/tests/filter_memcheck "$@"
exit 0
diff --git a/memcheck/tests/sendmsg.c b/memcheck/tests/sendmsg.c
new file mode 100644
index 0000000..2039f07
--- /dev/null
+++ b/memcheck/tests/sendmsg.c
@@ -0,0 +1,74 @@
+#include <netinet/ip.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#define PORT 12345
+
+int
+main (int argc, char **argv)
+{
+ int fd;
+ struct sockaddr_in sa;
+ struct msghdr msg;
+ struct iovec iov[2];
+
+ fd = socket (AF_INET, SOCK_DGRAM, 0);
+ if (fd == -1)
+ {
+ perror ("socket()");
+ exit (EXIT_FAILURE);
+ }
+
+ sa.sin_family = AF_INET;
+ sa.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
+ sa.sin_port = htons (PORT);
+ if (connect (fd, (struct sockaddr *) &sa, sizeof (sa)) == -1)
+ {
+ perror ("connect ()");
+ exit (EXIT_FAILURE);
+ }
+
+ // Create msg_hdr. Oops, we forget to set msg_name...
+ msg.msg_namelen = 0;
+ iov[0].iov_base = "one";
+ iov[0].iov_len = 3;
+ iov[1].iov_base = "two";
+ iov[1].iov_len = 3;
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 2;
+ msg.msg_control = NULL;
+ msg.msg_controllen = 0;
+
+ size_t s = sendmsg (fd, &msg, 0);
+
+ // Note how we now do set msg_name, but don't set msg_flags.
+ // The msg_flags field is ignored by sendmsg.
+ msg.msg_name = NULL;
+
+ fd = socket (AF_INET, SOCK_DGRAM, 0);
+ if (fd == -1)
+ {
+ perror ("socket()");
+ exit (EXIT_FAILURE);
+ }
+
+ if (connect (fd, (struct sockaddr *) &sa, sizeof (sa)) == -1)
+ {
+ perror ("connect ()");
+ exit (EXIT_FAILURE);
+ }
+
+ s = sendmsg (fd, &msg, 0);
+ if (s == -1)
+ {
+ perror ("sendmsg ()");
+ exit (EXIT_FAILURE);
+ }
+ else
+ fprintf (stderr, "sendmsg: %d\n", (int) s);
+
+ exit(0);
+}
diff --git a/memcheck/tests/sendmsg.stderr.exp b/memcheck/tests/sendmsg.stderr.exp
new file mode 100644
index 0000000..38e20c5
--- /dev/null
+++ b/memcheck/tests/sendmsg.stderr.exp
@@ -0,0 +1,6 @@
+Syscall param sendmsg(msg) points to uninitialised byte(s)
+ at 0x........: sendmsg (in /...libc...)
+ by 0x........: main (sendmsg.c:45)
+ Address 0x........ is on thread 1's stack
+
+sendmsg: 6
diff --git a/memcheck/tests/sendmsg.vgtest b/memcheck/tests/sendmsg.vgtest
new file mode 100644
index 0000000..f252b62
--- /dev/null
+++ b/memcheck/tests/sendmsg.vgtest
@@ -0,0 +1,2 @@
+prog: sendmsg
+vgopts: -q
--- valgrind-3.8.1/memcheck/tests/Makefile.in.orig 2013-02-19 14:46:14.305186272 +0100
+++ valgrind-3.8.1/memcheck/tests/Makefile.in 2013-02-19 14:59:41.284835217 +0100
@@ -105,20 +105,20 @@
partial_load$(EXEEXT) pdb-realloc$(EXEEXT) \
pdb-realloc2$(EXEEXT) pipe$(EXEEXT) pointer-trace$(EXEEXT) \
post-syscall$(EXEEXT) realloc1$(EXEEXT) realloc2$(EXEEXT) \
- realloc3$(EXEEXT) sbfragment$(EXEEXT) sh-mem$(EXEEXT) \
- sh-mem-random$(EXEEXT) sigaltstack$(EXEEXT) signal2$(EXEEXT) \
- sigprocmask$(EXEEXT) static_malloc$(EXEEXT) sigkill$(EXEEXT) \
- stpncpy$(EXEEXT) strchr$(EXEEXT) str_tester$(EXEEXT) \
- supp_unknown$(EXEEXT) supp1$(EXEEXT) supp2$(EXEEXT) \
- suppfree$(EXEEXT) test-plo$(EXEEXT) trivialleak$(EXEEXT) \
- unit_libcbase$(EXEEXT) unit_oset$(EXEEXT) varinfo1$(EXEEXT) \
- varinfo2$(EXEEXT) varinfo3$(EXEEXT) varinfo4$(EXEEXT) \
- varinfo5$(EXEEXT) varinfo5so.so$(EXEEXT) varinfo6$(EXEEXT) \
- vcpu_fbench$(EXEEXT) vcpu_fnfns$(EXEEXT) wcs$(EXEEXT) \
- xml1$(EXEEXT) wrap1$(EXEEXT) wrap2$(EXEEXT) wrap3$(EXEEXT) \
- wrap4$(EXEEXT) wrap5$(EXEEXT) wrap6$(EXEEXT) wrap7$(EXEEXT) \
- wrap7so.so$(EXEEXT) wrap8$(EXEEXT) writev1$(EXEEXT) \
- $(am__EXEEXT_1)
+ realloc3$(EXEEXT) sbfragment$(EXEEXT) sendmsg$(EXEEXT) \
+ sh-mem$(EXEEXT) sh-mem-random$(EXEEXT) sigaltstack$(EXEEXT) \
+ signal2$(EXEEXT) sigprocmask$(EXEEXT) static_malloc$(EXEEXT) \
+ sigkill$(EXEEXT) stpncpy$(EXEEXT) strchr$(EXEEXT) \
+ str_tester$(EXEEXT) supp_unknown$(EXEEXT) supp1$(EXEEXT) \
+ supp2$(EXEEXT) suppfree$(EXEEXT) test-plo$(EXEEXT) \
+ trivialleak$(EXEEXT) unit_libcbase$(EXEEXT) unit_oset$(EXEEXT) \
+ varinfo1$(EXEEXT) varinfo2$(EXEEXT) varinfo3$(EXEEXT) \
+ varinfo4$(EXEEXT) varinfo5$(EXEEXT) varinfo5so.so$(EXEEXT) \
+ varinfo6$(EXEEXT) vcpu_fbench$(EXEEXT) vcpu_fnfns$(EXEEXT) \
+ wcs$(EXEEXT) xml1$(EXEEXT) wrap1$(EXEEXT) wrap2$(EXEEXT) \
+ wrap3$(EXEEXT) wrap4$(EXEEXT) wrap5$(EXEEXT) wrap6$(EXEEXT) \
+ wrap7$(EXEEXT) wrap7so.so$(EXEEXT) wrap8$(EXEEXT) \
+ writev1$(EXEEXT) $(am__EXEEXT_1)
@DWARF4_TRUE@am__append_12 = dw4
subdir = memcheck/tests
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -434,6 +434,9 @@
sbfragment_SOURCES = sbfragment.c
sbfragment_OBJECTS = sbfragment.$(OBJEXT)
sbfragment_LDADD = $(LDADD)
+sendmsg_SOURCES = sendmsg.c
+sendmsg_OBJECTS = sendmsg.$(OBJEXT)
+sendmsg_LDADD = $(LDADD)
sh_mem_SOURCES = sh-mem.c
sh_mem_OBJECTS = sh-mem.$(OBJEXT)
sh_mem_LDADD = $(LDADD)
@@ -610,8 +613,8 @@
origin3-no.c origin4-many.c origin5-bz2.c origin6-fp.c \
overlap.c partial_load.c partiallydefinedeq.c pdb-realloc.c \
pdb-realloc2.c pipe.c pointer-trace.c post-syscall.c \
- realloc1.c realloc2.c realloc3.c sbfragment.c sh-mem.c \
- sh-mem-random.c sigaltstack.c sigkill.c signal2.c \
+ realloc1.c realloc2.c realloc3.c sbfragment.c sendmsg.c \
+ sh-mem.c sh-mem-random.c sigaltstack.c sigkill.c signal2.c \
sigprocmask.c static_malloc.c stpncpy.c str_tester.c strchr.c \
$(supp1_SOURCES) $(supp2_SOURCES) $(supp_unknown_SOURCES) \
suppfree.c test-plo.c trivialleak.c unit_libcbase.c \
@@ -641,8 +644,8 @@
origin3-no.c origin4-many.c origin5-bz2.c origin6-fp.c \
overlap.c partial_load.c partiallydefinedeq.c pdb-realloc.c \
pdb-realloc2.c pipe.c pointer-trace.c post-syscall.c \
- realloc1.c realloc2.c realloc3.c sbfragment.c sh-mem.c \
- sh-mem-random.c sigaltstack.c sigkill.c signal2.c \
+ realloc1.c realloc2.c realloc3.c sbfragment.c sendmsg.c \
+ sh-mem.c sh-mem-random.c sigaltstack.c sigkill.c signal2.c \
sigprocmask.c static_malloc.c stpncpy.c str_tester.c strchr.c \
$(supp1_SOURCES) $(supp2_SOURCES) $(supp_unknown_SOURCES) \
suppfree.c test-plo.c trivialleak.c unit_libcbase.c \
@@ -1112,6 +1115,7 @@
realloc2.stderr.exp realloc2.vgtest \
realloc3.stderr.exp realloc3.vgtest \
sbfragment.stdout.exp sbfragment.stderr.exp sbfragment.vgtest \
+ sendmsg.stderr.exp sendmsg.vgtest \
sh-mem.stderr.exp sh-mem.vgtest \
sh-mem-random.stderr.exp sh-mem-random.stdout.exp64 \
sh-mem-random.stdout.exp sh-mem-random.vgtest \
@@ -1560,6 +1564,9 @@
sbfragment$(EXEEXT): $(sbfragment_OBJECTS) $(sbfragment_DEPENDENCIES)
@rm -f sbfragment$(EXEEXT)
$(LINK) $(sbfragment_OBJECTS) $(sbfragment_LDADD) $(LIBS)
+sendmsg$(EXEEXT): $(sendmsg_OBJECTS) $(sendmsg_DEPENDENCIES)
+ @rm -f sendmsg$(EXEEXT)
+ $(LINK) $(sendmsg_OBJECTS) $(sendmsg_LDADD) $(LIBS)
sh-mem$(EXEEXT): $(sh_mem_OBJECTS) $(sh_mem_DEPENDENCIES)
@rm -f sh-mem$(EXEEXT)
$(LINK) $(sh_mem_OBJECTS) $(sh_mem_LDADD) $(LIBS)
@@ -1775,6 +1782,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/realloc2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/realloc3.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sbfragment.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendmsg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh-mem-random.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh-mem.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaltstack.Po@am__quote@
--- a/coregrind/m_syswrap/syswrap-generic.c.orig 2013-02-28 15:14:08.035441439 +0100
+++ b/coregrind/m_syswrap/syswrap-generic.c 2013-02-28 15:18:13.035249059 +0100
@@ -848,7 +848,8 @@
Char *name,
struct vki_msghdr *msg,
UInt length,
- void (*foreach_func)( ThreadId, Bool, Char *, Addr, SizeT )
+ void (*foreach_func)( ThreadId, Bool, Char *, Addr, SizeT ),
+ Bool recv
)
{
Char *fieldName;
@@ -866,7 +867,11 @@
foreach_func ( tid, True, fieldName, (Addr)&msg->msg_iovlen, sizeof( msg->msg_iovlen ) );
foreach_func ( tid, True, fieldName, (Addr)&msg->msg_control, sizeof( msg->msg_control ) );
foreach_func ( tid, True, fieldName, (Addr)&msg->msg_controllen, sizeof( msg->msg_controllen ) );
- foreach_func ( tid, False, fieldName, (Addr)&msg->msg_flags, sizeof( msg->msg_flags ) );
+
+ /* msg_flags is completely ignored for send_mesg, recv_mesg doesn't read
+ the field, but does write to it. */
+ if ( recv )
+ foreach_func ( tid, False, fieldName, (Addr)&msg->msg_flags, sizeof( msg->msg_flags ) );
if ( msg->msg_name ) {
VG_(sprintf) ( fieldName, "(%s.msg_name)", name );
@@ -1509,7 +1514,7 @@
void
ML_(generic_PRE_sys_sendmsg) ( ThreadId tid, Char *name, struct vki_msghdr *msg )
{
- msghdr_foreachfield ( tid, name, msg, ~0, pre_mem_read_sendmsg );
+ msghdr_foreachfield ( tid, name, msg, ~0, pre_mem_read_sendmsg, False );
}
/* ------ */
@@ -1517,13 +1522,13 @@
void
ML_(generic_PRE_sys_recvmsg) ( ThreadId tid, Char *name, struct vki_msghdr *msg )
{
- msghdr_foreachfield ( tid, name, msg, ~0, pre_mem_write_recvmsg );
+ msghdr_foreachfield ( tid, name, msg, ~0, pre_mem_write_recvmsg, True );
}
void
ML_(generic_POST_sys_recvmsg) ( ThreadId tid, Char *name, struct vki_msghdr *msg, UInt length )
{
- msghdr_foreachfield( tid, name, msg, length, post_mem_write_recvmsg );
+ msghdr_foreachfield( tid, name, msg, length, post_mem_write_recvmsg, True );
check_cmsg_for_fds( tid, msg );
}
--- a/memcheck/tests/Makefile.am.orig 2013-02-28 15:14:08.220442048 +0100
+++ b/memcheck/tests/Makefile.am 2013-02-28 15:20:17.575659460 +0100
@@ -179,6 +179,7 @@
realloc2.stderr.exp realloc2.vgtest \
realloc3.stderr.exp realloc3.vgtest \
sbfragment.stdout.exp sbfragment.stderr.exp sbfragment.vgtest \
+ sendmsg.stderr.exp sendmsg.vgtest \
sh-mem.stderr.exp sh-mem.vgtest \
sh-mem-random.stderr.exp sh-mem-random.stdout.exp64 \
sh-mem-random.stdout.exp sh-mem-random.vgtest \
@@ -282,6 +283,7 @@
post-syscall \
realloc1 realloc2 realloc3 \
sbfragment \
+ sendmsg \
sh-mem sh-mem-random \
sigaltstack signal2 sigprocmask static_malloc sigkill \
stpncpy \

View File

@ -1,743 +0,0 @@
diff -ur valgrind-3.8.1.orig/coregrind/m_main.c valgrind-3.8.1/coregrind/m_main.c
--- valgrind-3.8.1.orig/coregrind/m_main.c 2012-11-04 21:57:03.722415879 +0100
+++ valgrind-3.8.1/coregrind/m_main.c 2012-11-04 21:57:37.250896792 +0100
@@ -198,6 +198,7 @@
" To use a non-libc malloc library that is\n"
" in the main exe: --soname-synonyms=somalloc=NONE\n"
" in libxyzzy.so: --soname-synonyms=somalloc=libxyzzy.so\n"
+" --sigill-diagnostics=yes|no warn about illegal instructions? [yes]\n"
"\n";
Char* usage2 =
@@ -422,6 +423,10 @@
Char* log_fsname_unexpanded = NULL;
Char* xml_fsname_unexpanded = NULL;
+ /* Whether the user has explicitly provided --sigill-diagnostics.
+ If not explicitly given depends on general verbosity setting. */
+ Bool sigill_diag_set = False;
+
/* Log to stderr by default, but usage message goes to stdout. XML
output is initially disabled. */
tmp_log_fd = 2;
@@ -516,6 +521,9 @@
VG_STREQ(arg, "--quiet"))
VG_(clo_verbosity)--;
+ else if VG_BOOL_CLO(arg, "--sigill-diagnostics", VG_(clo_sigill_diag))
+ sigill_diag_set = True;
+
else if VG_BOOL_CLO(arg, "--stats", VG_(clo_stats)) {}
else if VG_BOOL_CLO(arg, "--xml", VG_(clo_xml))
VG_(debugLog_setXml)(VG_(clo_xml));
@@ -777,6 +785,9 @@
if (VG_(clo_verbosity) < 0)
VG_(clo_verbosity) = 0;
+ if (!sigill_diag_set)
+ VG_(clo_sigill_diag) = (VG_(clo_verbosity) > 0);
+
if (VG_(clo_trace_notbelow) == -1) {
if (VG_(clo_trace_notabove) == -1) {
/* [] */
diff -ur valgrind-3.8.1.orig/coregrind/m_options.c valgrind-3.8.1/coregrind/m_options.c
--- valgrind-3.8.1.orig/coregrind/m_options.c 2012-11-04 21:57:03.709415680 +0100
+++ valgrind-3.8.1/coregrind/m_options.c 2012-11-04 21:57:37.251896807 +0100
@@ -118,7 +118,7 @@
VgSmc VG_(clo_smc_check) = Vg_SmcStack;
HChar* VG_(clo_kernel_variant) = NULL;
Bool VG_(clo_dsymutil) = False;
-
+Bool VG_(clo_sigill_diag) = True;
/*====================================================================*/
/*=== File expansion ===*/
diff -ur valgrind-3.8.1.orig/coregrind/m_scheduler/scheduler.c valgrind-3.8.1/coregrind/m_scheduler/scheduler.c
--- valgrind-3.8.1.orig/coregrind/m_scheduler/scheduler.c 2012-11-04 21:57:03.720415849 +0100
+++ valgrind-3.8.1/coregrind/m_scheduler/scheduler.c 2012-11-04 21:57:37.252896823 +0100
@@ -1427,9 +1427,10 @@
case VEX_TRC_JMP_NODECODE: {
Addr addr = VG_(get_IP)(tid);
- VG_(umsg)(
- "valgrind: Unrecognised instruction at address %#lx.\n", addr);
- VG_(get_and_pp_StackTrace)(tid, VG_(clo_backtrace_size));
+ if (VG_(clo_sigill_diag)) {
+ VG_(umsg)(
+ "valgrind: Unrecognised instruction at address %#lx.\n", addr);
+ VG_(get_and_pp_StackTrace)(tid, VG_(clo_backtrace_size));
#define M(a) VG_(umsg)(a "\n");
M("Your program just tried to execute an instruction that Valgrind" );
M("did not recognise. There are two possible reasons for this." );
@@ -1442,6 +1443,7 @@
M("Either way, Valgrind will now raise a SIGILL signal which will" );
M("probably kill your program." );
#undef M
+ }
#if defined(VGA_s390x)
/* Now that the complaint is out we need to adjust the guest_IA. The
diff -ur valgrind-3.8.1.orig/coregrind/m_translate.c valgrind-3.8.1/coregrind/m_translate.c
--- valgrind-3.8.1.orig/coregrind/m_translate.c 2012-11-04 21:57:03.721415864 +0100
+++ valgrind-3.8.1/coregrind/m_translate.c 2012-11-04 21:57:37.261896960 +0100
@@ -1524,6 +1524,7 @@
vta.needs_self_check = needs_self_check;
vta.preamble_function = preamble_fn;
vta.traceflags = verbosity;
+ vta.sigill_diag = VG_(clo_sigill_diag);
vta.addProfInc = VG_(clo_profile_flags) > 0
&& kind != T_NoRedir;
diff -ur valgrind-3.8.1.orig/coregrind/pub_core_options.h valgrind-3.8.1/coregrind/pub_core_options.h
--- valgrind-3.8.1.orig/coregrind/pub_core_options.h 2012-11-04 21:57:03.704415605 +0100
+++ valgrind-3.8.1/coregrind/pub_core_options.h 2012-11-04 21:57:37.300897526 +0100
@@ -275,6 +275,11 @@
extern Bool VG_(should_we_trace_this_child) ( HChar* child_exe_name,
HChar** child_argv );
+/* Whether illegal instructions should be reported/diagnosed.
+ Can be explicitly set through --sigill-diagnostics otherwise
+ depends on verbosity (False if -q). */
+extern Bool VG_(clo_sigill_diag);
+
#endif // __PUB_CORE_OPTIONS_H
/*--------------------------------------------------------------------*/
diff -ur valgrind-3.8.1.orig/docs/xml/manual-core.xml valgrind-3.8.1/docs/xml/manual-core.xml
--- valgrind-3.8.1.orig/docs/xml/manual-core.xml 2012-11-04 21:57:03.689415507 +0100
+++ valgrind-3.8.1/docs/xml/manual-core.xml 2012-11-04 21:57:37.302897560 +0100
@@ -1036,6 +1036,26 @@
</listitem>
</varlistentry>
+ <varlistentry id="opt.sigill-diagnostics" xreflabel="--sigill-diagnostics">
+ <term>
+ <option><![CDATA[--sigill-diagnostics=<yes|no> [default: yes] ]]></option>
+ </term>
+ <listitem>
+ <para>Enable/disable printing of illegal instruction diagnostics.
+ Enabled by default, but defaults to disabled when
+ <option>--quiet</option> is given. The default can always be explicitly
+ overridden by giving this option.</para>
+
+ <para>When enabled a warning message will be printed with some
+ diagnostics whenever some instruction is encountered that valgrind
+ cannot decode or translate before the program is given a SIGILL signal.
+ Often an illegal instruction indicates a bug in the program or missing
+ support for the particular instruction in Valgrind. But some programs
+ do deliberately try to execute an instruction that might be missing
+ and trap the SIGILL signal to detect processor features.</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="opt.stack-traces" xreflabel="--show-below-main">
<term>
<option><![CDATA[--show-below-main=<yes|no> [default: no] ]]></option>
diff -ur valgrind-3.8.1.orig/none/tests/cmdline1.stdout.exp valgrind-3.8.1/none/tests/cmdline1.stdout.exp
--- valgrind-3.8.1.orig/none/tests/cmdline1.stdout.exp 2012-11-04 21:57:03.844417741 +0100
+++ valgrind-3.8.1/none/tests/cmdline1.stdout.exp 2012-11-04 21:57:37.385898730 +0100
@@ -87,6 +87,7 @@
To use a non-libc malloc library that is
in the main exe: --soname-synonyms=somalloc=NONE
in libxyzzy.so: --soname-synonyms=somalloc=libxyzzy.so
+ --sigill-diagnostics=yes|no warn about illegal instructions? [yes]
user options for Nulgrind:
(none)
diff -ur valgrind-3.8.1.orig/none/tests/cmdline2.stdout.exp valgrind-3.8.1/none/tests/cmdline2.stdout.exp
--- valgrind-3.8.1.orig/none/tests/cmdline2.stdout.exp 2012-11-04 21:57:03.811417238 +0100
+++ valgrind-3.8.1/none/tests/cmdline2.stdout.exp 2012-11-04 21:57:37.386898745 +0100
@@ -87,6 +87,7 @@
To use a non-libc malloc library that is
in the main exe: --soname-synonyms=somalloc=NONE
in libxyzzy.so: --soname-synonyms=somalloc=libxyzzy.so
+ --sigill-diagnostics=yes|no warn about illegal instructions? [yes]
user options for Nulgrind:
(none)
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_amd64_defs.h valgrind-3.8.1/VEX/priv/guest_amd64_defs.h
--- valgrind-3.8.1.orig/VEX/priv/guest_amd64_defs.h 2012-11-04 21:57:03.782416795 +0100
+++ valgrind-3.8.1/VEX/priv/guest_amd64_defs.h 2012-11-04 21:57:36.328883370 +0100
@@ -56,7 +56,8 @@
VexArch guest_arch,
VexArchInfo* archinfo,
VexAbiInfo* abiinfo,
- Bool host_bigendian );
+ Bool host_bigendian,
+ Bool sigill_diag );
/* Used by the optimiser to specialise calls to helpers. */
extern
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_amd64_toIR.c valgrind-3.8.1/VEX/priv/guest_amd64_toIR.c
--- valgrind-3.8.1.orig/VEX/priv/guest_amd64_toIR.c 2012-11-04 21:57:03.784416825 +0100
+++ valgrind-3.8.1/VEX/priv/guest_amd64_toIR.c 2012-11-04 21:57:36.465885366 +0100
@@ -30426,7 +30426,8 @@
void* callback_opaque,
Long delta64,
VexArchInfo* archinfo,
- VexAbiInfo* vbi
+ VexAbiInfo* vbi,
+ Bool sigill_diag
)
{
IRTemp t1, t2, t3, t4, t5, t6;
@@ -30956,29 +30957,31 @@
//default:
decode_failure:
/* All decode failures end up here. */
- vex_printf("vex amd64->IR: unhandled instruction bytes: "
- "0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
- (Int)getUChar(delta_start+0),
- (Int)getUChar(delta_start+1),
- (Int)getUChar(delta_start+2),
- (Int)getUChar(delta_start+3),
- (Int)getUChar(delta_start+4),
- (Int)getUChar(delta_start+5),
- (Int)getUChar(delta_start+6),
- (Int)getUChar(delta_start+7) );
- vex_printf("vex amd64->IR: REX=%d REX.W=%d REX.R=%d REX.X=%d REX.B=%d\n",
- haveREX(pfx) ? 1 : 0, getRexW(pfx), getRexR(pfx),
- getRexX(pfx), getRexB(pfx));
- vex_printf("vex amd64->IR: VEX=%d VEX.L=%d VEX.nVVVV=0x%x ESC=%s\n",
- haveVEX(pfx) ? 1 : 0, getVexL(pfx),
- getVexNvvvv(pfx),
- esc==ESC_NONE ? "NONE" :
- esc==ESC_0F ? "0F" :
- esc==ESC_0F38 ? "0F38" :
- esc==ESC_0F3A ? "0F3A" : "???");
- vex_printf("vex amd64->IR: PFX.66=%d PFX.F2=%d PFX.F3=%d\n",
- have66(pfx) ? 1 : 0, haveF2(pfx) ? 1 : 0,
- haveF3(pfx) ? 1 : 0);
+ if (sigill_diag) {
+ vex_printf("vex amd64->IR: unhandled instruction bytes: "
+ "0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
+ (Int)getUChar(delta_start+0),
+ (Int)getUChar(delta_start+1),
+ (Int)getUChar(delta_start+2),
+ (Int)getUChar(delta_start+3),
+ (Int)getUChar(delta_start+4),
+ (Int)getUChar(delta_start+5),
+ (Int)getUChar(delta_start+6),
+ (Int)getUChar(delta_start+7) );
+ vex_printf("vex amd64->IR: REX=%d REX.W=%d REX.R=%d REX.X=%d REX.B=%d\n",
+ haveREX(pfx) ? 1 : 0, getRexW(pfx), getRexR(pfx),
+ getRexX(pfx), getRexB(pfx));
+ vex_printf("vex amd64->IR: VEX=%d VEX.L=%d VEX.nVVVV=0x%x ESC=%s\n",
+ haveVEX(pfx) ? 1 : 0, getVexL(pfx),
+ getVexNvvvv(pfx),
+ esc==ESC_NONE ? "NONE" :
+ esc==ESC_0F ? "0F" :
+ esc==ESC_0F38 ? "0F38" :
+ esc==ESC_0F3A ? "0F3A" : "???");
+ vex_printf("vex amd64->IR: PFX.66=%d PFX.F2=%d PFX.F3=%d\n",
+ have66(pfx) ? 1 : 0, haveF2(pfx) ? 1 : 0,
+ haveF3(pfx) ? 1 : 0);
+ }
/* Tell the dispatcher that this insn cannot be decoded, and so has
not been executed, and (is currently) the next to be executed.
@@ -31041,7 +31044,8 @@
VexArch guest_arch,
VexArchInfo* archinfo,
VexAbiInfo* abiinfo,
- Bool host_bigendian_IN )
+ Bool host_bigendian_IN,
+ Bool sigill_diag_IN )
{
Int i, x1, x2;
Bool expect_CAS, has_CAS;
@@ -31064,7 +31068,7 @@
dres = disInstr_AMD64_WRK ( &expect_CAS, resteerOkFn,
resteerCisOk,
callback_opaque,
- delta, archinfo, abiinfo );
+ delta, archinfo, abiinfo, sigill_diag_IN );
x2 = irsb_IN->stmts_used;
vassert(x2 >= x1);
@@ -31097,7 +31101,7 @@
dres = disInstr_AMD64_WRK ( &expect_CAS, resteerOkFn,
resteerCisOk,
callback_opaque,
- delta, archinfo, abiinfo );
+ delta, archinfo, abiinfo, sigill_diag_IN );
for (i = x1; i < x2; i++) {
vex_printf("\t\t");
ppIRStmt(irsb_IN->stmts[i]);
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_arm_defs.h valgrind-3.8.1/VEX/priv/guest_arm_defs.h
--- valgrind-3.8.1.orig/VEX/priv/guest_arm_defs.h 2012-11-04 21:57:03.790416917 +0100
+++ valgrind-3.8.1/VEX/priv/guest_arm_defs.h 2012-11-04 21:57:36.588887153 +0100
@@ -50,7 +50,8 @@
VexArch guest_arch,
VexArchInfo* archinfo,
VexAbiInfo* abiinfo,
- Bool host_bigendian );
+ Bool host_bigendian,
+ Bool sigill_diag );
/* Used by the optimiser to specialise calls to helpers. */
extern
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_arm_toIR.c valgrind-3.8.1/VEX/priv/guest_arm_toIR.c
--- valgrind-3.8.1.orig/VEX/priv/guest_arm_toIR.c 2012-11-04 21:57:03.787416871 +0100
+++ valgrind-3.8.1/VEX/priv/guest_arm_toIR.c 2012-11-04 21:57:36.812890419 +0100
@@ -12564,7 +12564,8 @@
void* callback_opaque,
UChar* guest_instr,
VexArchInfo* archinfo,
- VexAbiInfo* abiinfo
+ VexAbiInfo* abiinfo,
+ Bool sigill_diag
)
{
// A macro to fish bits out of 'insn'.
@@ -14643,15 +14644,17 @@
decode_failure:
/* All decode failures end up here. */
- vex_printf("disInstr(arm): unhandled instruction: "
- "0x%x\n", insn);
- vex_printf(" cond=%d(0x%x) 27:20=%u(0x%02x) "
- "4:4=%d "
- "3:0=%u(0x%x)\n",
- (Int)INSN_COND, (UInt)INSN_COND,
- (Int)INSN(27,20), (UInt)INSN(27,20),
- (Int)INSN(4,4),
- (Int)INSN(3,0), (UInt)INSN(3,0) );
+ if (sigill_diag) {
+ vex_printf("disInstr(arm): unhandled instruction: "
+ "0x%x\n", insn);
+ vex_printf(" cond=%d(0x%x) 27:20=%u(0x%02x) "
+ "4:4=%d "
+ "3:0=%u(0x%x)\n",
+ (Int)INSN_COND, (UInt)INSN_COND,
+ (Int)INSN(27,20), (UInt)INSN(27,20),
+ (Int)INSN(4,4),
+ (Int)INSN(3,0), (UInt)INSN(3,0) );
+ }
/* Tell the dispatcher that this insn cannot be decoded, and so has
not been executed, and (is currently) the next to be executed.
@@ -14760,7 +14763,8 @@
void* callback_opaque,
UChar* guest_instr,
VexArchInfo* archinfo,
- VexAbiInfo* abiinfo
+ VexAbiInfo* abiinfo,
+ Bool sigill_diag
)
{
/* A macro to fish bits out of insn0. There's also INSN1, to fish
@@ -18746,8 +18750,9 @@
decode_failure:
/* All decode failures end up here. */
- vex_printf("disInstr(thumb): unhandled instruction: "
- "0x%04x 0x%04x\n", (UInt)insn0, (UInt)insn1);
+ if (sigill_diag)
+ vex_printf("disInstr(thumb): unhandled instruction: "
+ "0x%04x 0x%04x\n", (UInt)insn0, (UInt)insn1);
/* Back up ITSTATE to the initial value for this instruction.
If we don't do that, any subsequent restart of the instruction
@@ -18892,7 +18897,8 @@
VexArch guest_arch,
VexArchInfo* archinfo,
VexAbiInfo* abiinfo,
- Bool host_bigendian_IN )
+ Bool host_bigendian_IN,
+ Bool sigill_diag_IN )
{
DisResult dres;
Bool isThumb = (Bool)(guest_IP_ENCODED & 1);
@@ -18914,12 +18920,12 @@
dres = disInstr_THUMB_WRK ( resteerOkFn,
resteerCisOk, callback_opaque,
&guest_code_IN[delta_ENCODED - 1],
- archinfo, abiinfo );
+ archinfo, abiinfo, sigill_diag_IN );
} else {
dres = disInstr_ARM_WRK ( resteerOkFn,
resteerCisOk, callback_opaque,
&guest_code_IN[delta_ENCODED],
- archinfo, abiinfo );
+ archinfo, abiinfo, sigill_diag_IN );
}
return dres;
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_generic_bb_to_IR.c valgrind-3.8.1/VEX/priv/guest_generic_bb_to_IR.c
--- valgrind-3.8.1.orig/VEX/priv/guest_generic_bb_to_IR.c 2012-11-04 21:57:03.790416917 +0100
+++ valgrind-3.8.1/VEX/priv/guest_generic_bb_to_IR.c 2012-11-04 21:57:36.918891974 +0100
@@ -187,6 +187,7 @@
/*IN*/ Addr64 guest_IP_bbstart,
/*IN*/ Bool (*chase_into_ok)(void*,Addr64),
/*IN*/ Bool host_bigendian,
+ /*IN*/ Bool sigill_diag,
/*IN*/ VexArch arch_guest,
/*IN*/ VexArchInfo* archinfo_guest,
/*IN*/ VexAbiInfo* abiinfo_both,
@@ -361,7 +362,8 @@
arch_guest,
archinfo_guest,
abiinfo_both,
- host_bigendian );
+ host_bigendian,
+ sigill_diag );
/* stay sane ... */
vassert(dres.whatNext == Dis_StopHere
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_generic_bb_to_IR.h valgrind-3.8.1/VEX/priv/guest_generic_bb_to_IR.h
--- valgrind-3.8.1.orig/VEX/priv/guest_generic_bb_to_IR.h 2012-11-04 21:57:03.790416917 +0100
+++ valgrind-3.8.1/VEX/priv/guest_generic_bb_to_IR.h 2012-11-04 21:57:36.970892726 +0100
@@ -150,7 +150,10 @@
/*IN*/ VexAbiInfo* abiinfo,
/* Is the host bigendian? */
- /*IN*/ Bool host_bigendian
+ /*IN*/ Bool host_bigendian,
+
+ /* Should diagnostics be printed for illegal instructions? */
+ /*IN*/ Bool sigill_diag
);
@@ -171,6 +174,7 @@
/*IN*/ Addr64 guest_IP_bbstart,
/*IN*/ Bool (*chase_into_ok)(void*,Addr64),
/*IN*/ Bool host_bigendian,
+ /*IN*/ Bool sigill_diag,
/*IN*/ VexArch arch_guest,
/*IN*/ VexArchInfo* archinfo_guest,
/*IN*/ VexAbiInfo* abiinfo_both,
Only in valgrind-3.8.1/VEX/priv: guest_generic_bb_to_IR.h.orig
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_mips_defs.h valgrind-3.8.1/VEX/priv/guest_mips_defs.h
--- valgrind-3.8.1.orig/VEX/priv/guest_mips_defs.h 2012-11-04 21:57:03.790416917 +0100
+++ valgrind-3.8.1/VEX/priv/guest_mips_defs.h 2012-11-04 21:57:36.984892934 +0100
@@ -49,7 +49,8 @@
VexArch guest_arch,
VexArchInfo* archinfo,
VexAbiInfo* abiinfo,
- Bool host_bigendian );
+ Bool host_bigendian,
+ Bool sigill_diag );
/* Used by the optimiser to specialise calls to helpers. */
extern IRExpr *guest_mips32_spechelper(HChar * function_name, IRExpr ** args,
Only in valgrind-3.8.1/VEX/priv: guest_mips_defs.h.orig
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_mips_toIR.c valgrind-3.8.1/VEX/priv/guest_mips_toIR.c
--- valgrind-3.8.1.orig/VEX/priv/guest_mips_toIR.c 2012-11-04 21:57:03.785416840 +0100
+++ valgrind-3.8.1/VEX/priv/guest_mips_toIR.c 2012-11-04 21:57:36.986892956 +0100
@@ -1195,7 +1195,8 @@
void* callback_opaque,
Long delta64,
VexArchInfo* archinfo,
- VexAbiInfo* abiinfo )
+ VexAbiInfo* abiinfo,
+ Bool sigill_diag )
{
IRTemp t0, t1, t2, t3, t4, t5, t6, t7, t8;
UInt opcode, cins, rs, rt, rd, sa, ft, fs, fd, fmt, tf, nd, function,
@@ -3399,12 +3400,13 @@
decode_failure:
/* All decode failures end up here. */
- DIP("vex mips->IR: unhandled instruction bytes: "
- "0x%x 0x%x 0x%x 0x%x\n",
- (Int) getIByte(delta_start + 0),
- (Int) getIByte(delta_start + 1),
- (Int) getIByte(delta_start + 2),
- (Int) getIByte(delta_start + 3));
+ if (sigill_diag)
+ vex_printf("vex mips->IR: unhandled instruction bytes: "
+ "0x%x 0x%x 0x%x 0x%x\n",
+ (Int) getIByte(delta_start + 0),
+ (Int) getIByte(delta_start + 1),
+ (Int) getIByte(delta_start + 2),
+ (Int) getIByte(delta_start + 3));
/* Tell the dispatcher that this insn cannot be decoded, and so has
not been executed, and (is currently) the next to be executed.
@@ -3494,7 +3496,8 @@
VexArch guest_arch,
VexArchInfo* archinfo,
VexAbiInfo* abiinfo,
- Bool host_bigendian_IN)
+ Bool host_bigendian_IN,
+ Bool sigill_diag_IN)
{
DisResult dres;
@@ -3510,7 +3513,7 @@
guest_PC_bbstart = (Addr32) toUInt(guest_IP - delta);
dres = disInstr_MIPS_WRK(resteerOkFn, resteerCisOk, callback_opaque,
- delta, archinfo, abiinfo);
+ delta, archinfo, abiinfo, sigill_diag_IN);
return dres;
}
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_ppc_defs.h valgrind-3.8.1/VEX/priv/guest_ppc_defs.h
--- valgrind-3.8.1.orig/VEX/priv/guest_ppc_defs.h 2012-11-04 21:57:03.782416795 +0100
+++ valgrind-3.8.1/VEX/priv/guest_ppc_defs.h 2012-11-04 21:57:37.030893654 +0100
@@ -57,7 +57,8 @@
VexArch guest_arch,
VexArchInfo* archinfo,
VexAbiInfo* abiinfo,
- Bool host_bigendian );
+ Bool host_bigendian,
+ Bool sigill_diag );
/* Used by the optimiser to specialise calls to helpers. */
extern
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_ppc_toIR.c valgrind-3.8.1/VEX/priv/guest_ppc_toIR.c
--- valgrind-3.8.1.orig/VEX/priv/guest_ppc_toIR.c 2012-11-04 21:57:03.784416825 +0100
+++ valgrind-3.8.1/VEX/priv/guest_ppc_toIR.c 2012-11-04 21:57:37.034893677 +0100
@@ -16475,7 +16475,8 @@
void* callback_opaque,
Long delta64,
VexArchInfo* archinfo,
- VexAbiInfo* abiinfo
+ VexAbiInfo* abiinfo,
+ Bool sigill_diag
)
{
UChar opc1;
@@ -17688,10 +17689,12 @@
decode_failure:
/* All decode failures end up here. */
opc2 = (theInstr) & 0x7FF;
- vex_printf("disInstr(ppc): unhandled instruction: "
- "0x%x\n", theInstr);
- vex_printf(" primary %d(0x%x), secondary %u(0x%x)\n",
- opc1, opc1, opc2, opc2);
+ if (sigill_diag) {
+ vex_printf("disInstr(ppc): unhandled instruction: "
+ "0x%x\n", theInstr);
+ vex_printf(" primary %d(0x%x), secondary %u(0x%x)\n",
+ opc1, opc1, opc2, opc2);
+ }
/* Tell the dispatcher that this insn cannot be decoded, and so has
not been executed, and (is currently) the next to be executed.
@@ -17752,7 +17755,8 @@
VexArch guest_arch,
VexArchInfo* archinfo,
VexAbiInfo* abiinfo,
- Bool host_bigendian_IN )
+ Bool host_bigendian_IN,
+ Bool sigill_diag_IN )
{
IRType ty;
DisResult dres;
@@ -17788,7 +17792,7 @@
guest_CIA_bbstart = mkSzAddr(ty, guest_IP - delta);
dres = disInstr_PPC_WRK ( resteerOkFn, resteerCisOk, callback_opaque,
- delta, archinfo, abiinfo );
+ delta, archinfo, abiinfo, sigill_diag_IN );
return dres;
}
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_s390_defs.h valgrind-3.8.1/VEX/priv/guest_s390_defs.h
--- valgrind-3.8.1.orig/VEX/priv/guest_s390_defs.h 2012-11-04 21:57:03.782416795 +0100
+++ valgrind-3.8.1/VEX/priv/guest_s390_defs.h 2012-11-04 21:57:37.098894575 +0100
@@ -52,7 +52,8 @@
VexArch guest_arch,
VexArchInfo* archinfo,
VexAbiInfo* abiinfo,
- Bool host_bigendian );
+ Bool host_bigendian,
+ Bool sigill_diag );
/* Used by the optimiser to specialise calls to helpers. */
IRExpr* guest_s390x_spechelper ( HChar *function_name,
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_s390_toIR.c valgrind-3.8.1/VEX/priv/guest_s390_toIR.c
--- valgrind-3.8.1.orig/VEX/priv/guest_s390_toIR.c 2012-11-04 21:57:03.789416902 +0100
+++ valgrind-3.8.1/VEX/priv/guest_s390_toIR.c 2012-11-04 21:57:37.102894640 +0100
@@ -73,6 +73,9 @@
static Bool (*resteer_fn)(void *, Addr64);
static void *resteer_data;
+/* Whether to print diagnostics for illegal instructions. */
+static Bool sigill_diag;
+
/* The last seen execute target instruction */
ULong last_execute_target;
@@ -14143,34 +14146,36 @@
if (status == S390_DECODE_OK) return insn_length; /* OK */
/* Decoding failed somehow */
- vex_printf("vex s390->IR: ");
- switch (status) {
- case S390_DECODE_UNKNOWN_INSN:
- vex_printf("unknown insn: ");
- break;
+ if (sigill_diag) {
+ vex_printf("vex s390->IR: ");
+ switch (status) {
+ case S390_DECODE_UNKNOWN_INSN:
+ vex_printf("unknown insn: ");
+ break;
- case S390_DECODE_UNIMPLEMENTED_INSN:
- vex_printf("unimplemented insn: ");
- break;
+ case S390_DECODE_UNIMPLEMENTED_INSN:
+ vex_printf("unimplemented insn: ");
+ break;
- case S390_DECODE_UNKNOWN_SPECIAL_INSN:
- vex_printf("unimplemented special insn: ");
- break;
+ case S390_DECODE_UNKNOWN_SPECIAL_INSN:
+ vex_printf("unimplemented special insn: ");
+ break;
- default:
- case S390_DECODE_ERROR:
- vex_printf("decoding error: ");
- break;
- }
+ default:
+ case S390_DECODE_ERROR:
+ vex_printf("decoding error: ");
+ break;
+ }
- vex_printf("%02x%02x", bytes[0], bytes[1]);
- if (insn_length > 2) {
- vex_printf(" %02x%02x", bytes[2], bytes[3]);
- }
- if (insn_length > 4) {
- vex_printf(" %02x%02x", bytes[4], bytes[5]);
+ vex_printf("%02x%02x", bytes[0], bytes[1]);
+ if (insn_length > 2) {
+ vex_printf(" %02x%02x", bytes[2], bytes[3]);
+ }
+ if (insn_length > 4) {
+ vex_printf(" %02x%02x", bytes[4], bytes[5]);
+ }
+ vex_printf("\n");
}
- vex_printf("\n");
return 0; /* Failed */
}
@@ -14261,7 +14266,8 @@
VexArch guest_arch,
VexArchInfo *archinfo,
VexAbiInfo *abiinfo,
- Bool host_bigendian)
+ Bool host_bigendian,
+ Bool sigill_diag_IN)
{
vassert(guest_arch == VexArchS390X);
@@ -14273,6 +14279,7 @@
irsb = irsb_IN;
resteer_fn = resteerOkFn;
resteer_data = callback_opaque;
+ sigill_diag = sigill_diag_IN;
return disInstr_S390_WRK(guest_code + delta);
}
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_x86_defs.h valgrind-3.8.1/VEX/priv/guest_x86_defs.h
--- valgrind-3.8.1.orig/VEX/priv/guest_x86_defs.h 2012-11-04 21:57:03.782416795 +0100
+++ valgrind-3.8.1/VEX/priv/guest_x86_defs.h 2012-11-04 21:57:37.169895603 +0100
@@ -56,7 +56,8 @@
VexArch guest_arch,
VexArchInfo* archinfo,
VexAbiInfo* abiinfo,
- Bool host_bigendian );
+ Bool host_bigendian,
+ Bool sigill_diag );
/* Used by the optimiser to specialise calls to helpers. */
extern
diff -ur valgrind-3.8.1.orig/VEX/priv/guest_x86_toIR.c valgrind-3.8.1/VEX/priv/guest_x86_toIR.c
--- valgrind-3.8.1.orig/VEX/priv/guest_x86_toIR.c 2012-11-04 21:57:03.790416917 +0100
+++ valgrind-3.8.1/VEX/priv/guest_x86_toIR.c 2012-11-04 21:57:37.176895720 +0100
@@ -7927,7 +7927,8 @@
void* callback_opaque,
Long delta64,
VexArchInfo* archinfo,
- VexAbiInfo* vbi
+ VexAbiInfo* vbi,
+ Bool sigill_diag
)
{
IRType ty;
@@ -15157,12 +15158,14 @@
default:
decode_failure:
/* All decode failures end up here. */
- vex_printf("vex x86->IR: unhandled instruction bytes: "
- "0x%x 0x%x 0x%x 0x%x\n",
- (Int)getIByte(delta_start+0),
- (Int)getIByte(delta_start+1),
- (Int)getIByte(delta_start+2),
- (Int)getIByte(delta_start+3) );
+ if (sigill_diag) {
+ vex_printf("vex x86->IR: unhandled instruction bytes: "
+ "0x%x 0x%x 0x%x 0x%x\n",
+ (Int)getIByte(delta_start+0),
+ (Int)getIByte(delta_start+1),
+ (Int)getIByte(delta_start+2),
+ (Int)getIByte(delta_start+3) );
+ }
/* Tell the dispatcher that this insn cannot be decoded, and so has
not been executed, and (is currently) the next to be executed.
@@ -15225,7 +15228,8 @@
VexArch guest_arch,
VexArchInfo* archinfo,
VexAbiInfo* abiinfo,
- Bool host_bigendian_IN )
+ Bool host_bigendian_IN,
+ Bool sigill_diag_IN )
{
Int i, x1, x2;
Bool expect_CAS, has_CAS;
@@ -15244,7 +15248,7 @@
dres = disInstr_X86_WRK ( &expect_CAS, resteerOkFn,
resteerCisOk,
callback_opaque,
- delta, archinfo, abiinfo );
+ delta, archinfo, abiinfo, sigill_diag_IN );
x2 = irsb_IN->stmts_used;
vassert(x2 >= x1);
@@ -15264,7 +15268,7 @@
dres = disInstr_X86_WRK ( &expect_CAS, resteerOkFn,
resteerCisOk,
callback_opaque,
- delta, archinfo, abiinfo );
+ delta, archinfo, abiinfo, sigill_diag_IN );
for (i = x1; i < x2; i++) {
vex_printf("\t\t");
ppIRStmt(irsb_IN->stmts[i]);
Only in valgrind-3.8.1/VEX/priv: guest_x86_toIR.c.orig
diff -ur valgrind-3.8.1.orig/VEX/priv/main_main.c valgrind-3.8.1/VEX/priv/main_main.c
--- valgrind-3.8.1.orig/VEX/priv/main_main.c 2012-11-04 21:57:03.784416825 +0100
+++ valgrind-3.8.1/VEX/priv/main_main.c 2012-11-04 21:57:37.247896750 +0100
@@ -605,6 +605,7 @@
vta->guest_bytes_addr,
vta->chase_into_ok,
host_is_bigendian,
+ vta->sigill_diag,
vta->arch_guest,
&vta->archinfo_guest,
&vta->abiinfo_both,
diff -ur valgrind-3.8.1.orig/VEX/pub/libvex.h valgrind-3.8.1/VEX/pub/libvex.h
--- valgrind-3.8.1.orig/VEX/pub/libvex.h 2012-11-04 21:57:03.781416780 +0100
+++ valgrind-3.8.1/VEX/pub/libvex.h 2012-11-04 21:57:37.248896764 +0100
@@ -622,6 +622,9 @@
/* IN: debug: trace vex activity at various points */
Int traceflags;
+ /* IN: debug: print diagnostics when an illegal instr is detected */
+ Bool sigill_diag;
+
/* IN: profiling: add a 64 bit profiler counter increment to the
translation? */
Bool addProfInc;

View File

@ -1,743 +0,0 @@
commit 81d24c396c66dde7db2d9b567451f99081a2eab7
Author: philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Wed Dec 5 21:08:24 2012 +0000
fix 310424 --read-var-info does not properly describe static variables
This patch changes the way static variables are
recorded by readdwarf3.c (when giving --read-var-info=yes),
improving the way such variables are described.
Currently:
A static variable does not have the DW_AT_external tag.
So, readdwarf3.c does not consider it a global variable.
It is rather considered a "local" variable.
When it is recorded, it is associated to a range of program counters
(the functions in the file where it is visible).
However, even if the static variable is only visible
in the source file where it is declared, it can in reality
be used by any range of program counters, typically
by having the address of the local variable passed
to other functions.
Such local variable can then only be described
when the program counter is in the range of program
counters for which it has been recorded.
However, this (local) description is obtained
by a kludge in debuginfo.c (around line 3285).
This kludge then produces a strange description,
telling that the variable has been declared in
frame 0 of a thread (see second example below).
The kludge is not always able to describe
the address (if the IP of the tid is in another file than
where the variable has been declared).
I suspect the kludge can sometimes describe the var as being
declared in an unrelated thread
(e.g. if an error is triggered by tid 5, but tid1 is by
luck in an IP corresponding to the recorded range).
The patch changes the way a static variable is recorded:
if DW_AT_external tag is found, a variable is marked as global.
If a variable is not external, but is seen when level is 1,
then we record the variable as a global variable (i.e.
with a full IP range).
This improves the way such static variable are described:
* they are described even if being accessed by other files.
* their description is not in an artificial "thread frame".
First example:
**************
a variable cannot be described because it is
accessed by a function in another file:
with the trunk:
==20410== ----------------------------------------------------------------
==20410==
==20410== Possible data race during read of size 4 at 0x600F54 by thread #1
==20410== Locks held: none
==20410== at 0x4007E4: a (abc.c:42)
==20410== by 0x4006BC: main (mabc.c:24)
==20410==
==20410== This conflicts with a previous write of size 4 by thread #2
==20410== Locks held: none
==20410== at 0x4007ED: a (abc.c:42)
==20410== by 0x400651: brussels_fn (mabc.c:9)
==20410== by 0x4C2B54E: mythread_wrapper (hg_intercepts.c:219)
==20410== by 0x4E348C9: start_thread (pthread_create.c:300)
==20410==
==20410== ----------------------------------------------------------------
with the patch:
==4515== ----------------------------------------------------------------
==4515==
==4515== Possible data race during read of size 4 at 0x600F54 by thread #1
==4515== Locks held: none
==4515== at 0x4007E4: a (abc.c:42)
==4515== by 0x4006BC: main (mabc.c:24)
==4515==
==4515== This conflicts with a previous write of size 4 by thread #2
==4515== Locks held: none
==4515== at 0x4007ED: a (abc.c:42)
==4515== by 0x400651: brussels_fn (mabc.c:9)
==4515== by 0x4C2B54E: mythread_wrapper (hg_intercepts.c:219)
==4515== by 0x4E348C9: start_thread (pthread_create.c:300)
==4515==
==4515== Location 0x600f54 is 0 bytes inside global var "static_global"
==4515== declared at mabc.c:4
==4515==
==4515== ----------------------------------------------------------------
Second example:
***************
When the kludge can describe the variable, it is strangely described
as being declared in a frame of a thread, while for sure the declaration
has nothing to do with a thread
With the trunk:
==20410== Location 0x600f68 is 0 bytes inside local var "static_global_a"
==20410== declared at abc.c:3, in frame #0 of thread 1
With the patch:
==4515== Location 0x600f68 is 0 bytes inside global var "static_global_a"
==4515== declared at abc.c:3
#include <stdio.h>
static int static_global_a = 0; //// <<<< this is abc.c:3
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13153 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c
index 59f920d..d3b8ef4 100644
--- a/coregrind/m_debuginfo/debuginfo.c
+++ b/coregrind/m_debuginfo/debuginfo.c
@@ -3282,28 +3282,6 @@ Bool VG_(get_data_description)(
in the stacks of all the threads. First try to figure out which
thread's stack data_addr is in. */
- /* --- KLUDGE --- Try examining the top frame of all thread stacks.
- This finds variables which are not stack allocated but are not
- globally visible either; specifically it appears to pick up
- variables which are visible only within a compilation unit.
- These will have the address range of the compilation unit and
- tend to live at Scope level 1. */
- VG_(thread_stack_reset_iter)(&tid);
- while ( VG_(thread_stack_next)(&tid, &stack_min, &stack_max) ) {
- if (stack_min >= stack_max)
- continue; /* ignore obviously stupid cases */
- if (consider_vars_in_frame( dname1, dname2,
- data_addr,
- VG_(get_IP)(tid),
- VG_(get_SP)(tid),
- VG_(get_FP)(tid), tid, 0 )) {
- zterm_XA( dname1 );
- zterm_XA( dname2 );
- return True;
- }
- }
- /* --- end KLUDGE --- */
-
/* Perhaps it's on a thread's stack? */
found = False;
VG_(thread_stack_reset_iter)(&tid);
@@ -3328,9 +3306,6 @@ Bool VG_(get_data_description)(
n_frames = VG_(get_StackTrace)( tid, ips, N_FRAMES,
sps, fps, 0/*first_ip_delta*/ );
- /* As a result of KLUDGE above, starting the loop at j = 0
- duplicates examination of the top frame and so isn't necessary.
- Oh well. */
vg_assert(n_frames >= 0 && n_frames <= N_FRAMES);
for (j = 0; j < n_frames; j++) {
if (consider_vars_in_frame( dname1, dname2,
diff --git a/drd/tests/annotate_ignore_rw.stderr.exp b/drd/tests/annotate_ignore_rw.stderr.exp
index 24684da..416be80 100644
--- a/drd/tests/annotate_ignore_rw.stderr.exp
+++ b/drd/tests/annotate_ignore_rw.stderr.exp
@@ -1,8 +1,8 @@
Conflicting load by thread 1 at 0x........ size 1
at 0x........: main (annotate_ignore_rw.c:?)
-Location 0x........ is 0 bytes inside local var "s_c"
-declared at annotate_ignore_rw.c:12, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_c"
+declared at annotate_ignore_rw.c:12
Finished.
diff --git a/drd/tests/annotate_ignore_rw2.stderr.exp b/drd/tests/annotate_ignore_rw2.stderr.exp
index ffdb76f..4e96bf3 100644
--- a/drd/tests/annotate_ignore_rw2.stderr.exp
+++ b/drd/tests/annotate_ignore_rw2.stderr.exp
@@ -1,18 +1,18 @@
Conflicting load by thread 1 at 0x........ size 1
at 0x........: main (annotate_ignore_rw.c:?)
-Location 0x........ is 0 bytes inside local var "s_b"
-declared at annotate_ignore_rw.c:11, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_b"
+declared at annotate_ignore_rw.c:11
Conflicting store by thread 1 at 0x........ size 1
at 0x........: main (annotate_ignore_rw.c:?)
-Location 0x........ is 0 bytes inside local var "s_a"
-declared at annotate_ignore_rw.c:10, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_a"
+declared at annotate_ignore_rw.c:10
Conflicting load by thread 1 at 0x........ size 1
at 0x........: main (annotate_ignore_rw.c:?)
-Location 0x........ is 0 bytes inside local var "s_c"
-declared at annotate_ignore_rw.c:12, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_c"
+declared at annotate_ignore_rw.c:12
Finished.
diff --git a/drd/tests/annotate_ignore_write.stderr.exp b/drd/tests/annotate_ignore_write.stderr.exp
index f26242e..2204d5b 100644
--- a/drd/tests/annotate_ignore_write.stderr.exp
+++ b/drd/tests/annotate_ignore_write.stderr.exp
@@ -1,18 +1,18 @@
Conflicting load by thread 1 at 0x........ size 1
at 0x........: main (annotate_ignore_write.c:?)
-Location 0x........ is 0 bytes inside local var "s_b"
-declared at annotate_ignore_write.c:11, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_b"
+declared at annotate_ignore_write.c:11
Conflicting load by thread 1 at 0x........ size 1
at 0x........: main (annotate_ignore_write.c:?)
-Location 0x........ is 0 bytes inside local var "s_c"
-declared at annotate_ignore_write.c:12, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_c"
+declared at annotate_ignore_write.c:12
Conflicting store by thread 1 at 0x........ size 1
at 0x........: main (annotate_ignore_write.c:?)
-Location 0x........ is 0 bytes inside local var "s_a"
-declared at annotate_ignore_write.c:10, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_a"
+declared at annotate_ignore_write.c:10
Finished.
diff --git a/drd/tests/annotate_ignore_write2.stderr.exp b/drd/tests/annotate_ignore_write2.stderr.exp
index 03c7766..9b58325 100644
--- a/drd/tests/annotate_ignore_write2.stderr.exp
+++ b/drd/tests/annotate_ignore_write2.stderr.exp
@@ -1,23 +1,23 @@
Conflicting load by thread 1 at 0x........ size 1
at 0x........: main (annotate_ignore_write.c:?)
-Location 0x........ is 0 bytes inside local var "s_b"
-declared at annotate_ignore_write.c:11, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_b"
+declared at annotate_ignore_write.c:11
Conflicting store by thread 1 at 0x........ size 1
at 0x........: main (annotate_ignore_write.c:?)
-Location 0x........ is 0 bytes inside local var "s_a"
-declared at annotate_ignore_write.c:10, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_a"
+declared at annotate_ignore_write.c:10
Conflicting load by thread 1 at 0x........ size 1
at 0x........: main (annotate_ignore_write.c:?)
-Location 0x........ is 0 bytes inside local var "s_c"
-declared at annotate_ignore_write.c:12, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_c"
+declared at annotate_ignore_write.c:12
Conflicting store by thread 1 at 0x........ size 1
at 0x........: main (annotate_ignore_write.c:?)
-Location 0x........ is 0 bytes inside local var "s_a"
-declared at annotate_ignore_write.c:10, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_a"
+declared at annotate_ignore_write.c:10
Finished.
diff --git a/drd/tests/atomic_var.stderr.exp b/drd/tests/atomic_var.stderr.exp
index 7fa1e0e..ad05687 100644
--- a/drd/tests/atomic_var.stderr.exp
+++ b/drd/tests/atomic_var.stderr.exp
@@ -3,8 +3,8 @@ Start of test.
Conflicting load by thread x at 0x........ size 4
at 0x........: thread_func_2 (atomic_var.c:?)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
-Location 0x........ is 0 bytes inside local var "s_y"
-declared at atomic_var.c:35, in frame #? of thread x
+Location 0x........ is 0 bytes inside global var "s_y"
+declared at atomic_var.c:35
y = 1
Test finished.
diff --git a/drd/tests/fp_race.stderr.exp b/drd/tests/fp_race.stderr.exp
index 23873d2..68bd254 100644
--- a/drd/tests/fp_race.stderr.exp
+++ b/drd/tests/fp_race.stderr.exp
@@ -1,8 +1,8 @@
Conflicting load by thread 1 at 0x........ size 8
at 0x........: main (fp_race.c:?)
-Location 0x........ is 0 bytes inside local var "s_d3"
-declared at fp_race.c:24, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_d3"
+declared at fp_race.c:24
Other segment start (thread 2)
(thread finished, call stack no longer available)
Other segment end (thread 2)
@@ -10,8 +10,8 @@ Other segment end (thread 2)
Conflicting store by thread 1 at 0x........ size 8
at 0x........: main (fp_race.c:?)
-Location 0x........ is 0 bytes inside local var "s_d3"
-declared at fp_race.c:24, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_d3"
+declared at fp_race.c:24
Other segment start (thread 2)
(thread finished, call stack no longer available)
Other segment end (thread 2)
diff --git a/drd/tests/fp_race_xml.stderr.exp b/drd/tests/fp_race_xml.stderr.exp
index 73a530e..05ffe71 100644
--- a/drd/tests/fp_race_xml.stderr.exp
+++ b/drd/tests/fp_race_xml.stderr.exp
@@ -48,8 +48,8 @@
<line>...</line>
</frame>
</stack>
- <auxwhat>Location 0x........ is 0 bytes inside local var "s_d3"</auxwhat>
- <xauxwhat><text>declared at fp_race.c:24, in frame #? of thread x</text> <file>fp_race.c</file> <line>...</line> </xauxwhat>
+ <auxwhat>Location 0x........ is 0 bytes inside global var "s_d3"</auxwhat>
+ <xauxwhat><text>declared at fp_race.c:24</text> <file>fp_race.c</file> <line>...</line> </xauxwhat>
<other_segment_start>
</other_segment_start>
<other_segment_end>
@@ -71,8 +71,8 @@
<line>...</line>
</frame>
</stack>
- <auxwhat>Location 0x........ is 0 bytes inside local var "s_d3"</auxwhat>
- <xauxwhat><text>declared at fp_race.c:24, in frame #? of thread x</text> <file>fp_race.c</file> <line>...</line> </xauxwhat>
+ <auxwhat>Location 0x........ is 0 bytes inside global var "s_d3"</auxwhat>
+ <xauxwhat><text>declared at fp_race.c:24</text> <file>fp_race.c</file> <line>...</line> </xauxwhat>
<other_segment_start>
</other_segment_start>
<other_segment_end>
diff --git a/drd/tests/hg03_inherit.stderr.exp b/drd/tests/hg03_inherit.stderr.exp
index 62a8d5d..72eb236 100644
--- a/drd/tests/hg03_inherit.stderr.exp
+++ b/drd/tests/hg03_inherit.stderr.exp
@@ -4,13 +4,13 @@ Conflicting store by thread 3 at 0x........ size 4
at 0x........: t2 (hg03_inherit.c:28)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
Location 0x........ is 0 bytes inside shared[1],
-declared at hg03_inherit.c:11, in frame #? of thread 3
+a global variable declared at hg03_inherit.c:11
Conflicting store by thread 3 at 0x........ size 4
at 0x........: t2 (hg03_inherit.c:29)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
Location 0x........ is 0 bytes inside shared[1],
-declared at hg03_inherit.c:11, in frame #? of thread 3
+a global variable declared at hg03_inherit.c:11
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
diff --git a/drd/tests/hg04_race.stderr.exp b/drd/tests/hg04_race.stderr.exp
index 9ea3ccd..5b5969c 100644
--- a/drd/tests/hg04_race.stderr.exp
+++ b/drd/tests/hg04_race.stderr.exp
@@ -3,8 +3,8 @@ Thread 3:
Conflicting load by thread 3 at 0x........ size 4
at 0x........: th (hg04_race.c:10)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
-Location 0x........ is 0 bytes inside local var "shared"
-declared at hg04_race.c:6, in frame #? of thread 2
+Location 0x........ is 0 bytes inside global var "shared"
+declared at hg04_race.c:6
Other segment start (thread 2)
(thread finished, call stack no longer available)
Other segment end (thread 2)
@@ -13,8 +13,8 @@ Other segment end (thread 2)
Conflicting store by thread 3 at 0x........ size 4
at 0x........: th (hg04_race.c:10)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
-Location 0x........ is 0 bytes inside local var "shared"
-declared at hg04_race.c:6, in frame #? of thread 2
+Location 0x........ is 0 bytes inside global var "shared"
+declared at hg04_race.c:6
Other segment start (thread 2)
(thread finished, call stack no longer available)
Other segment end (thread 2)
diff --git a/drd/tests/rwlock_race.stderr.exp b/drd/tests/rwlock_race.stderr.exp
index 8350b50..d3e0b37 100644
--- a/drd/tests/rwlock_race.stderr.exp
+++ b/drd/tests/rwlock_race.stderr.exp
@@ -2,14 +2,14 @@
Conflicting load by thread x at 0x........ size 4
at 0x........: thread_func (rwlock_race.c:?)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
-Location 0x........ is 0 bytes inside local var "s_racy"
-declared at rwlock_race.c:18, in frame #? of thread x
+Location 0x........ is 0 bytes inside global var "s_racy"
+declared at rwlock_race.c:18
Conflicting store by thread x at 0x........ size 4
at 0x........: thread_func (rwlock_race.c:?)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
-Location 0x........ is 0 bytes inside local var "s_racy"
-declared at rwlock_race.c:18, in frame #? of thread x
+Location 0x........ is 0 bytes inside global var "s_racy"
+declared at rwlock_race.c:18
Result: 2
diff --git a/drd/tests/sem_as_mutex.stderr.exp b/drd/tests/sem_as_mutex.stderr.exp
index 1646a6c..1fbd91a 100644
--- a/drd/tests/sem_as_mutex.stderr.exp
+++ b/drd/tests/sem_as_mutex.stderr.exp
@@ -1,8 +1,8 @@
Conflicting load by thread 1 at 0x........ size 8
at 0x........: main (sem_as_mutex.c:?)
-Location 0x........ is 0 bytes inside local var "s_d3"
-declared at sem_as_mutex.c:25, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_d3"
+declared at sem_as_mutex.c:25
Other segment start (thread 2)
(thread finished, call stack no longer available)
Other segment end (thread 2)
@@ -10,8 +10,8 @@ Other segment end (thread 2)
Conflicting store by thread 1 at 0x........ size 8
at 0x........: main (sem_as_mutex.c:?)
-Location 0x........ is 0 bytes inside local var "s_d3"
-declared at sem_as_mutex.c:25, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_d3"
+declared at sem_as_mutex.c:25
Other segment start (thread 2)
(thread finished, call stack no longer available)
Other segment end (thread 2)
diff --git a/drd/tests/sem_as_mutex3.stderr.exp b/drd/tests/sem_as_mutex3.stderr.exp
index 97b09a1..efd47ff 100644
--- a/drd/tests/sem_as_mutex3.stderr.exp
+++ b/drd/tests/sem_as_mutex3.stderr.exp
@@ -1,8 +1,8 @@
Conflicting load by thread 1 at 0x........ size 8
at 0x........: main (sem_as_mutex.c:?)
-Location 0x........ is 0 bytes inside local var "s_d3"
-declared at sem_as_mutex.c:25, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_d3"
+declared at sem_as_mutex.c:25
Other segment start (thread 2)
(thread finished, call stack no longer available)
Other segment end (thread 2)
diff --git a/drd/tests/sem_open.stderr.exp b/drd/tests/sem_open.stderr.exp
index 4e769e5..e926d05 100644
--- a/drd/tests/sem_open.stderr.exp
+++ b/drd/tests/sem_open.stderr.exp
@@ -1,8 +1,8 @@
Conflicting load by thread 1 at 0x........ size 8
at 0x........: main (sem_open.c:?)
-Location 0x........ is 0 bytes inside local var "s_d3"
-declared at sem_open.c:25, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_d3"
+declared at sem_open.c:25
Other segment start (thread 2)
(thread finished, call stack no longer available)
Other segment end (thread 2)
@@ -10,8 +10,8 @@ Other segment end (thread 2)
Conflicting store by thread 1 at 0x........ size 8
at 0x........: main (sem_open.c:?)
-Location 0x........ is 0 bytes inside local var "s_d3"
-declared at sem_open.c:25, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_d3"
+declared at sem_open.c:25
Other segment start (thread 2)
(thread finished, call stack no longer available)
Other segment end (thread 2)
diff --git a/drd/tests/sem_open3.stderr.exp b/drd/tests/sem_open3.stderr.exp
index 3c2d392..fb994f5 100644
--- a/drd/tests/sem_open3.stderr.exp
+++ b/drd/tests/sem_open3.stderr.exp
@@ -1,8 +1,8 @@
Conflicting load by thread 1 at 0x........ size 8
at 0x........: main (sem_open.c:?)
-Location 0x........ is 0 bytes inside local var "s_d3"
-declared at sem_open.c:25, in frame #? of thread 1
+Location 0x........ is 0 bytes inside global var "s_d3"
+declared at sem_open.c:25
Other segment start (thread 2)
(thread finished, call stack no longer available)
Other segment end (thread 2)
diff --git a/helgrind/tests/hg03_inherit.stderr.exp b/helgrind/tests/hg03_inherit.stderr.exp
index 1c4a91e..ee21cf0 100644
--- a/helgrind/tests/hg03_inherit.stderr.exp
+++ b/helgrind/tests/hg03_inherit.stderr.exp
@@ -24,7 +24,7 @@ Locks held: none
at 0x........: main (hg03_inherit.c:60)
Location 0x........ is 0 bytes inside shared[1],
-declared at hg03_inherit.c:11, in frame #x of thread x
+a global variable declared at hg03_inherit.c:11
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
diff --git a/helgrind/tests/hg04_race.stderr.exp b/helgrind/tests/hg04_race.stderr.exp
index 982f940..bf2a185 100644
--- a/helgrind/tests/hg04_race.stderr.exp
+++ b/helgrind/tests/hg04_race.stderr.exp
@@ -29,8 +29,8 @@ Locks held: none
by 0x........: mythread_wrapper (hg_intercepts.c:...)
...
-Location 0x........ is 0 bytes inside local var "shared"
-declared at hg04_race.c:6, in frame #x of thread x
+Location 0x........ is 0 bytes inside global var "shared"
+declared at hg04_race.c:6
----------------------------------------------------------------
@@ -46,8 +46,8 @@ Locks held: none
by 0x........: mythread_wrapper (hg_intercepts.c:...)
...
-Location 0x........ is 0 bytes inside local var "shared"
-declared at hg04_race.c:6, in frame #x of thread x
+Location 0x........ is 0 bytes inside global var "shared"
+declared at hg04_race.c:6
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
diff --git a/helgrind/tests/rwlock_race.stderr.exp b/helgrind/tests/rwlock_race.stderr.exp
index 4a44713..47c3bd5 100644
--- a/helgrind/tests/rwlock_race.stderr.exp
+++ b/helgrind/tests/rwlock_race.stderr.exp
@@ -29,8 +29,8 @@ Locks held: none
by 0x........: mythread_wrapper (hg_intercepts.c:...)
...
-Location 0x........ is 0 bytes inside local var "s_racy"
-declared at rwlock_race.c:18, in frame #x of thread x
+Location 0x........ is 0 bytes inside global var "s_racy"
+declared at rwlock_race.c:18
Result: 2
diff --git a/helgrind/tests/tc21_pthonce.stderr.exp b/helgrind/tests/tc21_pthonce.stderr.exp
index 3e7d241..700b492 100644
--- a/helgrind/tests/tc21_pthonce.stderr.exp
+++ b/helgrind/tests/tc21_pthonce.stderr.exp
@@ -29,8 +29,8 @@ Locks held: none
by 0x........: mythread_wrapper (hg_intercepts.c:...)
...
-Location 0x........ is 0 bytes inside local var "unprotected2"
-declared at tc21_pthonce.c:51, in frame #x of thread x
+Location 0x........ is 0 bytes inside global var "unprotected2"
+declared at tc21_pthonce.c:51
----------------------------------------------------------------
@@ -46,8 +46,8 @@ Locks held: none
by 0x........: mythread_wrapper (hg_intercepts.c:...)
...
-Location 0x........ is 0 bytes inside local var "unprotected2"
-declared at tc21_pthonce.c:51, in frame #x of thread x
+Location 0x........ is 0 bytes inside global var "unprotected2"
+declared at tc21_pthonce.c:51
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
diff --git a/memcheck/tests/varinfo3.stderr.exp b/memcheck/tests/varinfo3.stderr.exp
index d24ddb8..73130b7 100644
--- a/memcheck/tests/varinfo3.stderr.exp
+++ b/memcheck/tests/varinfo3.stderr.exp
@@ -3,7 +3,7 @@ Uninitialised byte(s) found during client check request
by 0x........: foo (varinfo3.c:54)
by 0x........: main (varinfo3.c:66)
Location 0x........ is 0 bytes inside static_global_def[1],
- declared at varinfo3.c:35, in frame #0 of thread 1
+ a global variable declared at varinfo3.c:35
Uninitialised byte(s) found during client check request
at 0x........: croak (varinfo3.c:28)
@@ -17,7 +17,7 @@ Uninitialised byte(s) found during client check request
by 0x........: foo (varinfo3.c:56)
by 0x........: main (varinfo3.c:66)
Location 0x........ is 0 bytes inside static_global_undef[3],
- declared at varinfo3.c:37, in frame #0 of thread 1
+ a global variable declared at varinfo3.c:37
Uninitialised byte(s) found during client check request
at 0x........: croak (varinfo3.c:28)
diff --git a/memcheck/tests/varinfo3.stderr.exp-ppc64 b/memcheck/tests/varinfo3.stderr.exp-ppc64
index e02a3c8..8dff370 100644
--- a/memcheck/tests/varinfo3.stderr.exp-ppc64
+++ b/memcheck/tests/varinfo3.stderr.exp-ppc64
@@ -3,7 +3,7 @@ Uninitialised byte(s) found during client check request
by 0x........: foo (varinfo3.c:54)
by 0x........: main (varinfo3.c:66)
Location 0x........ is 0 bytes inside static_global_def[1],
- declared at varinfo3.c:35, in frame #0 of thread 1
+ a global variable declared at varinfo3.c:35
Uninitialised byte(s) found during client check request
at 0x........: croak (varinfo3.c:29)
@@ -17,7 +17,7 @@ Uninitialised byte(s) found during client check request
by 0x........: foo (varinfo3.c:56)
by 0x........: main (varinfo3.c:66)
Location 0x........ is 0 bytes inside static_global_undef[3],
- declared at varinfo3.c:37, in frame #0 of thread 1
+ a global variable declared at varinfo3.c:37
Uninitialised byte(s) found during client check request
at 0x........: croak (varinfo3.c:29)
diff --git a/memcheck/tests/varinfo5.stderr.exp b/memcheck/tests/varinfo5.stderr.exp
index 3be0984..5fa9d97 100644
--- a/memcheck/tests/varinfo5.stderr.exp
+++ b/memcheck/tests/varinfo5.stderr.exp
@@ -83,7 +83,7 @@ Uninitialised byte(s) found during client check request
by 0x........: varinfo5_main (varinfo5so.c:156)
by 0x........: main (varinfo5.c:5)
Location 0x........ is 0 bytes inside static_global_def[1],
- declared at varinfo5so.c:87, in frame #0 of thread 1
+ a global variable declared at varinfo5so.c:87
Uninitialised byte(s) found during client check request
at 0x........: croak (varinfo5so.c:29)
@@ -101,7 +101,7 @@ Uninitialised byte(s) found during client check request
by 0x........: varinfo5_main (varinfo5so.c:156)
by 0x........: main (varinfo5.c:5)
Location 0x........ is 0 bytes inside static_global_undef[3],
- declared at varinfo5so.c:89, in frame #0 of thread 1
+ a global variable declared at varinfo5so.c:89
Uninitialised byte(s) found during client check request
at 0x........: croak (varinfo5so.c:29)
diff --git a/memcheck/tests/varinfo5.stderr.exp-ppc64 b/memcheck/tests/varinfo5.stderr.exp-ppc64
index db0c4fd..f5ebf0b 100644
--- a/memcheck/tests/varinfo5.stderr.exp-ppc64
+++ b/memcheck/tests/varinfo5.stderr.exp-ppc64
@@ -83,7 +83,7 @@ Uninitialised byte(s) found during client check request
by 0x........: varinfo5_main (varinfo5so.c:156)
by 0x........: main (varinfo5.c:5)
Location 0x........ is 0 bytes inside static_global_def[1],
- declared at varinfo5so.c:87, in frame #0 of thread 1
+ a global variable declared at varinfo5so.c:87
Uninitialised byte(s) found during client check request
at 0x........: croak (varinfo5so.c:30)
@@ -101,7 +101,7 @@ Uninitialised byte(s) found during client check request
by 0x........: varinfo5_main (varinfo5so.c:156)
by 0x........: main (varinfo5.c:5)
Location 0x........ is 0 bytes inside static_global_undef[3],
- declared at varinfo5so.c:89, in frame #0 of thread 1
+ a global variable declared at varinfo5so.c:89
Uninitialised byte(s) found during client check request
at 0x........: croak (varinfo5so.c:30)
--- valgrind-3.8.1/coregrind/m_debuginfo/readdwarf3.c.orig 2012-08-17 08:59:56.000000000 +0200
+++ valgrind-3.8.1/coregrind/m_debuginfo/readdwarf3.c 2013-02-19 15:39:55.965382081 +0100
@@ -1853,7 +1853,7 @@
if (dtag == DW_TAG_variable || dtag == DW_TAG_formal_parameter) {
UChar* name = NULL;
UWord typeR = D3_INVALID_CUOFF;
- Bool external = False;
+ Bool global = False;
GExpr* gexpr = NULL;
Int n_attrs = 0;
UWord abs_ori = (UWord)D3_INVALID_CUOFF;
@@ -1880,7 +1880,7 @@
typeR = cook_die_using_form( cc, (UWord)cts, form );
}
if (attr == DW_AT_external && ctsSzB > 0 && cts > 0) {
- external = True;
+ global = True;
}
if (attr == DW_AT_abstract_origin && ctsSzB > 0) {
abs_ori = (UWord)cts;
@@ -1902,6 +1902,14 @@
if (0) VG_(printf)("XXX filename = %s\n", fileName);
}
}
+ if (!global && dtag == DW_TAG_variable && level == 1) {
+ /* Case of a static variable. It is better to declare
+ it global as the variable is not really related to
+ a PC range, as its address can be used by program
+ counters outside of the ranges where it is visible . */
+ global = True;
+ }
+
/* We'll collect it under if one of the following three
conditions holds:
(1) has location and type -> completed
@@ -1927,7 +1935,7 @@
this CU. */
vg_assert(parser->sp >= 0);
- /* If this is a local variable (non-external), try to find
+ /* If this is a local variable (non-global), try to find
the GExpr for the DW_AT_frame_base of the containing
function. It should have been pushed on the stack at the
time we encountered its DW_TAG_subprogram DIE, so the way
@@ -1939,7 +1947,7 @@
if the containing DT_TAG_subprogram didn't supply a
DW_AT_frame_base -- that's OK, but there must actually be
a containing DW_TAG_subprogram. */
- if (!external) {
+ if (!global) {
Bool found = False;
for (i = parser->sp; i >= 0; i--) {
if (parser->isFunc[i]) {
@@ -1951,7 +1959,7 @@
if (!found) {
if (0 && VG_(clo_verbosity) >= 0) {
VG_(message)(Vg_DebugMsg,
- "warning: parse_var_DIE: non-external variable "
+ "warning: parse_var_DIE: non-global variable "
"outside DW_TAG_subprogram\n");
}
/* goto bad_DIE; */
@@ -1964,18 +1972,18 @@
}
}
- /* re "external ? 0 : parser->sp" (twice), if the var is
- marked 'external' then we must put it at the global scope,
+ /* re "global ? 0 : parser->sp" (twice), if the var is
+ marked 'global' then we must put it at the global scope,
as only the global scope (level 0) covers the entire PC
address space. It is asserted elsewhere that level 0
always covers the entire address space. */
- xa = parser->ranges[external ? 0 : parser->sp];
+ xa = parser->ranges[global ? 0 : parser->sp];
nRanges = VG_(sizeXA)(xa);
vg_assert(nRanges >= 0);
tv = ML_(dinfo_zalloc)( "di.readdwarf3.pvD.1", sizeof(TempVar) );
tv->name = name;
- tv->level = external ? 0 : parser->sp;
+ tv->level = global ? 0 : parser->sp;
tv->typeR = typeR;
tv->gexpr = gexpr;
tv->fbGX = fbGX;

View File

@ -1,205 +0,0 @@
--- valgrind/memcheck/mc_replace_strmem.c
+++ valgrind/memcheck/mc_replace_strmem.c
@@ -101,6 +101,7 @@
20390 WCSCPY
20400 WCSCHR
20410 WCSRCHR
+ 20420 STPNCPY
*/
@@ -983,6 +984,34 @@ static inline void my_exit ( int x )
#endif
+/*---------------------- stpncpy ----------------------*/
+
+#define STPNCPY(soname, fnname) \
+ char* VG_REPLACE_FUNCTION_EZU(20420,soname,fnname) \
+ ( char* dst, const char* src, SizeT n ); \
+ char* VG_REPLACE_FUNCTION_EZU(20420,soname,fnname) \
+ ( char* dst, const char* src, SizeT n ) \
+ { \
+ const Char* src_orig = src; \
+ Char* dst_str = dst; \
+ SizeT m = 0; \
+ \
+ while (m < n && *src) { m++; *dst++ = *src++; } \
+ /* Check for overlap after copying; all n bytes of dst are relevant, */ \
+ /* but only m+1 bytes of src if terminator was found */ \
+ if (is_overlap(dst_str, src_orig, n, (m < n) ? m+1 : n)) \
+ RECORD_OVERLAP_ERROR("stpncpy", dst, src, n); \
+ dst_str = dst; \
+ while (m++ < n) *dst++ = 0; /* must pad remainder with nulls */ \
+ \
+ return dst_str; \
+ }
+
+#if defined(VGO_linux)
+ STPNCPY(VG_Z_LIBC_SONAME, stpncpy)
+#endif
+
+
/*---------------------- memset ----------------------*/
/* Why are we bothering to intercept this? It seems entirely
--- valgrind/memcheck/tests/Makefile.am
+++ valgrind/memcheck/tests/Makefile.am
@@ -190,6 +190,7 @@ EXTRA_DIST = \
signal2.stderr.exp signal2.stdout.exp signal2.vgtest \
sigprocmask.stderr.exp sigprocmask.stderr.exp2 sigprocmask.vgtest \
static_malloc.stderr.exp static_malloc.vgtest \
+ stpncpy.vgtest stpncpy.stderr.exp \
strchr.stderr.exp strchr.stderr.exp2 strchr.stderr.exp-darwin \
strchr.stderr.exp3 strchr.vgtest \
str_tester.stderr.exp str_tester.vgtest \
@@ -286,6 +287,7 @@ check_PROGRAMS = \
sbfragment \
sh-mem sh-mem-random \
sigaltstack signal2 sigprocmask static_malloc sigkill \
+ stpncpy \
strchr \
str_tester \
supp_unknown supp1 supp2 suppfree \
--- /dev/null
+++ valgrind/memcheck/tests/stpncpy.c
@@ -0,0 +1,37 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main(int argc, char **argv)
+{
+ char a[] = "The spazzy orange tiger jumped over the tawny jaguar.";
+ char *b, *c;
+ char *d, *e;
+
+ size_t l = strlen (a);
+ fprintf (stderr, "strlen: %zd\n", l); // strlen: 53
+
+ b = (char *) malloc((l + 3)); // Extra space for some zeros.
+ b[l] = 'X';
+ b[l + 1] = 'X';
+ b[l + 2] = 'X';
+ c = stpncpy (b, a, l + 3);
+
+ fprintf (stderr, "equal: %d\n", strcmp (a, b)); // equal: 0
+ fprintf (stderr, "retlen: %zd\n", c - b); // retlen: 53
+ fprintf (stderr, "last: '%c'\n", *(c - 1)); // last: '.'
+ fprintf (stderr, "zero0: %d\n", *c); // zero0: 0
+ fprintf (stderr, "zero1: %d\n", *(c + 1)); // zero1: 0
+ fprintf (stderr, "zero2: %d\n", *(c + 2)); // zero2: 0
+
+ d = (char *) malloc (l - 1); // No room for zero termination or dot.
+ e = stpncpy (d, b, l - 1);
+
+ fprintf (stderr, "equal: %d\n", strncmp (b, d, l - 1)); // equal: 0
+ fprintf (stderr, "retlen: %zd\n", e - d); // retlen: 52
+ fprintf (stderr, "last: '%c'\n", *(e - 1)); // last: 'r'
+
+ free (b);
+ free (d);
+ return 0;
+}
--- /dev/null
+++ valgrind/memcheck/tests/stpncpy.stderr.exp
@@ -0,0 +1,10 @@
+strlen: 53
+equal: 0
+retlen: 53
+last: '.'
+zero0: 0
+zero1: 0
+zero2: 0
+equal: 0
+retlen: 52
+last: 'r'
--- /dev/null
+++ valgrind/memcheck/tests/stpncpy.vgtest
@@ -0,0 +1,2 @@
+prog: stpncpy
+vgopts: -q
--- valgrind/memcheck/tests/Makefile.in.orig 2012-11-04 21:02:22.477642451 +0100
+++ valgrind/memcheck/tests/Makefile.in 2012-11-04 21:04:10.077182544 +0100
@@ -108,16 +108,17 @@
realloc3$(EXEEXT) sbfragment$(EXEEXT) sh-mem$(EXEEXT) \
sh-mem-random$(EXEEXT) sigaltstack$(EXEEXT) signal2$(EXEEXT) \
sigprocmask$(EXEEXT) static_malloc$(EXEEXT) sigkill$(EXEEXT) \
- strchr$(EXEEXT) str_tester$(EXEEXT) supp_unknown$(EXEEXT) \
- supp1$(EXEEXT) supp2$(EXEEXT) suppfree$(EXEEXT) \
- test-plo$(EXEEXT) trivialleak$(EXEEXT) unit_libcbase$(EXEEXT) \
- unit_oset$(EXEEXT) varinfo1$(EXEEXT) varinfo2$(EXEEXT) \
- varinfo3$(EXEEXT) varinfo4$(EXEEXT) varinfo5$(EXEEXT) \
- varinfo5so.so$(EXEEXT) varinfo6$(EXEEXT) vcpu_fbench$(EXEEXT) \
- vcpu_fnfns$(EXEEXT) wcs$(EXEEXT) xml1$(EXEEXT) wrap1$(EXEEXT) \
- wrap2$(EXEEXT) wrap3$(EXEEXT) wrap4$(EXEEXT) wrap5$(EXEEXT) \
- wrap6$(EXEEXT) wrap7$(EXEEXT) wrap7so.so$(EXEEXT) \
- wrap8$(EXEEXT) writev1$(EXEEXT) $(am__EXEEXT_1)
+ stpncpy$(EXEEXT) strchr$(EXEEXT) str_tester$(EXEEXT) \
+ supp_unknown$(EXEEXT) supp1$(EXEEXT) supp2$(EXEEXT) \
+ suppfree$(EXEEXT) test-plo$(EXEEXT) trivialleak$(EXEEXT) \
+ unit_libcbase$(EXEEXT) unit_oset$(EXEEXT) varinfo1$(EXEEXT) \
+ varinfo2$(EXEEXT) varinfo3$(EXEEXT) varinfo4$(EXEEXT) \
+ varinfo5$(EXEEXT) varinfo5so.so$(EXEEXT) varinfo6$(EXEEXT) \
+ vcpu_fbench$(EXEEXT) vcpu_fnfns$(EXEEXT) wcs$(EXEEXT) \
+ xml1$(EXEEXT) wrap1$(EXEEXT) wrap2$(EXEEXT) wrap3$(EXEEXT) \
+ wrap4$(EXEEXT) wrap5$(EXEEXT) wrap6$(EXEEXT) wrap7$(EXEEXT) \
+ wrap7so.so$(EXEEXT) wrap8$(EXEEXT) writev1$(EXEEXT) \
+ $(am__EXEEXT_1)
@DWARF4_TRUE@am__append_12 = dw4
subdir = memcheck/tests
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -454,6 +455,9 @@
static_malloc_SOURCES = static_malloc.c
static_malloc_OBJECTS = static_malloc.$(OBJEXT)
static_malloc_LDADD = $(LDADD)
+stpncpy_SOURCES = stpncpy.c
+stpncpy_OBJECTS = stpncpy.$(OBJEXT)
+stpncpy_LDADD = $(LDADD)
str_tester_SOURCES = str_tester.c
str_tester_OBJECTS = str_tester-str_tester.$(OBJEXT)
str_tester_LDADD = $(LDADD)
@@ -608,7 +612,7 @@
pdb-realloc2.c pipe.c pointer-trace.c post-syscall.c \
realloc1.c realloc2.c realloc3.c sbfragment.c sh-mem.c \
sh-mem-random.c sigaltstack.c sigkill.c signal2.c \
- sigprocmask.c static_malloc.c str_tester.c strchr.c \
+ sigprocmask.c static_malloc.c stpncpy.c str_tester.c strchr.c \
$(supp1_SOURCES) $(supp2_SOURCES) $(supp_unknown_SOURCES) \
suppfree.c test-plo.c trivialleak.c unit_libcbase.c \
unit_oset.c varinfo1.c varinfo2.c varinfo3.c varinfo4.c \
@@ -639,7 +643,7 @@
pdb-realloc2.c pipe.c pointer-trace.c post-syscall.c \
realloc1.c realloc2.c realloc3.c sbfragment.c sh-mem.c \
sh-mem-random.c sigaltstack.c sigkill.c signal2.c \
- sigprocmask.c static_malloc.c str_tester.c strchr.c \
+ sigprocmask.c static_malloc.c stpncpy.c str_tester.c strchr.c \
$(supp1_SOURCES) $(supp2_SOURCES) $(supp_unknown_SOURCES) \
suppfree.c test-plo.c trivialleak.c unit_libcbase.c \
unit_oset.c varinfo1.c varinfo2.c varinfo3.c varinfo4.c \
@@ -1117,6 +1121,7 @@
signal2.stderr.exp signal2.stdout.exp signal2.vgtest \
sigprocmask.stderr.exp sigprocmask.stderr.exp2 sigprocmask.vgtest \
static_malloc.stderr.exp static_malloc.vgtest \
+ stpncpy.vgtest stpncpy.stderr.exp \
strchr.stderr.exp strchr.stderr.exp2 strchr.stderr.exp-darwin \
strchr.stderr.exp3 strchr.vgtest \
str_tester.stderr.exp str_tester.vgtest \
@@ -1576,6 +1581,9 @@
static_malloc$(EXEEXT): $(static_malloc_OBJECTS) $(static_malloc_DEPENDENCIES)
@rm -f static_malloc$(EXEEXT)
$(LINK) $(static_malloc_OBJECTS) $(static_malloc_LDADD) $(LIBS)
+stpncpy$(EXEEXT): $(stpncpy_OBJECTS) $(stpncpy_DEPENDENCIES)
+ @rm -f stpncpy$(EXEEXT)
+ $(LINK) $(stpncpy_OBJECTS) $(stpncpy_LDADD) $(LIBS)
str_tester$(EXEEXT): $(str_tester_OBJECTS) $(str_tester_DEPENDENCIES)
@rm -f str_tester$(EXEEXT)
$(str_tester_LINK) $(str_tester_OBJECTS) $(str_tester_LDADD) $(LIBS)
@@ -1774,6 +1782,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/static_malloc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stpncpy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_tester-str_tester.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strchr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/supp.Po@am__quote@

View File

@ -1,929 +0,0 @@
diff --git a/configure.in b/configure.in
index 391b763..9aadfa2 100644
--- a/configure.in
+++ b/configure.in
@@ -1701,23 +1701,32 @@ AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
CFLAGS=$safe_CFLAGS
-# does the linker support -Wl,--build-id=none ? Note, it's
-# important that we test indirectly via whichever C compiler
-# is selected, rather than testing /usr/bin/ld or whatever
-# directly.
+# We want to use use the -Ttext-segment option to the linker.
+# GNU (bfd) ld supports this directly. Newer GNU gold linkers
+# support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext
+# semantics are NOT what we want (GNU gold -Ttext is fine).
+#
+# For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers
+# will reside. -Ttext aligns just the .text section start (but not any
+# other section).
+#
+# So test for -Ttext-segment which is supported by all bfd ld versions
+# and use that if it exists. If it doesn't exist it must be an older
+# version of gold and we can fall back to using -Ttext which has the
+# right semantics.
-AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
+AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
safe_CFLAGS=$CFLAGS
-CFLAGS="-Wl,--build-id=none"
+CFLAGS="-Wl,-Ttext-segment=$valt_load_address_pri_norml"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([ ], [return 0;])],
[
- AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
+ AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
AC_MSG_RESULT([yes])
], [
- AC_SUBST([FLAG_NO_BUILD_ID], [""])
+ AC_SUBST([FLAG_T_TEXT], ["-Ttext"])
AC_MSG_RESULT([no])
])
CFLAGS=$safe_CFLAGS
diff --git a/configure.in b/configure.in
index 6e2a675..424f8e6 100644
--- a/configure.in
+++ b/configure.in
@@ -1723,14 +1723,46 @@ CFLAGS="-Wl,-Ttext-segment=$valt_load_address_pri_norml"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([ ], [return 0;])],
[
+ linker_using_t_text="no"
AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
AC_MSG_RESULT([yes])
], [
+ linker_using_t_text="yes"
AC_SUBST([FLAG_T_TEXT], ["-Ttext"])
AC_MSG_RESULT([no])
])
CFLAGS=$safe_CFLAGS
+# If the linker only supports -Ttext (not -Ttext-segment) then we will
+# have to strip any build-id ELF NOTEs from the staticly linked tools.
+# Otherwise the build-id NOTE might end up at the default load address.
+# (Pedantically if the linker is gold then -Ttext is fine, but newer
+# gold versions also support -Ttext-segment. So just assume that unless
+# we can use -Ttext-segment we need to strip the build-id NOTEs.
+if test "x${linker_using_t_text}" == "xyes"; then
+AC_MSG_NOTICE([ld -Ttext used, need to strip build-id NOTEs.])
+# does the linker support -Wl,--build-id=none ? Note, it's
+# important that we test indirectly via whichever C compiler
+# is selected, rather than testing /usr/bin/ld or whatever
+# directly.
+AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
+safe_CFLAGS=$CFLAGS
+CFLAGS="-Wl,--build-id=none"
+
+AC_LINK_IFELSE(
+[AC_LANG_PROGRAM([ ], [return 0;])],
+[
+ AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
+ AC_MSG_RESULT([yes])
+], [
+ AC_SUBST([FLAG_NO_BUILD_ID], [""])
+ AC_MSG_RESULT([no])
+])
+else
+AC_MSG_NOTICE([ld -Ttext-segment used, no need to strip build-id NOTEs.])
+AC_SUBST([FLAG_NO_BUILD_ID], [""])
+fi
+CFLAGS=$safe_CFLAGS
# does the ppc assembler support "mtocrf" et al?
AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
--- valgrind-3.8.1.orig/coregrind/link_tool_exe_linux.in 2013-03-20 16:59:08.834198437 +0100
+++ valgrind-3.8.1/coregrind/link_tool_exe_linux.in 2013-03-20 17:02:20.184864053 +0100
@@ -27,24 +27,20 @@
# directly. It is only run as part of the build process, with
# carefully constrained inputs.
#
-# Linux specific complications:
+# Linux specific complication:
#
# - need to support both old GNU ld and gold: use -Ttext= to
-# set the text segment address.
-#
-# - need to pass --build-id=none (that is, -Wl,--build-id=none to
-# gcc) if it accepts it, to ensure the linker doesn't add a
-# notes section which ends up at the default load address and
-# so defeats our attempts to keep that address clear for the
-# client. However, older linkers don't support this flag, so it
-# is tested for by configure.in and is shipped to us as part of
-# argv[2 ..].
+# set the text segment address if that is all we have. We really
+# need -Ttext-segment. Otherwise with GNU ld sections or notes
+# (like the build-id) don't get at the desired address. Luckily
+# -Ttext does the right thing for gold. So configure checks for
+# us and sets FLAG_T_TEXT.
#
#
# So: what we actually do:
#
# pass the specified command to the linker as-is, except, add
-# "-static" and "-Ttext=<argv[1]>" to it.
+# "-static" and "-Ttext[-segment]=<argv[1]>" to it.
#
use warnings;
@@ -66,7 +62,7 @@
# and the 'restargs' are argv[2 ..]
# so, build up the complete command here:
-# 'cc' -static -Ttext='ala' 'restargs'
+# 'cc' -static -Ttext[-segment]='ala' 'restargs'
# For mips we need to use "--section-start=.reginfo=$ala" because
# "--section-start=.reginfo=$ala" will put all the sections to the
@@ -78,7 +74,7 @@
if (($arch eq 'mips') || ($arch eq 'mipsel')) {
$cmd = "$cc -static -Wl,--section-start=.reginfo=$ala";
} else {
- $cmd = "$cc -static -Wl,-Ttext=$ala";
+ $cmd = "$cc -static -Wl,@FLAG_T_TEXT@=$ala";
}
# Add the rest of the parameters
Only in valgrind-3.8.1: autom4te.cache
diff -ur valgrind-3.8.1.orig/auxprogs/Makefile.in valgrind-3.8.1/auxprogs/Makefile.in
--- valgrind-3.8.1.orig/auxprogs/Makefile.in 2013-04-02 17:57:17.050898570 +0200
+++ valgrind-3.8.1/auxprogs/Makefile.in 2013-04-02 17:57:28.199938856 +0200
@@ -120,6 +120,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/cachegrind/Makefile.in valgrind-3.8.1/cachegrind/Makefile.in
--- valgrind-3.8.1.orig/cachegrind/Makefile.in 2013-04-02 17:57:17.030898498 +0200
+++ valgrind-3.8.1/cachegrind/Makefile.in 2013-04-02 17:57:28.301939225 +0200
@@ -222,6 +222,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/cachegrind/tests/Makefile.in valgrind-3.8.1/cachegrind/tests/Makefile.in
--- valgrind-3.8.1.orig/cachegrind/tests/Makefile.in 2013-04-02 17:57:17.030898498 +0200
+++ valgrind-3.8.1/cachegrind/tests/Makefile.in 2013-04-02 17:57:28.356939423 +0200
@@ -168,6 +168,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/cachegrind/tests/x86/Makefile.in valgrind-3.8.1/cachegrind/tests/x86/Makefile.in
--- valgrind-3.8.1.orig/cachegrind/tests/x86/Makefile.in 2013-04-02 17:57:17.030898498 +0200
+++ valgrind-3.8.1/cachegrind/tests/x86/Makefile.in 2013-04-02 17:57:28.402939589 +0200
@@ -120,6 +120,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/callgrind/Makefile.in valgrind-3.8.1/callgrind/Makefile.in
--- valgrind-3.8.1.orig/callgrind/Makefile.in 2013-04-02 17:57:17.146898918 +0200
+++ valgrind-3.8.1/callgrind/Makefile.in 2013-04-02 17:57:28.556940145 +0200
@@ -239,6 +239,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/callgrind/tests/Makefile.in valgrind-3.8.1/callgrind/tests/Makefile.in
--- valgrind-3.8.1.orig/callgrind/tests/Makefile.in 2013-04-02 17:57:17.146898918 +0200
+++ valgrind-3.8.1/callgrind/tests/Makefile.in 2013-04-02 17:57:28.608940333 +0200
@@ -161,6 +161,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/configure valgrind-3.8.1/configure
--- valgrind-3.8.1.orig/configure 2013-04-02 17:57:17.158898961 +0200
+++ valgrind-3.8.1/configure 2013-04-02 17:57:32.984956139 +0200
@@ -657,6 +657,7 @@
BUILD_SSE3_TESTS_FALSE
BUILD_SSE3_TESTS_TRUE
FLAG_NO_BUILD_ID
+FLAG_T_TEXT
DWARF4_FALSE
DWARF4_TRUE
FLAG_UNLIMITED_INLINE_UNIT_GROWTH
@@ -7913,14 +7914,73 @@
CFLAGS=$safe_CFLAGS
+# We want to use use the -Ttext-segment option to the linker.
+# GNU (bfd) ld supports this directly. Newer GNU gold linkers
+# support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext
+# semantics are NOT what we want (GNU gold -Ttext is fine).
+#
+# For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers
+# will reside. -Ttext aligns just the .text section start (but not any
+# other section).
+#
+# So test for -Ttext-segment which is supported by all bfd ld versions
+# and use that if it exists. If it doesn't exist it must be an older
+# version of gold and we can fall back to using -Ttext which has the
+# right semantics.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker accepts -Wl,-Ttext-segment" >&5
+$as_echo_n "checking if the linker accepts -Wl,-Ttext-segment... " >&6; }
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-Wl,-Ttext-segment=$valt_load_address_pri_norml"
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ linker_using_t_text="no"
+ FLAG_T_TEXT="-Ttext-segment"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ linker_using_t_text="yes"
+ FLAG_T_TEXT="-Ttext"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+CFLAGS=$safe_CFLAGS
+
+# If the linker only supports -Ttext (not -Ttext-segment) then we will
+# have to strip any build-id ELF NOTEs from the staticly linked tools.
+# Otherwise the build-id NOTE might end up at the default load address.
+# (Pedantically if the linker is gold then -Ttext is fine, but newer
+# gold versions also support -Ttext-segment. So just assume that unless
+# we can use -Ttext-segment we need to strip the build-id NOTEs.
+if test "x${linker_using_t_text}" == "xyes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: ld -Ttext used, need to strip build-id NOTEs." >&5
+$as_echo "$as_me: ld -Ttext used, need to strip build-id NOTEs." >&6;}
# does the linker support -Wl,--build-id=none ? Note, it's
# important that we test indirectly via whichever C compiler
# is selected, rather than testing /usr/bin/ld or whatever
# directly.
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker accepts -Wl,--build-id=none" >&5
$as_echo_n "checking if the linker accepts -Wl,--build-id=none... " >&6; }
-
safe_CFLAGS=$CFLAGS
CFLAGS="-Wl,--build-id=none"
@@ -7952,8 +8012,13 @@
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-CFLAGS=$safe_CFLAGS
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: ld -Ttext-segment used, no need to strip build-id NOTEs." >&5
+$as_echo "$as_me: ld -Ttext-segment used, no need to strip build-id NOTEs." >&6;}
+FLAG_NO_BUILD_ID=""
+fi
+CFLAGS=$safe_CFLAGS
# does the ppc assembler support "mtocrf" et al?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ppc32/64 as supports mtocrf/mfocrf" >&5
diff -ur valgrind-3.8.1.orig/coregrind/Makefile.in valgrind-3.8.1/coregrind/Makefile.in
--- valgrind-3.8.1.orig/coregrind/Makefile.in 2013-04-02 17:57:17.116898809 +0200
+++ valgrind-3.8.1/coregrind/Makefile.in 2013-04-02 17:57:29.304942848 +0200
@@ -703,6 +703,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/docs/Makefile.in valgrind-3.8.1/docs/Makefile.in
--- valgrind-3.8.1.orig/docs/Makefile.in 2013-04-02 17:57:17.157898957 +0200
+++ valgrind-3.8.1/docs/Makefile.in 2013-04-02 17:57:29.344942992 +0200
@@ -83,6 +83,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/drd/Makefile.in valgrind-3.8.1/drd/Makefile.in
--- valgrind-3.8.1.orig/drd/Makefile.in 2013-04-02 17:57:17.049898567 +0200
+++ valgrind-3.8.1/drd/Makefile.in 2013-04-02 17:57:29.491943523 +0200
@@ -268,6 +268,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/drd/tests/Makefile.in valgrind-3.8.1/drd/tests/Makefile.in
--- valgrind-3.8.1.orig/drd/tests/Makefile.in 2013-04-02 17:57:17.043898545 +0200
+++ valgrind-3.8.1/drd/tests/Makefile.in 2013-04-02 17:57:29.625944007 +0200
@@ -477,6 +477,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/exp-bbv/Makefile.in valgrind-3.8.1/exp-bbv/Makefile.in
--- valgrind-3.8.1.orig/exp-bbv/Makefile.in 2013-04-02 17:57:17.162898976 +0200
+++ valgrind-3.8.1/exp-bbv/Makefile.in 2013-04-02 17:57:29.688944235 +0200
@@ -168,6 +168,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/exp-bbv/tests/amd64-linux/Makefile.in valgrind-3.8.1/exp-bbv/tests/amd64-linux/Makefile.in
--- valgrind-3.8.1.orig/exp-bbv/tests/amd64-linux/Makefile.in 2013-04-02 17:57:17.161898973 +0200
+++ valgrind-3.8.1/exp-bbv/tests/amd64-linux/Makefile.in 2013-04-02 17:57:29.788944595 +0200
@@ -140,6 +140,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/exp-bbv/tests/arm-linux/Makefile.in valgrind-3.8.1/exp-bbv/tests/arm-linux/Makefile.in
--- valgrind-3.8.1.orig/exp-bbv/tests/arm-linux/Makefile.in 2013-04-02 17:57:17.160898969 +0200
+++ valgrind-3.8.1/exp-bbv/tests/arm-linux/Makefile.in 2013-04-02 17:57:29.836944769 +0200
@@ -123,6 +123,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/exp-bbv/tests/Makefile.in valgrind-3.8.1/exp-bbv/tests/Makefile.in
--- valgrind-3.8.1.orig/exp-bbv/tests/Makefile.in 2013-04-02 17:57:17.162898976 +0200
+++ valgrind-3.8.1/exp-bbv/tests/Makefile.in 2013-04-02 17:57:29.735944405 +0200
@@ -151,6 +151,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/exp-bbv/tests/ppc32-linux/Makefile.in valgrind-3.8.1/exp-bbv/tests/ppc32-linux/Makefile.in
--- valgrind-3.8.1.orig/exp-bbv/tests/ppc32-linux/Makefile.in 2013-04-02 17:57:17.159898965 +0200
+++ valgrind-3.8.1/exp-bbv/tests/ppc32-linux/Makefile.in 2013-04-02 17:57:29.885944945 +0200
@@ -123,6 +123,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/exp-bbv/tests/x86/Makefile.in valgrind-3.8.1/exp-bbv/tests/x86/Makefile.in
--- valgrind-3.8.1.orig/exp-bbv/tests/x86/Makefile.in 2013-04-02 17:57:17.162898976 +0200
+++ valgrind-3.8.1/exp-bbv/tests/x86/Makefile.in 2013-04-02 17:57:29.987945315 +0200
@@ -132,6 +132,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/exp-bbv/tests/x86-linux/Makefile.in valgrind-3.8.1/exp-bbv/tests/x86-linux/Makefile.in
--- valgrind-3.8.1.orig/exp-bbv/tests/x86-linux/Makefile.in 2013-04-02 17:57:17.160898969 +0200
+++ valgrind-3.8.1/exp-bbv/tests/x86-linux/Makefile.in 2013-04-02 17:57:29.935945126 +0200
@@ -123,6 +123,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/exp-dhat/Makefile.in valgrind-3.8.1/exp-dhat/Makefile.in
--- valgrind-3.8.1.orig/exp-dhat/Makefile.in 2013-04-02 17:57:17.143898906 +0200
+++ valgrind-3.8.1/exp-dhat/Makefile.in 2013-04-02 17:57:30.052945550 +0200
@@ -192,6 +192,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/exp-dhat/tests/Makefile.in valgrind-3.8.1/exp-dhat/tests/Makefile.in
--- valgrind-3.8.1.orig/exp-dhat/tests/Makefile.in 2013-04-02 17:57:17.143898906 +0200
+++ valgrind-3.8.1/exp-dhat/tests/Makefile.in 2013-04-02 17:57:30.083945661 +0200
@@ -83,6 +83,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/exp-sgcheck/Makefile.in valgrind-3.8.1/exp-sgcheck/Makefile.in
--- valgrind-3.8.1.orig/exp-sgcheck/Makefile.in 2013-04-02 17:57:17.127898849 +0200
+++ valgrind-3.8.1/exp-sgcheck/Makefile.in 2013-04-02 17:57:30.168945969 +0200
@@ -211,6 +211,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/exp-sgcheck/tests/Makefile.in valgrind-3.8.1/exp-sgcheck/tests/Makefile.in
--- valgrind-3.8.1.orig/exp-sgcheck/tests/Makefile.in 2013-04-02 17:57:17.126898845 +0200
+++ valgrind-3.8.1/exp-sgcheck/tests/Makefile.in 2013-04-02 17:57:30.227946183 +0200
@@ -146,6 +146,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/gdbserver_tests/Makefile.in valgrind-3.8.1/gdbserver_tests/Makefile.in
--- valgrind-3.8.1.orig/gdbserver_tests/Makefile.in 2013-04-02 17:57:17.121898828 +0200
+++ valgrind-3.8.1/gdbserver_tests/Makefile.in 2013-04-02 17:57:30.284946388 +0200
@@ -153,6 +153,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/helgrind/Makefile.in valgrind-3.8.1/helgrind/Makefile.in
--- valgrind-3.8.1.orig/helgrind/Makefile.in 2013-04-02 17:57:17.138898889 +0200
+++ valgrind-3.8.1/helgrind/Makefile.in 2013-04-02 17:57:30.380946734 +0200
@@ -235,6 +235,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/helgrind/tests/Makefile.in valgrind-3.8.1/helgrind/tests/Makefile.in
--- valgrind-3.8.1.orig/helgrind/tests/Makefile.in 2013-04-02 17:57:17.134898874 +0200
+++ valgrind-3.8.1/helgrind/tests/Makefile.in 2013-04-02 17:57:30.473947070 +0200
@@ -359,6 +359,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/include/Makefile.in valgrind-3.8.1/include/Makefile.in
--- valgrind-3.8.1.orig/include/Makefile.in 2013-04-02 17:57:17.141898898 +0200
+++ valgrind-3.8.1/include/Makefile.in 2013-04-02 17:57:30.509947200 +0200
@@ -110,6 +110,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/lackey/Makefile.in valgrind-3.8.1/lackey/Makefile.in
--- valgrind-3.8.1.orig/lackey/Makefile.in 2013-04-02 17:57:16.946898195 +0200
+++ valgrind-3.8.1/lackey/Makefile.in 2013-04-02 17:57:30.569947417 +0200
@@ -168,6 +168,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/lackey/tests/Makefile.in valgrind-3.8.1/lackey/tests/Makefile.in
--- valgrind-3.8.1.orig/lackey/tests/Makefile.in 2013-04-02 17:57:16.945898192 +0200
+++ valgrind-3.8.1/lackey/tests/Makefile.in 2013-04-02 17:57:30.601947533 +0200
@@ -86,6 +86,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/Makefile.in valgrind-3.8.1/Makefile.in
--- valgrind-3.8.1.orig/Makefile.in 2013-04-02 17:57:17.144898910 +0200
+++ valgrind-3.8.1/Makefile.in 2013-04-02 17:57:32.681955045 +0200
@@ -184,6 +184,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/Makefile.vex.in valgrind-3.8.1/Makefile.vex.in
--- valgrind-3.8.1.orig/Makefile.vex.in 2013-04-02 17:57:17.127898849 +0200
+++ valgrind-3.8.1/Makefile.vex.in 2013-04-02 17:57:28.148938672 +0200
@@ -250,6 +250,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/massif/Makefile.in valgrind-3.8.1/massif/Makefile.in
--- valgrind-3.8.1.orig/massif/Makefile.in 2013-04-02 17:57:16.956898231 +0200
+++ valgrind-3.8.1/massif/Makefile.in 2013-04-02 17:57:30.667947771 +0200
@@ -217,6 +217,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/massif/tests/Makefile.in valgrind-3.8.1/massif/tests/Makefile.in
--- valgrind-3.8.1.orig/massif/tests/Makefile.in 2013-04-02 17:57:16.954898223 +0200
+++ valgrind-3.8.1/massif/tests/Makefile.in 2013-04-02 17:57:30.731948003 +0200
@@ -201,6 +201,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/memcheck/Makefile.in valgrind-3.8.1/memcheck/Makefile.in
--- valgrind-3.8.1.orig/memcheck/Makefile.in 2013-04-02 17:57:17.098898743 +0200
+++ valgrind-3.8.1/memcheck/Makefile.in 2013-04-02 17:57:30.827948350 +0200
@@ -235,6 +235,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/memcheck/tests/amd64/Makefile.in valgrind-3.8.1/memcheck/tests/amd64/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/amd64/Makefile.in 2013-04-02 17:57:17.097898740 +0200
+++ valgrind-3.8.1/memcheck/tests/amd64/Makefile.in 2013-04-02 17:57:31.141949484 +0200
@@ -142,6 +142,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/memcheck/tests/amd64-linux/Makefile.in valgrind-3.8.1/memcheck/tests/amd64-linux/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/amd64-linux/Makefile.in 2013-04-02 17:57:17.082898686 +0200
+++ valgrind-3.8.1/memcheck/tests/amd64-linux/Makefile.in 2013-04-02 17:57:31.087949289 +0200
@@ -123,6 +123,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/memcheck/tests/darwin/Makefile.in valgrind-3.8.1/memcheck/tests/darwin/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/darwin/Makefile.in 2013-04-02 17:57:17.086898701 +0200
+++ valgrind-3.8.1/memcheck/tests/darwin/Makefile.in 2013-04-02 17:57:31.194949675 +0200
@@ -143,6 +143,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/memcheck/tests/linux/Makefile.in valgrind-3.8.1/memcheck/tests/linux/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/linux/Makefile.in 2013-04-02 17:57:17.069898639 +0200
+++ valgrind-3.8.1/memcheck/tests/linux/Makefile.in 2013-04-02 17:57:31.249949874 +0200
@@ -159,6 +159,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/memcheck/tests/Makefile.in valgrind-3.8.1/memcheck/tests/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/Makefile.in 2013-04-02 17:57:17.084898693 +0200
+++ valgrind-3.8.1/memcheck/tests/Makefile.in 2013-04-02 17:57:31.033949093 +0200
@@ -732,6 +732,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/memcheck/tests/ppc32/Makefile.in valgrind-3.8.1/memcheck/tests/ppc32/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/ppc32/Makefile.in 2013-04-02 17:57:17.064898621 +0200
+++ valgrind-3.8.1/memcheck/tests/ppc32/Makefile.in 2013-04-02 17:57:31.299950054 +0200
@@ -120,6 +120,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/memcheck/tests/ppc64/Makefile.in valgrind-3.8.1/memcheck/tests/ppc64/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/ppc64/Makefile.in 2013-04-02 17:57:17.087898705 +0200
+++ valgrind-3.8.1/memcheck/tests/ppc64/Makefile.in 2013-04-02 17:57:31.349950235 +0200
@@ -120,6 +120,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/memcheck/tests/s390x/Makefile.in valgrind-3.8.1/memcheck/tests/s390x/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/s390x/Makefile.in 2013-04-02 17:57:17.083898689 +0200
+++ valgrind-3.8.1/memcheck/tests/s390x/Makefile.in 2013-04-02 17:57:31.400950418 +0200
@@ -135,6 +135,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/memcheck/tests/x86/Makefile.in valgrind-3.8.1/memcheck/tests/x86/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/x86/Makefile.in 2013-04-02 17:57:17.093898726 +0200
+++ valgrind-3.8.1/memcheck/tests/x86/Makefile.in 2013-04-02 17:57:31.517950841 +0200
@@ -165,6 +165,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/memcheck/tests/x86-linux/Makefile.in valgrind-3.8.1/memcheck/tests/x86-linux/Makefile.in
--- valgrind-3.8.1.orig/memcheck/tests/x86-linux/Makefile.in 2013-04-02 17:57:17.073898654 +0200
+++ valgrind-3.8.1/memcheck/tests/x86-linux/Makefile.in 2013-04-02 17:57:31.453950611 +0200
@@ -143,6 +143,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/mpi/Makefile.in valgrind-3.8.1/mpi/Makefile.in
--- valgrind-3.8.1.orig/mpi/Makefile.in 2013-04-02 17:57:16.948898201 +0200
+++ valgrind-3.8.1/mpi/Makefile.in 2013-04-02 17:57:31.572951039 +0200
@@ -141,6 +141,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/Makefile.in valgrind-3.8.1/none/Makefile.in
--- valgrind-3.8.1.orig/none/Makefile.in 2013-04-02 17:57:17.028898490 +0200
+++ valgrind-3.8.1/none/Makefile.in 2013-04-02 17:57:31.632951257 +0200
@@ -166,6 +166,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/tests/amd64/Makefile.in valgrind-3.8.1/none/tests/amd64/Makefile.in
--- valgrind-3.8.1.orig/none/tests/amd64/Makefile.in 2013-04-02 17:57:17.023898473 +0200
+++ valgrind-3.8.1/none/tests/amd64/Makefile.in 2013-04-02 17:57:31.863952092 +0200
@@ -345,6 +345,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/tests/arm/Makefile.in valgrind-3.8.1/none/tests/arm/Makefile.in
--- valgrind-3.8.1.orig/none/tests/arm/Makefile.in 2013-04-02 17:57:16.976898304 +0200
+++ valgrind-3.8.1/none/tests/arm/Makefile.in 2013-04-02 17:57:31.933952345 +0200
@@ -157,6 +157,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/tests/darwin/Makefile.in valgrind-3.8.1/none/tests/darwin/Makefile.in
--- valgrind-3.8.1.orig/none/tests/darwin/Makefile.in 2013-04-02 17:57:16.998898383 +0200
+++ valgrind-3.8.1/none/tests/darwin/Makefile.in 2013-04-02 17:57:31.982952522 +0200
@@ -125,6 +125,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/tests/linux/Makefile.in valgrind-3.8.1/none/tests/linux/Makefile.in
--- valgrind-3.8.1.orig/none/tests/linux/Makefile.in 2013-04-02 17:57:16.967898270 +0200
+++ valgrind-3.8.1/none/tests/linux/Makefile.in 2013-04-02 17:57:32.032952702 +0200
@@ -128,6 +128,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/tests/Makefile.in valgrind-3.8.1/none/tests/Makefile.in
--- valgrind-3.8.1.orig/none/tests/Makefile.in 2013-04-02 17:57:16.998898383 +0200
+++ valgrind-3.8.1/none/tests/Makefile.in 2013-04-02 17:57:31.762951727 +0200
@@ -504,6 +504,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/tests/mips32/Makefile.in valgrind-3.8.1/none/tests/mips32/Makefile.in
--- valgrind-3.8.1.orig/none/tests/mips32/Makefile.in 2013-04-02 17:57:16.979898314 +0200
+++ valgrind-3.8.1/none/tests/mips32/Makefile.in 2013-04-02 17:57:32.088952903 +0200
@@ -152,6 +152,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/tests/ppc32/Makefile.in valgrind-3.8.1/none/tests/ppc32/Makefile.in
--- valgrind-3.8.1.orig/none/tests/ppc32/Makefile.in 2013-04-02 17:57:16.962898252 +0200
+++ valgrind-3.8.1/none/tests/ppc32/Makefile.in 2013-04-02 17:57:32.178953228 +0200
@@ -234,6 +234,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/tests/ppc64/Makefile.in valgrind-3.8.1/none/tests/ppc64/Makefile.in
--- valgrind-3.8.1.orig/none/tests/ppc64/Makefile.in 2013-04-02 17:57:17.003898401 +0200
+++ valgrind-3.8.1/none/tests/ppc64/Makefile.in 2013-04-02 17:57:32.260953525 +0200
@@ -201,6 +201,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/tests/s390x/Makefile.in valgrind-3.8.1/none/tests/s390x/Makefile.in
--- valgrind-3.8.1.orig/none/tests/s390x/Makefile.in 2013-04-02 17:57:16.993898365 +0200
+++ valgrind-3.8.1/none/tests/s390x/Makefile.in 2013-04-02 17:57:32.366953907 +0200
@@ -382,6 +382,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/tests/x86/Makefile.in valgrind-3.8.1/none/tests/x86/Makefile.in
--- valgrind-3.8.1.orig/none/tests/x86/Makefile.in 2013-04-02 17:57:17.013898436 +0200
+++ valgrind-3.8.1/none/tests/x86/Makefile.in 2013-04-02 17:57:32.511954432 +0200
@@ -307,6 +307,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/none/tests/x86-linux/Makefile.in valgrind-3.8.1/none/tests/x86-linux/Makefile.in
--- valgrind-3.8.1.orig/none/tests/x86-linux/Makefile.in 2013-04-02 17:57:16.969898276 +0200
+++ valgrind-3.8.1/none/tests/x86-linux/Makefile.in 2013-04-02 17:57:32.415954086 +0200
@@ -121,6 +121,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/perf/Makefile.in valgrind-3.8.1/perf/Makefile.in
--- valgrind-3.8.1.orig/perf/Makefile.in 2013-04-02 17:57:17.124898837 +0200
+++ valgrind-3.8.1/perf/Makefile.in 2013-04-02 17:57:32.572954652 +0200
@@ -153,6 +153,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
diff -ur valgrind-3.8.1.orig/tests/Makefile.in valgrind-3.8.1/tests/Makefile.in
--- valgrind-3.8.1.orig/tests/Makefile.in 2013-04-02 17:57:17.143898906 +0200
+++ valgrind-3.8.1/tests/Makefile.in 2013-04-02 17:57:32.627954850 +0200
@@ -139,6 +139,7 @@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
commit 0e6f91f20c180a37e32a7688b93c94f73aede0b6
Author: Mark Wielaard <mjw@redhat.com>
Date: Wed Apr 17 20:30:10 2013 +0200
Fix -Ttext-segment configure check.
Explicitly test together with -static -nodefaultlibs -nostartfiles to mimic
what the tools linking script does. At least on s390 the test might fail for
a non-static AC_LINK, while it does work when using those other flags too.
diff --git a/configure.in b/configure.in
index 424f8e6..9a1db0c 100644
--- a/configure.in
+++ b/configure.in
@@ -1718,10 +1718,10 @@ CFLAGS=$safe_CFLAGS
AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
safe_CFLAGS=$CFLAGS
-CFLAGS="-Wl,-Ttext-segment=$valt_load_address_pri_norml"
+CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml"
AC_LINK_IFELSE(
-[AC_LANG_PROGRAM([ ], [return 0;])],
+[AC_LANG_SOURCE([int _start () { return 0; }])],
[
linker_using_t_text="no"
AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
--- valgrind-3.8.1/configure.orig2 2013-04-17 20:37:38.431443701 +0200
+++ valgrind-3.8.1/configure 2013-04-17 20:38:19.103686995 +0200
@@ -7932,18 +7932,11 @@
$as_echo_n "checking if the linker accepts -Wl,-Ttext-segment... " >&6; }
safe_CFLAGS=$CFLAGS
-CFLAGS="-Wl,-Ttext-segment=$valt_load_address_pri_norml"
+CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
-int
-main ()
-{
-return 0;
- ;
- return 0;
-}
+int _start () { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :

View File

@ -1,273 +0,0 @@
Index: valgrind/memcheck/mc_replace_strmem.c
===================================================================
--- valgrind/memcheck/mc_replace_strmem.c (revision 13016)
+++ valgrind/memcheck/mc_replace_strmem.c (working copy)
@@ -97,6 +97,10 @@
20350 STRCASESTR
20360 MEMRCHR
20370 WCSLEN
+ 20380 WCSCMP
+ 20390 WCSCPY
+ 20400 WCSCHR
+ 20410 WCSRCHR
*/
@@ -1570,7 +1574,115 @@
#endif
+/*---------------------- wcscmp ----------------------*/
+// This is a wchar_t equivalent to strcmp. We don't
+// have wchar_t available here, but in the GNU C Library
+// wchar_t is always 32 bits wide and wcscmp uses signed
+// comparison, not unsigned as in strcmp function.
+
+#define WCSCMP(soname, fnname) \
+ int VG_REPLACE_FUNCTION_EZU(20380,soname,fnname) \
+ ( const Int* s1, const Int* s2 ); \
+ int VG_REPLACE_FUNCTION_EZU(20380,soname,fnname) \
+ ( const Int* s1, const Int* s2 ) \
+ { \
+ register Int c1; \
+ register Int c2; \
+ while (True) { \
+ c1 = *s1; \
+ c2 = *s2; \
+ if (c1 != c2) break; \
+ if (c1 == 0) break; \
+ s1++; s2++; \
+ } \
+ if (c1 < c2) return -1; \
+ if (c1 > c2) return 1; \
+ return 0; \
+ }
+
+#if defined(VGO_linux)
+ WCSCMP(VG_Z_LIBC_SONAME, wcscmp)
+#endif
+
+/*---------------------- wcscpy ----------------------*/
+
+// This is a wchar_t equivalent to strcpy. We don't
+// have wchar_t available here, but in the GNU C Library
+// wchar_t is always 32 bits wide.
+
+#define WCSCPY(soname, fnname) \
+ Int* VG_REPLACE_FUNCTION_EZU(20390,soname,fnname) \
+ ( Int* dst, const Int* src ); \
+ Int* VG_REPLACE_FUNCTION_EZU(20390,soname,fnname) \
+ ( Int* dst, const Int* src ) \
+ { \
+ const Int* src_orig = src; \
+ Int* dst_orig = dst; \
+ \
+ while (*src) *dst++ = *src++; \
+ *dst = 0; \
+ \
+ /* This checks for overlap after copying, unavoidable without */ \
+ /* pre-counting length... should be ok */ \
+ if (is_overlap(dst_orig, \
+ src_orig, \
+ (Addr)dst-(Addr)dst_orig+1, \
+ (Addr)src-(Addr)src_orig+1)) \
+ RECORD_OVERLAP_ERROR("wcscpy", dst_orig, src_orig, 0); \
+ \
+ return dst_orig; \
+ }
+
+#if defined(VGO_linux)
+ WCSCPY(VG_Z_LIBC_SONAME, wcscpy)
+#endif
+
+
+/*---------------------- wcschr ----------------------*/
+
+// This is a wchar_t equivalent to strchr. We don't
+// have wchar_t available here, but in the GNU C Library
+// wchar_t is always 32 bits wide.
+
+#define WCSCHR(soname, fnname) \
+ Int* VG_REPLACE_FUNCTION_EZU(20400,soname,fnname) ( const Int* s, Int c ); \
+ Int* VG_REPLACE_FUNCTION_EZU(20400,soname,fnname) ( const Int* s, Int c ) \
+ { \
+ Int* p = (Int*)s; \
+ while (True) { \
+ if (*p == c) return p; \
+ if (*p == 0) return NULL; \
+ p++; \
+ } \
+ }
+
+#if defined(VGO_linux)
+ WCSCHR(VG_Z_LIBC_SONAME, wcschr)
+#endif
+/*---------------------- wcsrchr ----------------------*/
+
+// This is a wchar_t equivalent to strrchr. We don't
+// have wchar_t available here, but in the GNU C Library
+// wchar_t is always 32 bits wide.
+
+#define WCSRCHR(soname, fnname) \
+ Int* VG_REPLACE_FUNCTION_EZU(20410,soname,fnname)( const Int* s, Int c ); \
+ Int* VG_REPLACE_FUNCTION_EZU(20410,soname,fnname)( const Int* s, Int c ) \
+ { \
+ Int* p = (Int*) s; \
+ Int* last = NULL; \
+ while (True) { \
+ if (*p == c) last = p; \
+ if (*p == 0) return last; \
+ p++; \
+ } \
+ }
+
+#if defined(VGO_linux)
+ WCSRCHR(VG_Z_LIBC_SONAME, wcsrchr)
+#endif
+
/*------------------------------------------------------------*/
/*--- Improve definedness checking of process environment ---*/
/*------------------------------------------------------------*/
Index: valgrind/memcheck/tests/Makefile.am
===================================================================
--- valgrind/memcheck/tests/Makefile.am (revision 13016)
+++ valgrind/memcheck/tests/Makefile.am (working copy)
@@ -216,6 +217,7 @@
vcpu_fbench.stdout.exp vcpu_fbench.stderr.exp vcpu_fbench.vgtest \
vcpu_fnfns.stdout.exp vcpu_fnfns.stdout.exp-glibc28-amd64 \
vcpu_fnfns.stdout.exp-darwin vcpu_fnfns.stderr.exp vcpu_fnfns.vgtest \
+ wcs.vgtest wcs.stderr.exp \
wrap1.vgtest wrap1.stdout.exp wrap1.stderr.exp \
wrap2.vgtest wrap2.stdout.exp wrap2.stderr.exp \
wrap3.vgtest wrap3.stdout.exp wrap3.stderr.exp \
@@ -292,6 +294,7 @@
varinfo1 varinfo2 varinfo3 varinfo4 \
varinfo5 varinfo5so.so varinfo6 \
vcpu_fbench vcpu_fnfns \
+ wcs \
xml1 \
wrap1 wrap2 wrap3 wrap4 wrap5 wrap6 wrap7 wrap7so.so wrap8 \
writev1
Index: valgrind/memcheck/tests/wcs.c
===================================================================
--- valgrind/memcheck/tests/wcs.c (revision 0)
+++ valgrind/memcheck/tests/wcs.c (working copy)
@@ -0,0 +1,29 @@
+// Uses various wchar_t * functions that have hand written SSE assembly
+// implementations in glibc. wcslen, wcscpy, wcscmp, wcsrchr, wcschr.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <wchar.h>
+
+int main(int argc, char **argv)
+{
+ wchar_t a[] = L"The spazzy orange tiger jumped over the tawny jaguar.";
+ wchar_t *b, *c;
+ wchar_t *d, *e;
+
+ size_t l = wcslen (a);
+ fprintf (stderr, "wcslen: %zd\n", l); // wcslen: 53
+
+ b = (wchar_t *) malloc((l + 1) * sizeof (wchar_t));
+ c = wcscpy (b, a);
+
+ fprintf (stderr, "wcscmp equal: %d\n", wcscmp (a, b)); // wcscmp equal: 0
+
+ d = wcsrchr (a, L'd');
+ e = wcschr (a, L'd');
+
+ fprintf (stderr, "wcsrchr == wcschr: %d\n", d == e); // wcsrchr == wcschr: 1
+
+ free (c); // b == c
+ return 0;
+}
Index: valgrind/memcheck/tests/wcs.stderr.exp
===================================================================
--- valgrind/memcheck/tests/wcs.stderr.exp (revision 0)
+++ valgrind/memcheck/tests/wcs.stderr.exp (working copy)
@@ -0,0 +1,3 @@
+wcslen: 53
+wcscmp equal: 0
+wcsrchr == wcschr: 1
Index: valgrind/memcheck/tests/wcs.vgtest
===================================================================
--- valgrind/memcheck/tests/wcs.vgtest (revision 0)
+++ valgrind/memcheck/tests/wcs.vgtest (working copy)
@@ -0,0 +1,2 @@
+prog: wcs
+vgopts: -q
--- valgrind-3.8.1/memcheck/tests/Makefile.in.orig 2012-10-04 22:27:31.879093431 +0200
+++ valgrind-3.8.1/memcheck/tests/Makefile.in 2012-10-04 22:28:55.381301338 +0200
@@ -114,7 +114,7 @@
unit_oset$(EXEEXT) varinfo1$(EXEEXT) varinfo2$(EXEEXT) \
varinfo3$(EXEEXT) varinfo4$(EXEEXT) varinfo5$(EXEEXT) \
varinfo5so.so$(EXEEXT) varinfo6$(EXEEXT) vcpu_fbench$(EXEEXT) \
- vcpu_fnfns$(EXEEXT) xml1$(EXEEXT) wrap1$(EXEEXT) \
+ vcpu_fnfns$(EXEEXT) wcs$(EXEEXT) xml1$(EXEEXT) wrap1$(EXEEXT) \
wrap2$(EXEEXT) wrap3$(EXEEXT) wrap4$(EXEEXT) wrap5$(EXEEXT) \
wrap6$(EXEEXT) wrap7$(EXEEXT) wrap7so.so$(EXEEXT) \
wrap8$(EXEEXT) writev1$(EXEEXT) $(am__EXEEXT_1)
@@ -530,6 +530,9 @@
vcpu_fnfns_DEPENDENCIES =
vcpu_fnfns_LINK = $(CCLD) $(vcpu_fnfns_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
+wcs_SOURCES = wcs.c
+wcs_OBJECTS = wcs.$(OBJEXT)
+wcs_LDADD = $(LDADD)
wrap1_SOURCES = wrap1.c
wrap1_OBJECTS = wrap1.$(OBJEXT)
wrap1_LDADD = $(LDADD)
@@ -610,9 +613,9 @@
suppfree.c test-plo.c trivialleak.c unit_libcbase.c \
unit_oset.c varinfo1.c varinfo2.c varinfo3.c varinfo4.c \
$(varinfo5_SOURCES) $(varinfo5so_so_SOURCES) varinfo6.c \
- vcpu_fbench.c vcpu_fnfns.c wrap1.c wrap2.c wrap3.c wrap4.c \
- wrap5.c wrap6.c $(wrap7_SOURCES) $(wrap7so_so_SOURCES) wrap8.c \
- writev1.c xml1.c
+ vcpu_fbench.c vcpu_fnfns.c wcs.c wrap1.c wrap2.c wrap3.c \
+ wrap4.c wrap5.c wrap6.c $(wrap7_SOURCES) $(wrap7so_so_SOURCES) \
+ wrap8.c writev1.c xml1.c
DIST_SOURCES = accounting.c addressable.c atomic_incs.c badaddrvalue.c \
badfree.c badjump.c badjump2.c badloop.c badpoll.c badrw.c \
big_blocks_freed_list.c brk2.c buflen_check.c bug287260.c \
@@ -641,9 +644,9 @@
suppfree.c test-plo.c trivialleak.c unit_libcbase.c \
unit_oset.c varinfo1.c varinfo2.c varinfo3.c varinfo4.c \
$(varinfo5_SOURCES) $(varinfo5so_so_SOURCES) varinfo6.c \
- vcpu_fbench.c vcpu_fnfns.c wrap1.c wrap2.c wrap3.c wrap4.c \
- wrap5.c wrap6.c $(wrap7_SOURCES) $(wrap7so_so_SOURCES) wrap8.c \
- writev1.c xml1.c
+ vcpu_fbench.c vcpu_fnfns.c wcs.c wrap1.c wrap2.c wrap3.c \
+ wrap4.c wrap5.c wrap6.c $(wrap7_SOURCES) $(wrap7so_so_SOURCES) \
+ wrap8.c writev1.c xml1.c
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
@@ -1142,6 +1145,7 @@
vcpu_fbench.stdout.exp vcpu_fbench.stderr.exp vcpu_fbench.vgtest \
vcpu_fnfns.stdout.exp vcpu_fnfns.stdout.exp-glibc28-amd64 \
vcpu_fnfns.stdout.exp-darwin vcpu_fnfns.stderr.exp vcpu_fnfns.vgtest \
+ wcs.vgtest wcs.stderr.exp \
wrap1.vgtest wrap1.stdout.exp wrap1.stderr.exp \
wrap2.vgtest wrap2.stdout.exp wrap2.stderr.exp \
wrap3.vgtest wrap3.stdout.exp wrap3.stderr.exp \
@@ -1629,6 +1633,9 @@
vcpu_fnfns$(EXEEXT): $(vcpu_fnfns_OBJECTS) $(vcpu_fnfns_DEPENDENCIES)
@rm -f vcpu_fnfns$(EXEEXT)
$(vcpu_fnfns_LINK) $(vcpu_fnfns_OBJECTS) $(vcpu_fnfns_LDADD) $(LIBS)
+wcs$(EXEEXT): $(wcs_OBJECTS) $(wcs_DEPENDENCIES)
+ @rm -f wcs$(EXEEXT)
+ $(LINK) $(wcs_OBJECTS) $(wcs_LDADD) $(LIBS)
wrap1$(EXEEXT): $(wrap1_OBJECTS) $(wrap1_DEPENDENCIES)
@rm -f wrap1$(EXEEXT)
$(LINK) $(wrap1_OBJECTS) $(wrap1_LDADD) $(LIBS)
@@ -1784,6 +1791,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/varinfo6-varinfo6.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcpu_fbench-vcpu_fbench.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcpu_fnfns-vcpu_fnfns.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrap1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrap2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrap3.Po@am__quote@

View File

@ -1,52 +0,0 @@
--- valgrind/coregrind/m_stacktrace.c.jj 2012-08-05 18:04:16.000000000 +0200
+++ valgrind/coregrind/m_stacktrace.c 2012-08-10 12:13:46.069797051 +0200
@@ -149,11 +149,23 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId
/* Try to derive a new (ip,sp,fp) triple from the current
set. */
- /* On x86, first try the old-fashioned method of following the
- %ebp-chain. Code which doesn't use this (that is, compiled
- with -fomit-frame-pointer) is not ABI compliant and so
- relatively rare. Besides, trying the CFI first almost always
- fails, and is expensive. */
+ /* On x86 GCC 4.6 and later now defaults to -fomit-frame-pointer
+ together with emitting unwind info (-fasynchronous-unwind-tables).
+ So, try CF info first. */
+ if ( VG_(use_CF_info)( &uregs, fp_min, fp_max ) ) {
+ if (0 == uregs.xip || 1 == uregs.xip) break;
+ if (sps) sps[i] = uregs.xsp;
+ if (fps) fps[i] = uregs.xbp;
+ ips[i++] = uregs.xip - 1; /* -1: refer to calling insn, not the RA */
+ if (debug)
+ VG_(printf)(" ipsC[%d]=0x%08lx\n", i-1, ips[i-1]);
+ uregs.xip = uregs.xip - 1;
+ /* as per comment at the head of this loop */
+ continue;
+ }
+
+ /* And only then the old-fashioned method of following the
+ %ebp-chain. */
/* Deal with frames resulting from functions which begin "pushl%
ebp ; movl %esp, %ebp" which is the ABI-mandated preamble. */
if (fp_min <= uregs.xbp &&
@@ -179,20 +191,6 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId
uregs.xip = uregs.xip - 1;
/* as per comment at the head of this loop */
continue;
- }
-
- /* That didn't work out, so see if there is any CF info to hand
- which can be used. */
- if ( VG_(use_CF_info)( &uregs, fp_min, fp_max ) ) {
- if (0 == uregs.xip || 1 == uregs.xip) break;
- if (sps) sps[i] = uregs.xsp;
- if (fps) fps[i] = uregs.xbp;
- ips[i++] = uregs.xip - 1; /* -1: refer to calling insn, not the RA */
- if (debug)
- VG_(printf)(" ipsC[%d]=0x%08lx\n", i-1, ips[i-1]);
- uregs.xip = uregs.xip - 1;
- /* as per comment at the head of this loop */
- continue;
}
/* And, similarly, try for MSVC FPO unwind info. */

View File

@ -1,11 +0,0 @@
--- valgrind/tests/x86_amd64_features.c 2012-07-11 15:30:47.564508460 +0200
+++ valgrind/tests/x86_amd64_features.c 2012-09-23 21:21:40.826638636 +0200
@@ -123,7 +123,7 @@
cmask = 1 << 20;
} else if ( strcmp( cpu, "amd64-avx" ) == 0 ) {
level = 1;
- cmask = (1 << 20) | (1 << 28);
+ cmask = (1 << 27) | (1 << 28); /* osxsave and avx */
require_xgetbv = True;
#endif
} else {

View File

@ -1,32 +0,0 @@
--- valgrind/VEX/priv/guest_amd64_toIR.c.jj 2012-10-16 09:53:54.000000000 +0200
+++ valgrind/VEX/priv/guest_amd64_toIR.c 2012-10-16 11:06:26.007515653 +0200
@@ -20117,6 +20117,14 @@ Long dis_ESC_0F (
delta = dis_movx_E_G ( vbi, pfx, delta, 2, sz, True );
return delta;
+ case 0xC0: { /* XADD Gb,Eb */
+ Bool decode_OK = False;
+ delta = dis_xadd_G_E ( &decode_OK, vbi, pfx, 1, delta );
+ if (!decode_OK)
+ goto decode_failure;
+ return delta;
+ }
+
case 0xC1: { /* XADD Gv,Ev */
Bool decode_OK = False;
delta = dis_xadd_G_E ( &decode_OK, vbi, pfx, sz, delta );
@@ -26992,14 +27000,6 @@ DisResult disInstr_AMD64_WRK (
/* =-=-=-=-=-=-=-=-=- XADD -=-=-=-=-=-=-=-=-=-= */
- case 0xC0: { /* XADD Gb,Eb */
- Bool decode_OK = False;
- delta = dis_xadd_G_E ( &decode_OK, vbi, pfx, 1, delta );
- if (!decode_OK)
- goto decode_failure;
- break;
- }
-
/* =-=-=-=-=-=-=-=-=- SGDT and SIDT =-=-=-=-=-=-=-=-=-=-= */
/* =-=-=-=-=-=-=-=-=- unimp2 =-=-=-=-=-=-=-=-=-=-= */

View File

@ -1,216 +0,0 @@
commit abe8793d216293af960a0334401795bf74945705
Author: sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Date: Thu Nov 8 15:45:16 2012 +0000
Ignore ELF sections that have zero size. Fixes #309600.
(Dragos Tatulea, dragos.tatulea@gmail.com)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13109 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c
index d78dc7a..2d08b67 100644
--- a/coregrind/m_debuginfo/readelf.c
+++ b/coregrind/m_debuginfo/readelf.c
@@ -1713,7 +1713,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
UChar* name = shdr_strtab_img + shdr->sh_name;
Addr svma = shdr->sh_addr;
OffT foff = shdr->sh_offset;
- UWord size = shdr->sh_size;
+ UWord size = shdr->sh_size; /* Do not change this to be signed. */
UInt alyn = shdr->sh_addralign;
Bool bits = !(shdr->sh_type == SHT_NOBITS);
/* Look through our collection of info obtained from the PT_LOAD
@@ -1754,6 +1754,12 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
goto out;
}
+ /* Ignore zero sized sections. */
+ if (size == 0) {
+ TRACE_SYMTAB("zero sized section \"%s\", ignoring\n", name);
+ continue;
+ }
+
# define BAD(_secname) \
do { ML_(symerr)(di, True, \
"Can't make sense of " _secname \
@@ -1770,7 +1776,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
/* Accept .text where mapped as rx (code), even if zero-sized */
if (0 == VG_(strcmp)(name, ".text")) {
- if (inrx && size >= 0 && !di->text_present) {
+ if (inrx && !di->text_present) {
di->text_present = True;
di->text_svma = svma;
di->text_avma = svma + inrx->bias;
@@ -1792,7 +1798,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
/* Accept .data where mapped as rw (data), even if zero-sized */
if (0 == VG_(strcmp)(name, ".data")) {
- if (inrw && size >= 0 && !di->data_present) {
+ if (inrw && !di->data_present) {
di->data_present = True;
di->data_svma = svma;
di->data_avma = svma + inrw->bias;
@@ -1814,7 +1820,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
/* Accept .sdata where mapped as rw (data) */
if (0 == VG_(strcmp)(name, ".sdata")) {
- if (inrw && size > 0 && !di->sdata_present) {
+ if (inrw && !di->sdata_present) {
di->sdata_present = True;
di->sdata_svma = svma;
di->sdata_avma = svma + inrw->bias;
@@ -1836,7 +1842,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
/* Accept .rodata where mapped as rx (data), even if zero-sized */
if (0 == VG_(strcmp)(name, ".rodata")) {
- if (inrx && size >= 0 && !di->rodata_present) {
+ if (inrx && !di->rodata_present) {
di->rodata_present = True;
di->rodata_svma = svma;
di->rodata_avma = svma + inrx->bias;
@@ -1858,7 +1864,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
}
if (0 == VG_(strcmp)(name, ".dynbss")) {
- if (inrw && size > 0 && !di->bss_present) {
+ if (inrw && !di->bss_present) {
dynbss_present = True;
di->bss_present = True;
di->bss_svma = svma;
@@ -1879,7 +1885,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
/* Accept .bss where mapped as rw (data), even if zero-sized */
if (0 == VG_(strcmp)(name, ".bss")) {
- if (inrw && size > 0 && dynbss_present) {
+ if (inrw && dynbss_present) {
vg_assert(di->bss_present);
dynbss_present = False;
vg_assert(di->bss_svma + di->bss_size == svma);
@@ -1891,7 +1897,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
TRACE_SYMTAB("acquiring .bss bias = %#lx\n", di->bss_bias);
} else
- if (inrw && size >= 0 && !di->bss_present) {
+ if (inrw && !di->bss_present) {
di->bss_present = True;
di->bss_svma = svma;
di->bss_avma = svma + inrw->bias;
@@ -1909,7 +1915,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
} else
/* Now one from the wtf?! department ... */
- if (inrx && (!inrw) && size >= 0 && !di->bss_present) {
+ if (inrx && (!inrw) && !di->bss_present) {
/* File contains a .bss, but it got mapped as rx only.
This is very strange. For now, just pretend we didn't
see it :-) */
@@ -1930,7 +1936,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
}
} else
- if ((!inrw) && (!inrx) && size >= 0 && !di->bss_present) {
+ if ((!inrw) && (!inrx) && !di->bss_present) {
/* File contains a .bss, but it didn't get mapped. Ignore. */
di->bss_present = False;
di->bss_svma = 0;
@@ -1943,7 +1949,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
}
if (0 == VG_(strcmp)(name, ".sdynbss")) {
- if (inrw && size >= 0 && !di->sbss_present) {
+ if (inrw && !di->sbss_present) {
sdynbss_present = True;
di->sbss_present = True;
di->sbss_svma = svma;
@@ -1964,7 +1970,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
/* Accept .sbss where mapped as rw (data) */
if (0 == VG_(strcmp)(name, ".sbss")) {
- if (inrw && size > 0 && sdynbss_present) {
+ if (inrw && sdynbss_present) {
vg_assert(di->sbss_present);
sdynbss_present = False;
vg_assert(di->sbss_svma + di->sbss_size == svma);
@@ -1976,7 +1982,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
TRACE_SYMTAB("acquiring .sbss bias = %#lx\n", di->sbss_bias);
} else
- if (inrw && size > 0 && !di->sbss_present) {
+ if (inrw && !di->sbss_present) {
di->sbss_present = True;
di->sbss_svma = svma;
di->sbss_avma = svma + inrw->bias;
@@ -1998,7 +2004,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
/* Accept .got where mapped as rw (data) */
if (0 == VG_(strcmp)(name, ".got")) {
- if (inrw && size > 0 && !di->got_present) {
+ if (inrw && !di->got_present) {
di->got_present = True;
di->got_avma = svma + inrw->bias;
di->got_size = size;
@@ -2010,7 +2016,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
/* Accept .got.plt where mapped as rw (data) */
if (0 == VG_(strcmp)(name, ".got.plt")) {
- if (inrw && size > 0 && !di->gotplt_present) {
+ if (inrw && !di->gotplt_present) {
di->gotplt_present = True;
di->gotplt_avma = svma + inrw->bias;
di->gotplt_size = size;
@@ -2026,7 +2032,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
|| defined(VGP_mips32_linux)
/* Accept .plt where mapped as rx (code) */
if (0 == VG_(strcmp)(name, ".plt")) {
- if (inrx && size > 0 && !di->plt_present) {
+ if (inrx && !di->plt_present) {
di->plt_present = True;
di->plt_avma = svma + inrx->bias;
di->plt_size = size;
@@ -2038,7 +2044,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
# elif defined(VGP_ppc32_linux)
/* Accept .plt where mapped as rw (data) */
if (0 == VG_(strcmp)(name, ".plt")) {
- if (inrw && size > 0 && !di->plt_present) {
+ if (inrw && !di->plt_present) {
di->plt_present = True;
di->plt_avma = svma + inrw->bias;
di->plt_size = size;
@@ -2050,7 +2056,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
# elif defined(VGP_ppc64_linux)
/* Accept .plt where mapped as rw (data), or unmapped */
if (0 == VG_(strcmp)(name, ".plt")) {
- if (inrw && size > 0 && !di->plt_present) {
+ if (inrw && !di->plt_present) {
di->plt_present = True;
di->plt_avma = svma + inrw->bias;
di->plt_size = size;
@@ -2073,7 +2079,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
/* Accept .opd where mapped as rw (data) */
if (0 == VG_(strcmp)(name, ".opd")) {
- if (inrw && size > 0 && !di->opd_present) {
+ if (inrw && !di->opd_present) {
di->opd_present = True;
di->opd_avma = svma + inrw->bias;
di->opd_size = size;
@@ -2088,14 +2094,14 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
rw (data) instead. We can handle up to N_EHFRAME_SECTS per
ELF object. */
if (0 == VG_(strcmp)(name, ".eh_frame")) {
- if (inrx && size > 0 && di->n_ehframe < N_EHFRAME_SECTS) {
+ if (inrx && di->n_ehframe < N_EHFRAME_SECTS) {
di->ehframe_avma[di->n_ehframe] = svma + inrx->bias;
di->ehframe_size[di->n_ehframe] = size;
TRACE_SYMTAB("acquiring .eh_frame avma = %#lx\n",
di->ehframe_avma[di->n_ehframe]);
di->n_ehframe++;
} else
- if (inrw && size > 0 && di->n_ehframe < N_EHFRAME_SECTS) {
+ if (inrw && di->n_ehframe < N_EHFRAME_SECTS) {
di->ehframe_avma[di->n_ehframe] = svma + inrw->bias;
di->ehframe_size[di->n_ehframe] = size;
TRACE_SYMTAB("acquiring .eh_frame avma = %#lx\n",

View File

@ -8,10 +8,10 @@
Int sets_min_1; Int sets_min_1;
Int line_size_bits; Int line_size_bits;
Int tag_shift; Int tag_shift;
- Char desc_line[128]; - HChar desc_line[128];
UWord* tags; UWord* tags;
-} cache_t2; -} cache_t2;
+ Char desc_line[128]; + HChar desc_line[128];
+} cache_t2 +} cache_t2
+#ifdef __GNUC__ +#ifdef __GNUC__
+__attribute__ ((aligned (8 * sizeof (Int)))) +__attribute__ ((aligned (8 * sizeof (Int))))
@ -51,4 +51,4 @@
+ sizeof(UWord), sets * c->assoc); + sizeof(UWord), sets * c->assoc);
} }
/* This is done as a macro rather than by passing in the cache_t2 as an /* This attribute forces GCC to inline the function, getting rid of a

View File

@ -2,200 +2,35 @@
Summary: Tool for finding memory management bugs in programs Summary: Tool for finding memory management bugs in programs
Name: %{?scl_prefix}valgrind Name: %{?scl_prefix}valgrind
Version: 3.8.1 Version: 3.9.0
Release: 31%{?dist} Release: 0.1.TEST1%{?dist}
Epoch: 1 Epoch: 1
License: GPLv2 License: GPLv2+
URL: http://www.valgrind.org/ URL: http://www.valgrind.org/
Group: Development/Debuggers Group: Development/Debuggers
# Only necessary for RHEL, will be ignored on Fedora # Only necessary for RHEL, will be ignored on Fedora
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0: http://www.valgrind.org/downloads/valgrind-%{version}.tar.bz2 Source0: http://www.valgrind.org/downloads/valgrind-%{version}.TEST1.tar.bz2
Patch1: valgrind-3.8.1-cachegrind-improvements.patch # Needs investigation and pushing upstrea
Patch1: valgrind-3.9.0-cachegrind-improvements.patch
# KDE#307103 - sys_openat If pathname is absolute, then dirfd is ignored.
Patch2: valgrind-3.8.1-openat.patch
# KDE#211352 - helgrind races in helgrind's own mythread_wrapper # KDE#211352 - helgrind races in helgrind's own mythread_wrapper
Patch3: valgrind-3.8.1-helgrind-race-supp.patch Patch2: valgrind-3.9.0-helgrind-race-supp.patch
Patch4: valgrind-3.8.1-stat_h.patch # undef st_atime, st_mtime and st_ctime. Unknown why this is (still?) needed.
Patch3: valgrind-3.9.0-stat_h.patch
# Support really ancient gcc. Check __GNUC__ >= 3 for __builtin_expect. # Support really ancient gcc. Check __GNUC__ >= 3 for __builtin_expect.
Patch5: valgrind-3.8.1-config_h.patch Patch4: valgrind-3.9.0-config_h.patch
# KDE#307101 - sys_capget second argument can be NULL # Make ld.so supressions slightly less specific.
Patch6: valgrind-3.8.1-capget.patch Patch5: valgrind-3.8.1-ldso-supp.patch
# KDE#263034 - Crash when loading some PPC64 binaries
Patch7: valgrind-3.8.1-pie.patch
# configure detection change from armv7* to armv[57]*.
Patch8: valgrind-3.8.1-enable-armv5.patch
Patch9: valgrind-3.8.1-ldso-supp.patch
# On x86 GCC 4.6 and later now defaults to -fomit-frame-pointer
# together with emitting unwind info (-fasynchronous-unwind-tables).
# So, try CF info first.
Patch10: valgrind-3.8.1-x86-backtrace.patch
# KDE#305431 - Use find_buildid shdr fallback for separate .debug files
Patch11: valgrind-3.8.1-find-buildid.patch
# KDE#305513 - Fix readdwarf.c read_unitinfo_dwarf2 abbrev reading
Patch12: valgrind-3.8.1-abbrev-parsing.patch
# KDE#307038 - DWARF2 CFI reader: unhandled DW_OP_ opcode 0x8 (DW_OP_const1u)
Patch13: valgrind-3.8.1-cfi_dw_ops.patch
# On some ppc64 installs these test just hangs # On some ppc64 installs these test just hangs
Patch14: valgrind-3.8.1-gdbserver_tests-mcinvoke-ppc64.patch Patch6: valgrind-3.8.1-gdbserver_tests-mcinvoke-ppc64.patch
# KDE#307285 - x86_amd64 feature test for avx in test suite is wrong
# Should test OSXSAVE first before executing XGETBV.
Patch15: valgrind-3.8.1-x86_amd64_features-avx.patch
# KDE#307155 - gdbserver_tests/filter_gdb should filter out syscall-template.S
# This is only a real issue when glibc-debuginfo is installed.
Patch16: valgrind-3.8.1-gdbserver_tests-syscall-template-source.patch
# KDE#307290 - memcheck overlap testcase needs memcpy version filter
Patch17: valgrind-3.8.1-overlap_memcpy_filter.patch
# Note: Need to make memcheck/tests/filter_memcpy executable
# KDE#307729 - pkgconfig support broken valgrind.pc
# valt_load_address=@VALT_LOAD_ADDRESS@
Patch18: valgrind-3.8.1-pkg-config.patch
# KDE#253519 - Memcheck reports auxv pointer accesses as invalid reads.
Patch19: valgrind-3.8.1-proc-auxv.patch
# KDE#307828 - SSE optimized wcscpy, wcscmp, wcsrchr and wcschr trigger
# uninitialised value and/or invalid read warnings
Patch20: valgrind-3.8.1-wcs.patch
# KDE#305728 - Add support for AVX2, BMI1, BMI2 and FMA instructions
# Combined patch for:
# - valgrind-avx2-1.patch
# - valgrind-avx2-2.patch
# - valgrind-avx2-3.patch
# - valgrind-avx2-4.patch
# - valgrind-bmi-1.patch
# - valgrind-bmi-2.patch
# - valgrind-bmi-3.patch
# - valgrind-fma-1.patch
# - valgrind-memcheck-avx2-bmi-fma.patch
# - valgrind-vmaskmov-load.patch
# - valgrind-avx2-5.patch
# - valgrind-bmi-4.patch
# - valgrind-avx2-bmi-fma-tests.tar.bz2
#
# NOTE: Need to touch empty files from tar file:
# ./none/tests/amd64/avx2-1.stderr.exp
# ./none/tests/amd64/fma.stderr.exp
# ./none/tests/amd64/bmi.stderr.exp
Patch21: valgrind-3.8.1-avx2-bmi-fma.patch.gz
# Small fixup for above patch, just a configure check.
# This is equivalent to valgrind-bmi-5.patch from KDE#305728
Patch22: valgrind-3.8.1-bmi-conf-check.patch
# Partial backport of upstream revision 12884 without it AVX2 VPBROADCASTB
# insn is broken under memcheck.
Patch23: valgrind-3.8.1-memcheck-mc_translate-Iop_8HLto16.patch
# vgtest files should prereq that the binary is there (for old binutils).
Patch24: valgrind-3.8.1-avx2-prereq.patch
# KDE#308321 - testsuite memcheck filter interferes with gdb_filter
Patch25: valgrind-3.8.1-filter_gdb.patch
# KDE#308341 - vgdb should report process exit (or fatal signal)
Patch26: valgrind-3.8.1-gdbserver_exit.patch
# KDE#164485 - VG_N_SEGNAMES and VG_N_SEGMENTS are (still) too small
Patch27: valgrind-3.8.1-aspacemgr_VG_N_SEGs.patch
# KDE#308427 - s390 memcheck reports tsearch conditional jump or move
# depends on uninitialized value [workaround, suppression]
Patch28: valgrind-3.8.1-s390_tsearch_supp.patch
# KDE#307106 - unhandled instruction bytes: f0 0f c0 02 (lock xadd)
Patch29: valgrind-3.8.1-xaddb.patch
# KDE#309427 - SSE optimized stpncpy trigger uninitialised value
Patch30: valgrind-3.8.1-stpncpy.patch
# KDE#308573 - Internal Valgrind error on 64-bit instruction executed
# in 32-bit mode
Patch31: valgrind-3.8.1-ppc-32-mode-64-bit-instr.patch
# KDE#309425 - Provide a --sigill-diagnostics flag to suppress
# illegal instruction reporting
Patch32: valgrind-3.8.1-sigill_diag.patch
# Allow building against glibc-2.17. Upstream commit svn 13228.
# Allow building against glibc-2.18. Upstream commit svn 13504.
Patch33: valgrind-3.8.1-glibc-2.17-18.patch
# KDE#315441 - sendmsg syscall should ignore unset msghdr msg_flags
Patch34: valgrind-3.8.1-sendmsg-flags.patch
# KDE#308886 - Missing support for PTRACE_SET/GETREGSET
Patch35: valgrind-3.8.1-ptrace-setgetregset.patch
# KDE#310424 - --read-var-info does not properly describe static variables
Patch36: valgrind-3.8.1-static-variables.patch
# KDE#316144, KDE#315959, KDE#316145 - various manpage fixes
Patch37: valgrind-3.8.1-manpages.patch
# KDE#317091 Use -Wl,-Ttext-segment when static linking to keep build-ids
Patch38: valgrind-3.8.1-text-segment.patch
# svn revisions 13348 and 13349
Patch39: valgrind-3.8.1-regtest-fixlets.patch
# KDE#309600 - valgrind is a bit confused about 0-sized sections
Patch40: valgrind-3.8.1-zero-size-sections.patch
# KDE#289360 - parse_type_DIE confused by DW_TAG_enumeration_type
Patch41: valgrind-3.8.1-dwarf-anon-enum.patch
# KDE#321969 - Support [lf]setxattr on ppc32 and ppc64 linux kernel
Patch42: valgrind-3.8.1-ppc-setxattr.patch
# KDE#321730 Add cg_merge and cg_diff man pages
# KDE#321738 Add manpages for vgdb and valgrind-listener
Patch43: valgrind-3.8.1-new-manpages.patch
# KDE#320063 Support PTRACE_GET/SET_THREAD_AREA on x86.
Patch44: valgrind-3.8.1-ptrace-thread-area.patch
# KDE#320116 Support Linux kernel AF_BLUETOOTH for bind()
Patch45: valgrind-3.8.1-af-bluetooth.patch
# Don't include linux/ptrace.h. Upstream commits r13471 and r13482.
Patch46: valgrind-3.8.1-ptrace-include-configure.patch
# KDE#322294 Initial ISA 2.07 support for POWER8-tuned libc.
Patch47: valgrind-3.8.1-initial-power-isa-207.patch
# KDE#323116 Deprecation of some ISA 2.05 POWER6 instructions.
Patch48: valgrind-3.8.1-power-isa-205-deprecation.patch
# KDE#310931 message-security assist instruction extension not implemented
Patch49: valgrind-3.8.1-s390-STFLE.patch
# KDE#323713 Support mmxext (integer sse) subset on i386 (athlon)
Patch50: valgrind-3.8.1-mmxext.patch
# KDE#316503 Implement SSE4 MOVNTDQA insn.
Patch51: valgrind-3.8.1-movntdqa.patch
# rhbz#1011713 valgrind finds errors in index (workaround till 3.9.0)
Patch52: valgrind-3.8.1-index-supp.patch
%ifarch x86_64 ppc64 %ifarch x86_64 ppc64
@ -284,7 +119,7 @@ See the section on Debugging MPI Parallel Programs with Valgrind in the
Valgrind User Manual for details. Valgrind User Manual for details.
%prep %prep
%setup -q %{?scl:-n %{pkg_name}-%{version}} %setup -q -n %{?scl:%{pkg_name}}%{!?scl:%{name}}-%{version}.TEST1
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
@ -292,77 +127,6 @@ Valgrind User Manual for details.
%patch4 -p1 %patch4 -p1
%patch5 -p1 %patch5 -p1
%patch6 -p1 %patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
chmod 755 memcheck/tests/filter_memcpy
%patch18 -p1
%patch19 -p1
%patch20 -p1
# Add support for AVX2, BMI1, BMI2 and FMA instructions
%patch21 -p1
touch ./none/tests/amd64/avx2-1.stderr.exp
touch ./none/tests/amd64/fma.stderr.exp
touch ./none/tests/amd64/bmi.stderr.exp
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%ifarch s390x
%patch28 -p1
%endif
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
touch ./memcheck/tests/linux/getregset.stderr.exp
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%patch46 -p1
%patch47 -p1
chmod 755 tests/check_isa-2_07_cap
%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
# These tests go into an endless loop on ARM
# There is a __sync_add_and_fetch in the testcase.
# DRD is doing this trace printing inside the loop
# which causes the reservation (LDREX) to fail so
# it can never make progress.
%ifarch %{arm}
rm -f drd/tests/annotate_trace_memory_xml.vgtest
rm -f drd/tests/annotate_trace_memory.vgtest
%endif
# To suppress eventual automake warnings/errors
rm -f gdbserver_tests/filter_gdb.orig
%build %build
# We need to use the software collection compiler and binutils if available. # We need to use the software collection compiler and binutils if available.
@ -419,15 +183,12 @@ int main (int argc, char *const argv[])
EOF EOF
gcc $RPM_OPT_FLAGS -o close_fds close_fds.c gcc $RPM_OPT_FLAGS -o close_fds close_fds.c
# XXX pth_cancel2 hangs on x86_64
echo 'int main (void) { return 0; }' > none/tests/pth_cancel2.c
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT install
mkdir docs.installed mkdir docs/installed
mv $RPM_BUILD_ROOT%{_datadir}/doc/valgrind/* docs.installed/ mv $RPM_BUILD_ROOT%{_datadir}/doc/valgrind/* docs/installed/
rm -f docs.installed/*.ps rm -f docs/installed/*.ps
%if "%{valsecarch}" != "" %if "%{valsecarch}" != ""
pushd $RPM_BUILD_ROOT%{_libdir}/valgrind/ pushd $RPM_BUILD_ROOT%{_libdir}/valgrind/
@ -491,7 +252,7 @@ echo ===============END TESTING===============
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%doc COPYING NEWS README_* %doc COPYING NEWS README_*
%doc docs.installed/html docs.installed/*.pdf %doc docs/installed/html docs/installed/*.pdf
%{_bindir}/* %{_bindir}/*
%dir %{_libdir}/valgrind %dir %{_libdir}/valgrind
%{_libdir}/valgrind/*[^ao] %{_libdir}/valgrind/*[^ao]
@ -513,6 +274,57 @@ echo ===============END TESTING===============
%endif %endif
%changelog %changelog
* Mon Oct 28 2013 Mark Wielaard <mjw@redhat.com> - 3.9.0-0.1.TEST1
- Upgrade to valgrind 3.9.0.TEST1
- Remove patches that are now upstream:
- valgrind-3.8.1-abbrev-parsing.patch
- valgrind-3.8.1-af-bluetooth.patch
- valgrind-3.8.1-aspacemgr_VG_N_SEGs.patch
- valgrind-3.8.1-avx2-bmi-fma.patch.gz
- valgrind-3.8.1-avx2-prereq.patch
- valgrind-3.8.1-bmi-conf-check.patch
- valgrind-3.8.1-capget.patch
- valgrind-3.8.1-cfi_dw_ops.patch
- valgrind-3.8.1-dwarf-anon-enum.patch
- valgrind-3.8.1-filter_gdb.patch
- valgrind-3.8.1-find-buildid.patch
- valgrind-3.8.1-gdbserver_exit.patch
- valgrind-3.8.1-gdbserver_tests-syscall-template-source.patch
- valgrind-3.8.1-glibc-2.17-18.patch
- valgrind-3.8.1-index-supp.patch
- valgrind-3.8.1-initial-power-isa-207.patch
- valgrind-3.8.1-manpages.patch
- valgrind-3.8.1-memcheck-mc_translate-Iop_8HLto16.patch
- valgrind-3.8.1-mmxext.patch
- valgrind-3.8.1-movntdqa.patch
- valgrind-3.8.1-new-manpages.patch
- valgrind-3.8.1-openat.patch
- valgrind-3.8.1-overlap_memcpy_filter.patch
- valgrind-3.8.1-pie.patch
- valgrind-3.8.1-pkg-config.patch
- valgrind-3.8.1-power-isa-205-deprecation.patch
- valgrind-3.8.1-ppc-32-mode-64-bit-instr.patch
- valgrind-3.8.1-ppc-setxattr.patch
- valgrind-3.8.1-proc-auxv.patch
- valgrind-3.8.1-ptrace-include-configure.patch
- valgrind-3.8.1-ptrace-setgetregset.patch
- valgrind-3.8.1-ptrace-thread-area.patch
- valgrind-3.8.1-regtest-fixlets.patch
- valgrind-3.8.1-s390-STFLE.patch
- valgrind-3.8.1-s390_tsearch_supp.patch
- valgrind-3.8.1-sendmsg-flags.patch
- valgrind-3.8.1-sigill_diag.patch
- valgrind-3.8.1-static-variables.patch
- valgrind-3.8.1-stpncpy.patch
- valgrind-3.8.1-text-segment.patch
- valgrind-3.8.1-wcs.patch
- valgrind-3.8.1-x86_amd64_features-avx.patch
- valgrind-3.8.1-xaddb.patch
- valgrind-3.8.1-zero-size-sections.patch
- Remove special case valgrind-3.8.1-enable-armv5.patch.
- Remove valgrind-3.8.1-x86-backtrace.patch, rely on new upstream fp/cfi
try-cache mechanism.
* Mon Oct 14 2013 Mark Wielaard <mjw@redhat.com> - 3.8.1-31 * Mon Oct 14 2013 Mark Wielaard <mjw@redhat.com> - 3.8.1-31
- Fix multilib issue with HAVE_PTRACE_GETREGS in config.h. - Fix multilib issue with HAVE_PTRACE_GETREGS in config.h.