Blob Blame Raw
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 :