From 7657d9810ef77215f89a326273c2182df5e09cf4 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 9 Mar 2009 12:50:44 +0000 Subject: [PATCH] 3.4.1-1 --- .cvsignore | 2 +- sources | 2 +- valgrind-3.4.0-debug.patch | 1193 ----------------- valgrind-3.4.0-newbu.patch | 68 - valgrind-3.4.0-pkg-config.patch | 71 - valgrind-3.4.0-power5+-6.patch | 781 ----------- ...lgrind-3.4.1-cachegrind-improvements.patch | 10 +- ...penat.patch => valgrind-3.4.1-openat.patch | 0 valgrind.spec | 20 +- 9 files changed, 13 insertions(+), 2134 deletions(-) delete mode 100644 valgrind-3.4.0-debug.patch delete mode 100644 valgrind-3.4.0-newbu.patch delete mode 100644 valgrind-3.4.0-pkg-config.patch delete mode 100644 valgrind-3.4.0-power5+-6.patch rename valgrind-3.4.0-cachegrind-improvements.patch => valgrind-3.4.1-cachegrind-improvements.patch (88%) rename valgrind-3.4.0-openat.patch => valgrind-3.4.1-openat.patch (100%) diff --git a/.cvsignore b/.cvsignore index d395788..9697be4 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -valgrind-3.4.0.tar.bz2 +valgrind-3.4.1.tar.bz2 diff --git a/sources b/sources index 937f883..0ee930f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1b0fe1219e1a583ff8c2db54ed2265e6 valgrind-3.4.0.tar.bz2 +b5f039dd2271aaf9ae570ab4116f87c7 valgrind-3.4.1.tar.bz2 diff --git a/valgrind-3.4.0-debug.patch b/valgrind-3.4.0-debug.patch deleted file mode 100644 index 2c423cb..0000000 --- a/valgrind-3.4.0-debug.patch +++ /dev/null @@ -1,1193 +0,0 @@ ---- valgrind-3.4.0.vanilla/coregrind/m_debuginfo/d3basics.c 2009-01-02 19:40:41.000000000 +0100 -+++ valgrind-3.4.1.SVN-9098-1883/coregrind/m_debuginfo/d3basics.c 2009-01-27 16:32:54.000000000 +0100 -@@ -35,6 +35,7 @@ - */ - - #include "pub_core_basics.h" -+#include "pub_core_debuginfo.h" - #include "pub_core_libcassert.h" - #include "pub_core_libcprint.h" - #include "pub_core_options.h" -@@ -45,6 +46,7 @@ - - #include "priv_misc.h" - #include "priv_d3basics.h" /* self */ -+#include "priv_storage.h" - - HChar* ML_(pp_DW_children) ( DW_children hashch ) - { -@@ -372,7 +374,6 @@ static Long read_leb128S( UChar **data ) - return (Long)val; - } - -- - /* FIXME: duplicates logic in readdwarf.c: copy_convert_CfiExpr_tree - and {FP,SP}_REG decls */ - static Bool get_Dwarf_Reg( /*OUT*/Addr* a, Word regno, RegSummary* regs ) -@@ -400,12 +401,52 @@ static Bool get_Dwarf_Reg( /*OUT*/Addr* - return False; - } - -+/* Convert a stated address to an actual address */ -+static Bool bias_address( Addr* a, const DebugInfo* di ) -+{ -+ if (di->text_present -+ && di->text_size > 0 -+ && *a >= di->text_svma && *a < di->text_svma + di->text_size) { -+ *a += di->text_bias; -+ } -+ else if (di->data_present -+ && di->data_size > 0 -+ && *a >= di->data_svma && *a < di->data_svma + di->data_size) { -+ *a += di->data_bias; -+ } -+ else if (di->sdata_present -+ && di->sdata_size > 0 -+ && *a >= di->sdata_svma && *a < di->sdata_svma + di->sdata_size) { -+ *a += di->sdata_bias; -+ } -+ else if (di->rodata_present -+ && di->rodata_size > 0 -+ && *a >= di->rodata_svma && *a < di->rodata_svma + di->rodata_size) { -+ *a += di->rodata_bias; -+ } -+ else if (di->bss_present -+ && di->bss_size > 0 -+ && *a >= di->bss_svma && *a < di->bss_svma + di->bss_size) { -+ *a += di->bss_bias; -+ } -+ else if (di->sbss_present -+ && di->sbss_size > 0 -+ && *a >= di->sbss_svma && *a < di->sbss_svma + di->sbss_size) { -+ *a += di->sbss_bias; -+ } -+ else { -+ return False; -+ } -+ -+ return True; -+} -+ - - /* Evaluate a standard DWARF3 expression. See detailed description in - priv_d3basics.h. */ - GXResult ML_(evaluate_Dwarf3_Expr) ( UChar* expr, UWord exprszB, - GExpr* fbGX, RegSummary* regs, -- Addr data_bias, -+ const DebugInfo* di, - Bool push_initial_zero ) - { - # define N_EXPR_STACK 20 -@@ -508,14 +549,21 @@ GXResult ML_(evaluate_Dwarf3_Expr) ( UCh - horrible prelinking-induced complications as described - in "Comment_Regarding_DWARF3_Text_Biasing" in - readdwarf3.c? Currently I don't know. */ -- PUSH( *(Addr*)expr + data_bias ); -- expr += sizeof(Addr); -+ a1 = *(Addr*)expr; -+ if (bias_address(&a1, di)) { -+ PUSH( a1 ); -+ expr += sizeof(Addr); -+ } -+ else { -+ FAIL("evaluate_Dwarf3_Expr: DW_OP_addr with address " -+ "in unknown section"); -+ } - break; - case DW_OP_fbreg: - if (!fbGX) - FAIL("evaluate_Dwarf3_Expr: DW_OP_fbreg with " - "no expr for fbreg present"); -- fbval = ML_(evaluate_GX)(fbGX, NULL, regs, data_bias); -+ fbval = ML_(evaluate_GX)(fbGX, NULL, regs, di); - /* Convert fbval into something we can use. If we got a - Value, no problem. However, as per D3 spec sec 3.3.5 - (Low Level Information) sec 2, we could also get a -@@ -621,7 +669,7 @@ GXResult ML_(evaluate_Dwarf3_Expr) ( UCh - /* Evaluate a so-called Guarded (DWARF3) expression. See detailed - description in priv_d3basics.h. */ - GXResult ML_(evaluate_GX)( GExpr* gx, GExpr* fbGX, -- RegSummary* regs, Addr data_bias ) -+ RegSummary* regs, const DebugInfo* di ) - { - GXResult res; - Addr aMin, aMax; -@@ -655,7 +703,7 @@ GXResult ML_(evaluate_GX)( GExpr* gx, GE - /* Assert this is the first guard. */ - vg_assert(nGuards == 1); - res = ML_(evaluate_Dwarf3_Expr)( -- p, (UWord)nbytes, fbGX, regs, data_bias, -+ p, (UWord)nbytes, fbGX, regs, di, - False/*push_initial_zero*/ ); - /* Now check there are no more guards. */ - p += (UWord)nbytes; -@@ -665,7 +713,7 @@ GXResult ML_(evaluate_GX)( GExpr* gx, GE - if (aMin <= regs->ip && regs->ip <= aMax) { - /* found a matching range. Evaluate the expression. */ - return ML_(evaluate_Dwarf3_Expr)( -- p, (UWord)nbytes, fbGX, regs, data_bias, -+ p, (UWord)nbytes, fbGX, regs, di, - False/*push_initial_zero*/ ); - } - } -@@ -688,8 +736,11 @@ GXResult ML_(evaluate_GX)( GExpr* gx, GE - * any of the subexpressions do not produce a manifest constant - * there's more than one subexpression, all of which successfully - evaluate to a constant, but they don't all produce the same constant. -- */ --GXResult ML_(evaluate_trivial_GX)( GExpr* gx, Addr data_bias ) -+ JRS 23Jan09: the special-casing in this function is a nasty kludge. -+ Really it ought to be pulled out and turned into a general -+ constant- expression evaluator. -+*/ -+GXResult ML_(evaluate_trivial_GX)( GExpr* gx, const DebugInfo* di ) - { - GXResult res; - Addr aMin, aMax; -@@ -699,7 +750,7 @@ GXResult ML_(evaluate_trivial_GX)( GExpr - MaybeULong *mul, *mul2; - - HChar* badness = NULL; -- UChar* p = &gx->payload[0]; -+ UChar* p = &gx->payload[0]; /* must remain unsigned */ - XArray* results = VG_(newXA)( ML_(dinfo_zalloc), "di.d3basics.etG.1", - ML_(dinfo_free), - sizeof(MaybeULong) ); -@@ -730,12 +781,41 @@ GXResult ML_(evaluate_trivial_GX)( GExpr - /* Peer at this particular subexpression, to see if it's - obviously a constant. */ - if (nbytes == 1 + sizeof(Addr) && *p == DW_OP_addr) { -- thisResult.b = True; -- thisResult.ul = (ULong)(*(Addr*)(p+1)) + (ULong)data_bias; -+ /* DW_OP_addr a */ -+ Addr a = *(Addr*)(p+1); -+ if (bias_address(&a, di)) { -+ thisResult.b = True; -+ thisResult.ul = (ULong)a; -+ } else { -+ if (!badness) -+ badness = "trivial GExpr denotes constant address " -+ "in unknown section (1)"; -+ } - } -- else if (nbytes == 2 + sizeof(Addr) -- && *p == DW_OP_addr -- && *(p + 1 + sizeof(Addr)) == DW_OP_GNU_push_tls_address) { -+ else -+ if (nbytes == 1 + sizeof(Addr) + 1 + 1 -+ /* 11 byte block: 3 c0 b6 2b 0 0 0 0 0 23 4 -+ (DW_OP_addr: 2bb6c0; DW_OP_plus_uconst: 4) -+ This is really a nasty kludge - only matches if the -+ trailing ULEB denotes a number in the range 0 .. 127 -+ inclusive. */ -+ && p[0] == DW_OP_addr -+ && p[1 + sizeof(Addr)] == DW_OP_plus_uconst -+ && p[1 + sizeof(Addr) + 1] < 0x80 /*1-byte ULEB*/) { -+ Addr a = *(Addr*)&p[1]; -+ if (bias_address(&a, di)) { -+ thisResult.b = True; -+ thisResult.ul = (ULong)a + (ULong)p[1 + sizeof(Addr) + 1]; -+ } else { -+ if (!badness) -+ badness = "trivial GExpr denotes constant address " -+ "in unknown section (2)"; -+ } -+ } -+ else -+ if (nbytes == 2 + sizeof(Addr) -+ && *p == DW_OP_addr -+ && *(p + 1 + sizeof(Addr)) == DW_OP_GNU_push_tls_address) { - if (!badness) - badness = "trivial GExpr is DW_OP_addr plus trailing junk"; - } ---- valgrind-3.4.0.vanilla/coregrind/m_debuginfo/debuginfo.c 2009-01-02 19:40:41.000000000 +0100 -+++ valgrind-3.4.1.SVN-9098-1883/coregrind/m_debuginfo/debuginfo.c 2009-01-27 16:32:54.000000000 +0100 -@@ -1036,7 +1036,17 @@ static void search_all_symtabs ( Addr pt - (di->bss_present - && di->bss_size > 0 - && di->bss_avma <= ptr -- && ptr < di->bss_avma + di->bss_size); -+ && ptr < di->bss_avma + di->bss_size) -+ || -+ (di->sbss_present -+ && di->sbss_size > 0 -+ && di->sbss_avma <= ptr -+ && ptr < di->sbss_avma + di->sbss_size) -+ || -+ (di->rodata_present -+ && di->rodata_size > 0 -+ && di->rodata_avma <= ptr -+ && ptr < di->rodata_avma + di->rodata_size); - } - - if (!inRange) continue; -@@ -1064,6 +1074,7 @@ static void search_all_loctabs ( Addr pt - DebugInfo* di; - for (di = debugInfo_list; di != NULL; di = di->next) { - if (di->text_present -+ && di->text_size > 0 - && di->text_avma <= ptr - && ptr < di->text_avma + di->text_size) { - lno = ML_(search_one_loctab) ( di, ptr ); -@@ -1250,6 +1261,7 @@ Bool VG_(get_objname) ( Addr a, Char* bu - expect this to produce a result. */ - for (di = debugInfo_list; di != NULL; di = di->next) { - if (di->text_present -+ && di->text_size > 0 - && di->text_avma <= a - && a < di->text_avma + di->text_size) { - VG_(strncpy_safely)(buf, di->filename, nbuf); -@@ -1288,6 +1300,7 @@ DebugInfo* VG_(find_seginfo) ( Addr a ) - DebugInfo* di; - for (di = debugInfo_list; di != NULL; di = di->next) { - if (di->text_present -+ && di->text_size > 0 - && di->text_avma <= a - && a < di->text_avma + di->text_size) { - return di; -@@ -1928,7 +1941,7 @@ static Bool data_address_is_in_var ( /*O - DiVariable* var, - RegSummary* regs, - Addr data_addr, -- Addr data_bias ) -+ const DebugInfo* di ) - { - MaybeULong mul; - SizeT var_szB; -@@ -1965,7 +1978,7 @@ static Bool data_address_is_in_var ( /*O - return False; - } - -- res = ML_(evaluate_GX)( var->gexpr, var->fbGX, regs, data_bias ); -+ res = ML_(evaluate_GX)( var->gexpr, var->fbGX, regs, di ); - - if (show) { - VG_(printf)("VVVV: -> "); -@@ -2243,7 +2256,7 @@ Bool consider_vars_in_frame ( /*OUT*/Cha - var->name,arange->aMin,arange->aMax,ip); - if (data_address_is_in_var( &offset, di->admin_tyents, - var, ®s, -- data_addr, di->data_bias )) { -+ data_addr, di )) { - OffT residual_offset = 0; - XArray* described = ML_(describe_type)( &residual_offset, - di->admin_tyents, -@@ -2342,7 +2355,7 @@ Bool VG_(get_data_description)( /*OUT*/C - fail. */ - if (data_address_is_in_var( &offset, di->admin_tyents, var, - NULL/* RegSummary* */, -- data_addr, di->data_bias )) { -+ data_addr, di )) { - OffT residual_offset = 0; - XArray* described = ML_(describe_type)( &residual_offset, - di->admin_tyents, -@@ -2467,7 +2480,7 @@ Bool VG_(get_data_description)( /*OUT*/C - static - void analyse_deps ( /*MOD*/XArray* /* of FrameBlock */ blocks, - XArray* /* TyEnt */ tyents, -- Addr ip, Addr data_bias, DiVariable* var, -+ Addr ip, const DebugInfo* di, DiVariable* var, - Bool arrays_only ) - { - GXResult res_sp_6k, res_sp_7k, res_fp_6k, res_fp_7k; -@@ -2512,22 +2525,22 @@ void analyse_deps ( /*MOD*/XArray* /* of - regs.fp = 0; - regs.ip = ip; - regs.sp = 6 * 1024; -- res_sp_6k = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, data_bias ); -+ res_sp_6k = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, di ); - - regs.fp = 0; - regs.ip = ip; - regs.sp = 7 * 1024; -- res_sp_7k = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, data_bias ); -+ res_sp_7k = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, di ); - - regs.fp = 6 * 1024; - regs.ip = ip; - regs.sp = 0; -- res_fp_6k = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, data_bias ); -+ res_fp_6k = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, di ); - - regs.fp = 7 * 1024; - regs.ip = ip; - regs.sp = 0; -- res_fp_7k = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, data_bias ); -+ res_fp_7k = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, di ); - - vg_assert(res_sp_6k.kind == res_sp_7k.kind); - vg_assert(res_sp_6k.kind == res_fp_6k.kind); -@@ -2549,7 +2562,7 @@ void analyse_deps ( /*MOD*/XArray* /* of - if (sp_delta == 1024 && fp_delta == 0) { - regs.sp = regs.fp = 0; - regs.ip = ip; -- res = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, data_bias ); -+ res = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, di ); - tl_assert(res.kind == GXR_Value); - if (debug) - VG_(printf)(" %5ld .. %5ld (sp) %s\n", -@@ -2568,7 +2581,7 @@ void analyse_deps ( /*MOD*/XArray* /* of - if (sp_delta == 0 && fp_delta == 1024) { - regs.sp = regs.fp = 0; - regs.ip = ip; -- res = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, data_bias ); -+ res = ML_(evaluate_GX)( var->gexpr, var->fbGX, ®s, di ); - tl_assert(res.kind == GXR_Value); - if (debug) - VG_(printf)(" %5ld .. %5ld (FP) %s\n", -@@ -2698,7 +2711,7 @@ void* /* really, XArray* of StackBlock * - VG_(printf)("QQQQ: var:name=%s %#lx-%#lx %#lx\n", - var->name,arange->aMin,arange->aMax,ip); - analyse_deps( res, di->admin_tyents, ip, -- di->data_bias, var, arrays_only ); -+ di, var, arrays_only ); - } - } - -@@ -2781,7 +2794,7 @@ void* /* really, XArray* of GlobalBlock - it. */ - if (0) { VG_(printf)("EVAL: "); ML_(pp_GX)(var->gexpr); - VG_(printf)("\n"); } -- res = ML_(evaluate_trivial_GX)( var->gexpr, di->data_bias ); -+ res = ML_(evaluate_trivial_GX)( var->gexpr, di ); - - /* Not a constant address => not interesting */ - if (res.kind != GXR_Value) { -@@ -2939,6 +2952,7 @@ const HChar* VG_(pp_SectKind)( VgSectKin - case Vg_SectGOT: return "GOT"; - case Vg_SectPLT: return "PLT"; - case Vg_SectOPD: return "OPD"; -+ case Vg_SectGOTPLT: return "GOTPLT"; - default: vg_assert(0); - } - } -@@ -2989,6 +3003,12 @@ VgSectKind VG_(seginfo_sect_kind)( /*OUT - res = Vg_SectBSS; - break; - } -+ if (di->sbss_present -+ && di->sbss_size > 0 -+ && a >= di->sbss_avma && a < di->sbss_avma + di->sbss_size) { -+ res = Vg_SectBSS; -+ break; -+ } - if (di->plt_present - && di->plt_size > 0 - && a >= di->plt_avma && a < di->plt_avma + di->plt_size) { ---- valgrind-3.4.0.vanilla/coregrind/m_debuginfo/priv_d3basics.h 2009-01-02 19:40:41.000000000 +0100 -+++ valgrind-3.4.1.SVN-9098-1883/coregrind/m_debuginfo/priv_d3basics.h 2009-01-27 16:32:54.000000000 +0100 -@@ -621,7 +621,7 @@ void ML_(pp_GXResult) ( GXResult res ); - NULL but the frame base is still needed, then evaluation of gx as a - whole will fail. */ - GXResult ML_(evaluate_GX)( GExpr* gx, GExpr* fbGX, -- RegSummary* regs, Addr data_bias ); -+ RegSummary* regs, const DebugInfo* di ); - - /* This is a subsidiary of ML_(evaluate_GX), which just evaluates a - single standard DWARF3 expression. Conventions w.r.t regs and fbGX -@@ -632,7 +632,7 @@ GXResult ML_(evaluate_GX)( GExpr* gx, GE - recursive. */ - GXResult ML_(evaluate_Dwarf3_Expr) ( UChar* expr, UWord exprszB, - GExpr* fbGX, RegSummary* regs, -- Addr data_bias, -+ const DebugInfo* di, - Bool push_initial_zero ); - - /* Evaluate a very simple Guarded (DWARF3) expression. The expression -@@ -642,7 +642,7 @@ GXResult ML_(evaluate_Dwarf3_Expr) ( UCh - location is denoted, a frame base expression is required, or the - expression is not manifestly a constant. The range of addresses - covered by the guard is also ignored. */ --GXResult ML_(evaluate_trivial_GX)( GExpr* gx, Addr data_bias ); -+GXResult ML_(evaluate_trivial_GX)( GExpr* gx, const DebugInfo* di ); - - #endif /* ndef __PRIV_D3BASICS_H */ - ---- valgrind-3.4.0.vanilla/coregrind/m_debuginfo/priv_storage.h 2009-01-02 19:40:41.000000000 +0100 -+++ valgrind-3.4.1.SVN-9098-1883/coregrind/m_debuginfo/priv_storage.h 2009-01-27 16:32:54.000000000 +0100 -@@ -366,12 +366,24 @@ struct _DebugInfo { - Addr sdata_avma; - SizeT sdata_size; - OffT sdata_bias; -+ /* .rodata */ -+ Bool rodata_present; -+ Addr rodata_svma; -+ Addr rodata_avma; -+ SizeT rodata_size; -+ OffT rodata_bias; - /* .bss */ - Bool bss_present; - Addr bss_svma; - Addr bss_avma; - SizeT bss_size; - OffT bss_bias; -+ /* .sbss */ -+ Bool sbss_present; -+ Addr sbss_svma; -+ Addr sbss_avma; -+ SizeT sbss_size; -+ OffT sbss_bias; - /* .plt */ - Bool plt_present; - Addr plt_avma; ---- valgrind-3.4.0.vanilla/coregrind/m_debuginfo/readdwarf3.c 2009-01-02 19:40:41.000000000 +0100 -+++ valgrind-3.4.1.SVN-9098-1883/coregrind/m_debuginfo/readdwarf3.c 2009-01-27 16:32:54.000000000 +0100 -@@ -133,6 +133,7 @@ - groupies always show up at the top of performance profiles. */ - - #include "pub_core_basics.h" -+#include "pub_core_debuginfo.h" - #include "pub_core_libcbase.h" - #include "pub_core_libcassert.h" - #include "pub_core_libcprint.h" -@@ -386,7 +387,12 @@ typedef - Bool is_dw64; - /* Which DWARF version ? (2 or 3) */ - UShort version; -- /* Length of this Compilation Unit, excluding its Header */ -+ /* Length of this Compilation Unit, as stated in the -+ .unit_length :: InitialLength field of the CU Header. -+ However, this size (as specified by the D3 spec) does not -+ include the size of the .unit_length field itself, which is -+ either 4 or 12 bytes (32-bit or 64-bit Dwarf3). That value -+ can be obtained through the expression ".is_dw64 ? 12 : 4". */ - ULong unit_length; - /* Offset of start of this unit in .debug_info */ - UWord cu_start_offset; -@@ -412,6 +418,9 @@ typedef - /* Where is .debug_line? */ - UChar* debug_line_img; - UWord debug_line_sz; -+ /* Where is .debug_info? */ -+ UChar* debug_info_img; -+ UWord debug_info_sz; - /* --- Needed so we can add stuff to the string table. --- */ - struct _DebugInfo* di; - /* --- a cache for set_abbv_Cursor --- */ -@@ -895,7 +904,8 @@ void parse_CU_Header ( /*OUT*/CUConst* c - - /* address size. If this isn't equal to the host word size, just - give up. This makes it safe to assume elsewhere that -- DW_FORM_addr can be treated as a host word. */ -+ DW_FORM_addr and DW_FORM_ref_addr can be treated as a host -+ word. */ - address_size = get_UChar( c ); - if (address_size != sizeof(void*)) - cc->barf( "parse_CU_Header: invalid address_size" ); -@@ -1077,12 +1087,43 @@ void get_Form_contents ( /*OUT*/ULong* c - *ctsSzB = sizeof(UWord); - TRACE_D3("0x%lx", (UWord)*cts); - break; -+ -+ case DW_FORM_ref_addr: -+ /* We make the same word-size assumption as DW_FORM_addr. */ -+ /* What does this really mean? From D3 Sec 7.5.4, -+ description of "reference", it would appear to reference -+ some other DIE, by specifying the offset from the -+ beginning of a .debug_info section. The D3 spec mentions -+ that this might be in some other shared object and -+ executable. But I don't see how the name of the other -+ object/exe is specified. -+ -+ At least for the DW_FORM_ref_addrs created by icc11, the -+ references seem to be within the same object/executable. -+ So for the moment we merely range-check, to see that they -+ actually do specify a plausible offset within this -+ object's .debug_info, and return the value unchanged. -+ */ -+ *cts = (ULong)(UWord)get_UWord(c); -+ *ctsSzB = sizeof(UWord); -+ TRACE_D3("0x%lx", (UWord)*cts); -+ if (0) VG_(printf)("DW_FORM_ref_addr 0x%lx\n", (UWord)*cts); -+ if (/* the following 2 are surely impossible, but ... */ -+ cc->debug_info_img == NULL || cc->debug_info_sz == 0 -+ || *cts >= (ULong)cc->debug_info_sz) { -+ /* Hmm. Offset is nonsensical for this object's .debug_info -+ section. Be safe and reject it. */ -+ cc->barf("get_Form_contents: DW_FORM_ref_addr points " -+ "outside .debug_info"); -+ } -+ break; -+ - case DW_FORM_strp: { - /* this is an offset into .debug_str */ - UChar* str; - UWord uw = (UWord)get_Dwarfish_UWord( c, cc->is_dw64 ); - if (cc->debug_str_img == NULL || uw >= cc->debug_str_sz) -- cc->barf("read_and_show_Form: DW_FORM_strp " -+ cc->barf("get_Form_contents: DW_FORM_strp " - "points outside .debug_str"); - /* FIXME: check the entire string lies inside debug_str, - not just the first byte of it. */ -@@ -1143,8 +1184,9 @@ void get_Form_contents ( /*OUT*/ULong* c - break; - } - default: -- VG_(printf)("get_Form_contents: unhandled %d (%s)\n", -- form, ML_(pp_DW_FORM)(form)); -+ VG_(printf)( -+ "get_Form_contents: unhandled %d (%s) at <%lx>\n", -+ form, ML_(pp_DW_FORM)(form), get_position_of_Cursor(c)); - c->barf("get_Form_contents: unhandled DW_FORM"); - } - } -@@ -2178,14 +2220,13 @@ static void parse_type_DIE ( /*MOD*/XArr - typeE.Te.TyPorR.typeR = D3_FAKEVOID_CUOFF; - typeE.Te.TyPorR.isPtr = dtag == DW_TAG_pointer_type - || dtag == DW_TAG_ptr_to_member_type; -- /* Pointer types don't *have* to specify their size, in which -- case we assume it's a machine word. But if they do specify -- it, it must be a machine word :-) This probably assumes that -- the word size of the Dwarf3 we're reading is the same size as -- that on the machine. gcc appears to give a size whereas icc9 -- doesn't. */ -- if (typeE.Te.TyPorR.isPtr) -- typeE.Te.TyPorR.szB = sizeof(Word); -+ /* These three type kinds don't *have* to specify their size, in -+ which case we assume it's a machine word. But if they do -+ specify it, it must be a machine word :-) This probably -+ assumes that the word size of the Dwarf3 we're reading is the -+ same size as that on the machine. gcc appears to give a size -+ whereas icc9 doesn't. */ -+ typeE.Te.TyPorR.szB = sizeof(UWord); - while (True) { - DW_AT attr = (DW_AT) get_ULEB128( c_abbv ); - DW_FORM form = (DW_FORM)get_ULEB128( c_abbv ); -@@ -2200,7 +2241,7 @@ static void parse_type_DIE ( /*MOD*/XArr - } - } - /* Do we have something that looks sane? */ -- if (typeE.Te.TyPorR.szB != sizeof(Word)) -+ if (typeE.Te.TyPorR.szB != sizeof(UWord)) - goto bad_DIE; - else - goto acquire_Type; -@@ -2230,9 +2271,14 @@ static void parse_type_DIE ( /*MOD*/XArr - typeE.Te.TyEnum.szB = cts; - } - } -+ -+ if (!typeE.Te.TyEnum.name) -+ typeE.Te.TyEnum.name -+ = ML_(dinfo_strdup)( "di.readdwarf3.pTD.enum_type.3", -+ "" ); -+ - /* Do we have something that looks sane? */ -- if (typeE.Te.TyEnum.szB == 0 /* we must know the size */ -- /* But the name can be present, or not */) -+ if (typeE.Te.TyEnum.szB == 0 /* we must know the size */) - goto bad_DIE; - /* On't stack! */ - typestack_push( cc, parser, td3, &typeE, level ); -@@ -3367,12 +3413,30 @@ void new_dwarf3_reader_wrk ( - while (True) { - UWord cu_start_offset, cu_offset_now; - CUConst cc; -+ /* It may be that the stated size of this CU is larger than the -+ amount of stuff actually in it. icc9 seems to generate CUs -+ thusly. We use these variables to figure out if this is -+ indeed the case, and if so how many bytes we need to skip to -+ get to the start of the next CU. Not skipping those bytes -+ causes us to misidentify the start of the next CU, and it all -+ goes badly wrong after that (not surprisingly). */ -+ UWord cu_size_including_IniLen, cu_amount_used; - - /* It seems icc9 finishes the DIE info before debug_info_sz - bytes have been used up. So be flexible, and declare the - sequence complete if there is not enough remaining bytes to - hold even the smallest conceivable CU header. (11 bytes I - reckon). */ -+ /* JRS 23Jan09: I suspect this is no longer necessary now that -+ the code below contains a 'while (cu_amount_used < -+ cu_size_including_IniLen ...' style loop, which skips over -+ any leftover bytes at the end of a CU in the case where the -+ CU's stated size is larger than its actual size (as -+ determined by reading all its DIEs). However, for prudence, -+ I'll leave the following test in place. I can't see that a -+ CU header can be smaller than 11 bytes, so I don't think -+ there's any harm possible through the test -- it just adds -+ robustness. */ - Word avail = get_remaining_length_Cursor( &info ); - if (avail < 11) { - if (avail > 0) -@@ -3408,6 +3472,8 @@ void new_dwarf3_reader_wrk ( - cc.debug_loc_sz = debug_loc_sz; - cc.debug_line_img = debug_line_img; - cc.debug_line_sz = debug_line_sz; -+ cc.debug_info_img = debug_info_img; -+ cc.debug_info_sz = debug_info_sz; - cc.cu_start_offset = cu_start_offset; - cc.di = di; - /* The CU's svma can be deduced by looking at the AT_low_pc -@@ -3446,10 +3512,36 @@ void new_dwarf3_reader_wrk ( - &info, td3, &cc, 0 ); - - cu_offset_now = get_position_of_Cursor( &info ); -+ -+ if (0) VG_(printf)("Travelled: %lu size %llu\n", -+ cu_offset_now - cc.cu_start_offset, -+ cc.unit_length + (cc.is_dw64 ? 12 : 4)); -+ -+ /* How big the CU claims it is .. */ -+ cu_size_including_IniLen = cc.unit_length + (cc.is_dw64 ? 12 : 4); -+ /* .. vs how big we have found it to be */ -+ cu_amount_used = cu_offset_now - cc.cu_start_offset; -+ - if (1) TRACE_D3("offset now %ld, d-i-size %ld\n", - cu_offset_now, debug_info_sz); - if (cu_offset_now > debug_info_sz) - barf("toplevel DIEs beyond end of CU"); -+ -+ /* If the CU is bigger than it claims to be, we've got a serious -+ problem. */ -+ if (cu_amount_used > cu_size_including_IniLen) -+ barf("CU's actual size appears to be larger than it claims it is"); -+ -+ /* If the CU is smaller than it claims to be, we need to skip some -+ bytes. Loop updates cu_offset_new and cu_amount_used. */ -+ while (cu_amount_used < cu_size_including_IniLen -+ && get_remaining_length_Cursor( &info ) > 0) { -+ if (0) VG_(printf)("SKIP\n"); -+ (void)get_UChar( &info ); -+ cu_offset_now = get_position_of_Cursor( &info ); -+ cu_amount_used = cu_offset_now - cc.cu_start_offset; -+ } -+ - if (cu_offset_now == debug_info_sz) - break; - ---- valgrind-3.4.0.vanilla/coregrind/m_debuginfo/readdwarf.c 2009-01-02 19:40:41.000000000 +0100 -+++ valgrind-3.4.1.SVN-9098-1883/coregrind/m_debuginfo/readdwarf.c 2009-01-27 16:32:54.000000000 +0100 -@@ -34,6 +34,7 @@ - */ - - #include "pub_core_basics.h" -+#include "pub_core_debuginfo.h" - #include "pub_core_libcbase.h" - #include "pub_core_libcassert.h" - #include "pub_core_libcprint.h" -@@ -2554,6 +2555,16 @@ static Int dwarfexpr_to_dag ( UnwindCont - VG_(printf)("DW_OP_breg%d: %ld", reg, sw); - break; - -+ case DW_OP_reg0 ... DW_OP_reg31: -+ /* push: reg */ -+ reg = (Int)opcode - (Int)DW_OP_reg0; -+ vg_assert(reg >= 0 && reg <= 31); -+ ix = ML_(CfiExpr_DwReg)( dst, reg ); -+ PUSH(ix); -+ if (ddump_frames) -+ VG_(printf)("DW_OP_reg%d", reg); -+ break; -+ - case DW_OP_plus_uconst: - uw = read_leb128U( &expr ); - PUSH( ML_(CfiExpr_Const)( dst, uw ) ); -@@ -2573,6 +2584,15 @@ static Int dwarfexpr_to_dag ( UnwindCont - VG_(printf)("DW_OP_const4s: %ld", sw); - break; - -+ case DW_OP_const1s: -+ /* push: 8-bit signed immediate */ -+ sw = read_le_s_encoded_literal( expr, 1 ); -+ expr += 1; -+ PUSH( ML_(CfiExpr_Const)( dst, (UWord)sw ) ); -+ if (ddump_frames) -+ VG_(printf)("DW_OP_const1s: %ld", sw); -+ break; -+ - case DW_OP_minus: - op = Cop_Sub; opname = "minus"; goto binop; - case DW_OP_plus: ---- valgrind-3.4.0.vanilla/coregrind/m_debuginfo/readelf.c 2009-01-02 19:40:41.000000000 +0100 -+++ valgrind-3.4.1.SVN-9098-1883/coregrind/m_debuginfo/readelf.c 2009-01-27 16:32:54.000000000 +0100 -@@ -36,6 +36,7 @@ - - #include "pub_core_basics.h" - #include "pub_core_vki.h" -+#include "pub_core_debuginfo.h" - #include "pub_core_libcbase.h" - #include "pub_core_libcprint.h" - #include "pub_core_libcassert.h" -@@ -219,7 +220,7 @@ Bool get_elf_symbol_info ( - ) - { - Bool plausible, is_in_opd; -- Bool in_text, in_data, in_sdata, in_bss; -+ Bool in_text, in_data, in_sdata, in_rodata, in_bss, in_sbss; - - /* Set defaults */ - *sym_name_out = sym_name; -@@ -276,12 +277,26 @@ Bool get_elf_symbol_info ( - *is_text_out = False; - *sym_avma_out += di->sdata_bias; - } else -+ if (di->rodata_present -+ && di->rodata_size > 0 -+ && sym_svma >= di->rodata_svma -+ && sym_svma < di->rodata_svma + di->rodata_size) { -+ *is_text_out = False; -+ *sym_avma_out += di->rodata_bias; -+ } else - if (di->bss_present - && di->bss_size > 0 - && sym_svma >= di->bss_svma - && sym_svma < di->bss_svma + di->bss_size) { - *is_text_out = False; - *sym_avma_out += di->bss_bias; -+ } else -+ if (di->sbss_present -+ && di->sbss_size > 0 -+ && sym_svma >= di->sbss_svma -+ && sym_svma < di->sbss_svma + di->sbss_size) { -+ *is_text_out = False; -+ *sym_avma_out += di->sbss_bias; - } else { - /* Assume it's in .text. Is this a good idea? */ - *is_text_out = True; -@@ -450,12 +465,24 @@ Bool get_elf_symbol_info ( - && !(*sym_avma_out + *sym_size_out <= di->sdata_avma - || *sym_avma_out >= di->sdata_avma + di->sdata_size); - -+ in_rodata -+ = di->rodata_present -+ && di->rodata_size > 0 -+ && !(*sym_avma_out + *sym_size_out <= di->rodata_avma -+ || *sym_avma_out >= di->rodata_avma + di->rodata_size); -+ - in_bss - = di->bss_present - && di->bss_size > 0 - && !(*sym_avma_out + *sym_size_out <= di->bss_avma - || *sym_avma_out >= di->bss_avma + di->bss_size); - -+ in_sbss -+ = di->sbss_present -+ && di->sbss_size > 0 -+ && !(*sym_avma_out + *sym_size_out <= di->sbss_avma -+ || *sym_avma_out >= di->sbss_avma + di->sbss_size); -+ - - if (*is_text_out) { - /* This used to reject any symbol falling outside the text -@@ -479,9 +506,9 @@ Bool get_elf_symbol_info ( - return False; - } - } else { -- if (!(in_data || in_sdata || in_bss)) { -+ if (!(in_data || in_sdata || in_rodata || in_bss || in_sbss)) { - TRACE_SYMTAB( -- "ignore -- %#lx .. %#lx outside .data / .sdata / .bss svma ranges\n", -+ "ignore -- %#lx .. %#lx outside .data / .sdata / .rodata / .bss / .sbss svma ranges\n", - *sym_avma_out, *sym_avma_out + *sym_size_out); - return False; - } -@@ -955,15 +982,6 @@ static void* INDEX_BIS ( void* base, Wor - return (void*)( ((UChar*)base) + idx * scale ); - } - --static Addr round_Addr_upwards ( Addr a, UInt align ) --{ -- if (align > 0) { -- vg_assert(-1 != VG_(log2)(align)); -- a = VG_ROUNDUP(a, align); -- } -- return a; --} -- - - /* Find the file offset corresponding to SVMA by using the program - headers. This is taken from binutils-2.17/binutils/readelf.c -@@ -1027,15 +1045,13 @@ Bool ML_(read_elf_debug_info) ( struct _ - UWord shdr_ent_szB = 0; - UChar* shdr_strtab_img = NULL; - -- /* To do with figuring out where .sbss is relative to .bss. A -- kludge at the best of times. */ -- SizeT sbss_size; -- Addr sbss_svma; -- UInt bss_align; -- UInt sbss_align; -- UInt data_align; -- SizeT bss_totsize; -- Addr gen_bss_lowest_svma; -+ /* SVMAs covered by rx and rw segments and corresponding bias. */ -+ Addr rx_svma_base = 0; -+ Addr rx_svma_limit = 0; -+ OffT rx_bias = 0; -+ Addr rw_svma_base = 0; -+ Addr rw_svma_limit = 0; -+ OffT rw_bias = 0; - - vg_assert(di); - vg_assert(di->have_rx_map == True); -@@ -1203,6 +1219,22 @@ Bool ML_(read_elf_debug_info) ( struct _ - goto out; - } - prev_svma = phdr->p_vaddr; -+ if (rx_svma_limit == 0 -+ && phdr->p_offset >= di->rx_map_foff -+ && phdr->p_offset < di->rx_map_foff + di->rx_map_size -+ && phdr->p_offset + phdr->p_filesz <= di->rx_map_foff + di->rx_map_size) { -+ rx_svma_base = phdr->p_vaddr; -+ rx_svma_limit = phdr->p_vaddr + phdr->p_memsz; -+ rx_bias = di->rx_map_avma - di->rx_map_foff + phdr->p_offset - phdr->p_vaddr; -+ } -+ else if (rw_svma_limit == 0 -+ && phdr->p_offset >= di->rw_map_foff -+ && phdr->p_offset < di->rw_map_foff + di->rw_map_size -+ && phdr->p_offset + phdr->p_filesz <= di->rw_map_foff + di->rw_map_size) { -+ rw_svma_base = phdr->p_vaddr; -+ rw_svma_limit = phdr->p_vaddr + phdr->p_memsz; -+ rw_bias = di->rw_map_avma - di->rw_map_foff + phdr->p_offset - phdr->p_vaddr; -+ } - } - - /* Try to get the soname. If there isn't one, use "NONE". -@@ -1254,14 +1286,8 @@ Bool ML_(read_elf_debug_info) ( struct _ - di->soname = "NONE"; - } - -- /*SizeT*/ sbss_size = 0; -- /*Addr */ sbss_svma = 0; -- /*UInt */ bss_align = 0; -- /*UInt */ sbss_align = 0; -- -- /* UInt */ data_align = 0; -- /* SizeT */ bss_totsize = 0; -- /* Addr */ gen_bss_lowest_svma = ~((Addr)0); -+ vg_assert(rx_svma_limit != 0); -+ vg_assert(rw_svma_limit != 0); - - /* Now read the section table. */ - TRACE_SYMTAB("\n"); -@@ -1270,9 +1296,13 @@ Bool ML_(read_elf_debug_info) ( struct _ - TRACE_SYMTAB("rx: at %#lx are mapped foffsets %ld .. %ld\n", - di->rx_map_avma, - di->rx_map_foff, di->rx_map_foff + di->rx_map_size - 1 ); -+ TRACE_SYMTAB("rx: contains svmas %#lx .. %#lx with bias %#lx\n", -+ rx_svma_base, rx_svma_limit - 1, rx_bias ); - TRACE_SYMTAB("rw: at %#lx are mapped foffsets %ld .. %ld\n", - di->rw_map_avma, - di->rw_map_foff, di->rw_map_foff + di->rw_map_size - 1 ); -+ TRACE_SYMTAB("rw: contains svmas %#lx .. %#lx with bias %#lx\n", -+ rw_svma_base, rw_svma_limit - 1, rw_bias ); - - for (i = 0; i < shdr_nent; i++) { - ElfXX_Shdr* shdr = INDEX_BIS( shdr_img, i, shdr_ent_szB ); -@@ -1282,10 +1312,8 @@ Bool ML_(read_elf_debug_info) ( struct _ - UWord size = shdr->sh_size; - UInt alyn = shdr->sh_addralign; - Bool bits = !(shdr->sh_type == SHT_NOBITS); -- Bool inrx = foff >= di->rx_map_foff -- && foff < di->rx_map_foff + di->rx_map_size; -- Bool inrw = foff >= di->rw_map_foff -- && foff < di->rw_map_foff + di->rw_map_size; -+ Bool inrx = svma >= rx_svma_base && svma < rx_svma_limit; -+ Bool inrw = svma >= rw_svma_base && svma < rw_svma_limit; - - TRACE_SYMTAB(" [sec %2ld] %s %s al%2u foff %6ld .. %6ld " - " svma %p name \"%s\"\n", -@@ -1313,17 +1341,17 @@ Bool ML_(read_elf_debug_info) ( struct _ - goto out; \ - } while (0) - -- /* Find avma-s for: .text .data .sdata .bss .plt .got .opd -+ /* Find avma-s for: .text .data .sdata .rodata .bss .sbss .plt .got .opd - and .eh_frame */ - -- /* Accept .text where mapped as rx (code) */ -+ /* 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 && size >= 0 && !di->text_present) { - di->text_present = True; - di->text_svma = svma; -- di->text_avma = di->rx_map_avma + foff - di->rx_map_foff; -+ di->text_avma = svma + rx_bias; - di->text_size = size; -- di->text_bias = di->text_avma - svma; -+ di->text_bias = rx_bias; - TRACE_SYMTAB("acquiring .text svma = %#lx .. %#lx\n", - di->text_svma, - di->text_svma + di->text_size - 1); -@@ -1339,13 +1367,11 @@ Bool ML_(read_elf_debug_info) ( struct _ - /* 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 (alyn > data_align) -- data_align = alyn; - di->data_present = True; - di->data_svma = svma; -- di->data_avma = di->rw_map_avma + foff - di->rw_map_foff; -+ di->data_avma = svma + rw_bias; - di->data_size = size; -- di->data_bias = di->data_avma - svma; -+ di->data_bias = rw_bias; - TRACE_SYMTAB("acquiring .data svma = %#lx .. %#lx\n", - di->data_svma, - di->data_svma + di->data_size - 1); -@@ -1361,13 +1387,11 @@ Bool ML_(read_elf_debug_info) ( struct _ - /* Accept .sdata where mapped as rw (data) */ - if (0 == VG_(strcmp)(name, ".sdata")) { - if (inrw && size > 0 && !di->sdata_present) { -- if (alyn > data_align) -- data_align = alyn; - di->sdata_present = True; - di->sdata_svma = svma; -- di->sdata_avma = di->rw_map_avma + foff - di->rw_map_foff; -+ di->sdata_avma = svma + rw_bias; - di->sdata_size = size; -- di->sdata_bias = di->sdata_avma - svma; -+ di->sdata_bias = rw_bias; - TRACE_SYMTAB("acquiring .sdata svma = %#lx .. %#lx\n", - di->sdata_svma, - di->sdata_svma + di->sdata_size - 1); -@@ -1380,20 +1404,34 @@ Bool ML_(read_elf_debug_info) ( struct _ - } - } - -+ /* Accept .rodata where mapped as rx (data), even if zero-sized */ -+ if (0 == VG_(strcmp)(name, ".rodata")) { -+ if (inrx && size >= 0 && !di->rodata_present) { -+ di->rodata_present = True; -+ di->rodata_svma = svma; -+ di->rodata_avma = svma + rx_bias; -+ di->rodata_size = size; -+ di->rodata_bias = rx_bias; -+ TRACE_SYMTAB("acquiring .rodata svma = %#lx .. %#lx\n", -+ di->rodata_svma, -+ di->rodata_svma + di->rodata_size - 1); -+ TRACE_SYMTAB("acquiring .rodata avma = %#lx .. %#lx\n", -+ di->rodata_avma, -+ di->rodata_avma + di->rodata_size - 1); -+ TRACE_SYMTAB("acquiring .rodata bias = %#lx\n", di->rodata_bias); -+ } else { -+ BAD(".rodata"); -+ } -+ } -+ - /* Accept .bss where mapped as rw (data), even if zero-sized */ - if (0 == VG_(strcmp)(name, ".bss")) { - if (inrw && size >= 0 && !di->bss_present) { -- bss_totsize += round_Addr_upwards(size, alyn); -- if (svma < gen_bss_lowest_svma) -- gen_bss_lowest_svma = svma; -- TRACE_SYMTAB("increasing total bss-like size to %ld\n", -- bss_totsize); - di->bss_present = True; - di->bss_svma = svma; -- di->bss_avma = di->rw_map_avma + foff - di->rw_map_foff; -+ di->bss_avma = svma + rw_bias; - di->bss_size = size; -- di->bss_bias = di->bss_avma - svma; -- bss_align = alyn; -+ di->bss_bias = rw_bias; - TRACE_SYMTAB("acquiring .bss svma = %#lx .. %#lx\n", - di->bss_svma, - di->bss_svma + di->bss_size - 1); -@@ -1413,7 +1451,6 @@ Bool ML_(read_elf_debug_info) ( struct _ - di->bss_avma = 0; - di->bss_size = 0; - di->bss_bias = 0; -- bss_align = 0; - if (!VG_(clo_xml)) { - VG_(message)(Vg_UserMsg, "Warning: the following file's .bss is " - "mapped r-x only - ignoring .bss syms"); -@@ -1423,14 +1460,13 @@ Bool ML_(read_elf_debug_info) ( struct _ - } - } else - -- if ((!inrw) && (!inrx) && size > 0 && !di->bss_present) { -+ if ((!inrw) && (!inrx) && size >= 0 && !di->bss_present) { - /* File contains a .bss, but it didn't get mapped. Ignore. */ - di->bss_present = False; - di->bss_svma = 0; - di->bss_avma = 0; - di->bss_size = 0; - di->bss_bias = 0; -- bss_align = 0; - } else { - BAD(".bss"); - } -@@ -1438,38 +1474,29 @@ Bool ML_(read_elf_debug_info) ( struct _ - - /* Accept .sbss where mapped as rw (data) */ - if (0 == VG_(strcmp)(name, ".sbss")) { -- if (inrw && size > 0 && sbss_size == 0) { -- bss_totsize += round_Addr_upwards(size, alyn); -- if (svma < gen_bss_lowest_svma) -- gen_bss_lowest_svma = svma; -- TRACE_SYMTAB("increasing total bss-like size to %ld\n", -- bss_totsize); -- sbss_size = size; -- sbss_svma = svma; -- sbss_align = alyn; -+ if (inrw && size > 0 && !di->sbss_present) { -+ di->sbss_present = True; -+ di->sbss_svma = svma; -+ di->sbss_avma = svma + rw_bias; -+ di->sbss_size = size; -+ di->sbss_bias = rw_bias; -+ TRACE_SYMTAB("acquiring .sbss svma = %#lx .. %#lx\n", -+ di->sbss_svma, -+ di->sbss_svma + di->sbss_size - 1); -+ TRACE_SYMTAB("acquiring .sbss avma = %#lx .. %#lx\n", -+ di->sbss_avma, -+ di->sbss_avma + di->sbss_size - 1); -+ TRACE_SYMTAB("acquiring .sbss bias = %#lx\n", di->sbss_bias); - } else { - BAD(".sbss"); - } - } - -- /* Accept .dynbss where mapped as rw (data) */ -- if (0 == VG_(strcmp)(name, ".dynbss")) { -- if (inrw && size > 0 /* && sbss_size == 0*/) { -- bss_totsize += round_Addr_upwards(size, alyn); -- if (svma < gen_bss_lowest_svma) -- gen_bss_lowest_svma = svma; -- TRACE_SYMTAB("increasing total bss-like size to %ld\n", -- bss_totsize); -- } else { -- BAD(".dynbss"); -- } -- } -- - /* Accept .got where mapped as rw (data) */ - if (0 == VG_(strcmp)(name, ".got")) { - if (inrw && size > 0 && !di->got_present) { - di->got_present = True; -- di->got_avma = di->rw_map_avma + foff - di->rw_map_foff; -+ di->got_avma = svma + rw_bias; - di->got_size = size; - TRACE_SYMTAB("acquiring .got avma = %#lx\n", di->got_avma); - } else { -@@ -1481,7 +1508,7 @@ Bool ML_(read_elf_debug_info) ( struct _ - if (0 == VG_(strcmp)(name, ".got.plt")) { - if (inrw && size > 0 && !di->gotplt_present) { - di->gotplt_present = True; -- di->gotplt_avma = di->rw_map_avma + foff - di->rw_map_foff; -+ di->gotplt_avma = svma + rw_bias; - di->gotplt_size = size; - TRACE_SYMTAB("acquiring .got.plt avma = %#lx\n", di->gotplt_avma); - } else if (size != 0) { -@@ -1495,7 +1522,7 @@ Bool ML_(read_elf_debug_info) ( struct _ - if (0 == VG_(strcmp)(name, ".plt")) { - if (inrx && size > 0 && !di->plt_present) { - di->plt_present = True; -- di->plt_avma = di->rx_map_avma + foff - di->rx_map_foff; -+ di->plt_avma = svma + rx_bias; - di->plt_size = size; - TRACE_SYMTAB("acquiring .plt avma = %#lx\n", di->plt_avma); - } else { -@@ -1507,7 +1534,7 @@ Bool ML_(read_elf_debug_info) ( struct _ - if (0 == VG_(strcmp)(name, ".plt")) { - if (inrw && size > 0 && !di->plt_present) { - di->plt_present = True; -- di->plt_avma = di->rw_map_avma + foff - di->rw_map_foff; -+ di->plt_avma = svma + rw_bias; - di->plt_size = size; - TRACE_SYMTAB("acquiring .plt avma = %#lx\n", di->plt_avma); - } else { -@@ -1519,7 +1546,7 @@ Bool ML_(read_elf_debug_info) ( struct _ - if (0 == VG_(strcmp)(name, ".plt")) { - if (inrw && size > 0 && !di->plt_present) { - di->plt_present = True; -- di->plt_avma = di->rw_map_avma + foff - di->rw_map_foff; -+ di->plt_avma = svma + rw_bias; - di->plt_size = size; - TRACE_SYMTAB("acquiring .plt avma = %#lx\n", di->plt_avma); - } else -@@ -1542,7 +1569,7 @@ Bool ML_(read_elf_debug_info) ( struct _ - if (0 == VG_(strcmp)(name, ".opd")) { - if (inrw && size > 0 && !di->opd_present) { - di->opd_present = True; -- di->opd_avma = di->rw_map_avma + foff - di->rw_map_foff; -+ di->opd_avma = svma + rw_bias; - di->opd_size = size; - TRACE_SYMTAB("acquiring .opd avma = %#lx\n", di->opd_avma); - } else { -@@ -1556,13 +1583,13 @@ Bool ML_(read_elf_debug_info) ( struct _ - if (0 == VG_(strcmp)(name, ".eh_frame")) { - if (inrx && size > 0 && !di->ehframe_present) { - di->ehframe_present = True; -- di->ehframe_avma = di->rx_map_avma + foff - di->rx_map_foff; -+ di->ehframe_avma = svma + rx_bias; - di->ehframe_size = size; - TRACE_SYMTAB("acquiring .eh_frame avma = %#lx\n", di->ehframe_avma); - } else - if (inrw && size > 0 && !di->ehframe_present) { - di->ehframe_present = True; -- di->ehframe_avma = di->rw_map_avma + foff - di->rw_map_foff; -+ di->ehframe_avma = svma + rw_bias; - di->ehframe_size = size; - TRACE_SYMTAB("acquiring .eh_frame avma = %#lx\n", di->ehframe_avma); - } else { -@@ -1574,24 +1601,6 @@ Bool ML_(read_elf_debug_info) ( struct _ - - } - -- /* Kludge: ignore all previous computations for .bss avma range, -- and simply assume that .bss immediately follows .data/.sdata.*/ -- if (1) { -- SizeT data_al = round_Addr_upwards(di->data_avma, data_align) -- - di->data_avma; -- TRACE_SYMTAB("data_al = %ld\n", data_al); -- bss_totsize += data_al; -- di->bss_svma = gen_bss_lowest_svma; -- di->bss_size = bss_totsize; -- di->bss_avma = di->data_avma + (di->bss_svma - di->data_svma); -- di->bss_bias = di->data_bias; -- TRACE_SYMTAB("kludged .bss svma = %#lx .. %#lx\n", -- di->bss_svma, di->bss_svma + di->bss_size - 1); -- TRACE_SYMTAB("kludged .bss avma = %#lx .. %#lx\n", -- di->bss_avma, di->bss_avma + di->bss_size - 1); -- TRACE_SYMTAB("kludged .bss bias = %#lx\n", di->bss_bias); -- } -- - if (0) VG_(printf)("YYYY text_: avma %#lx size %ld bias %#lx\n", - di->text_avma, di->text_size, di->text_bias); - ---- valgrind-3.4.0.vanilla/coregrind/m_debuginfo/readxcoff.c 2009-01-02 19:40:41.000000000 +0100 -+++ valgrind-3.4.1.SVN-9098-1883/coregrind/m_debuginfo/readxcoff.c 2009-01-27 16:32:54.000000000 +0100 -@@ -58,6 +58,7 @@ - #include "pub_core_xarray.h" - #include "priv_misc.h" - #include "priv_tytypes.h" -+#include "pub_tool_debuginfo.h" - #include "priv_d3basics.h" - #include "priv_storage.h" - #include "priv_readxcoff.h" /* self */ ---- valgrind-3.4.0.vanilla/coregrind/m_debuginfo/storage.c 2009-01-02 19:40:41.000000000 +0100 -+++ valgrind-3.4.1.SVN-9098-1883/coregrind/m_debuginfo/storage.c 2009-01-27 16:32:54.000000000 +0100 -@@ -39,6 +39,7 @@ - - #include "pub_core_basics.h" - #include "pub_core_options.h" /* VG_(clo_verbosity) */ -+#include "pub_core_debuginfo.h" - #include "pub_core_libcassert.h" - #include "pub_core_libcbase.h" - #include "pub_core_libcprint.h" ---- valgrind-3.4.0.vanilla/coregrind/m_debuginfo/tytypes.c 2009-01-02 19:40:41.000000000 +0100 -+++ valgrind-3.4.1.SVN-9098-1883/coregrind/m_debuginfo/tytypes.c 2009-01-27 16:32:54.000000000 +0100 -@@ -34,6 +34,7 @@ - */ - - #include "pub_core_basics.h" -+#include "pub_core_debuginfo.h" - #include "pub_core_libcassert.h" - #include "pub_core_libcbase.h" - #include "pub_core_libcprint.h" ---- valgrind-3.4.0.vanilla/coregrind/m_machine.c 2009-01-02 19:40:44.000000000 +0100 -+++ valgrind-3.4.1.SVN-9098-1883/coregrind/m_machine.c 2009-01-27 16:32:56.000000000 +0100 -@@ -35,7 +35,8 @@ - #include "pub_core_libcbase.h" - #include "pub_core_machine.h" - #include "pub_core_cpuid.h" --#include "pub_core_libcsignal.h" // for ppc32 messing with SIGILL -+#include "pub_core_libcsignal.h" // for ppc32 messing with SIGILL -+#include "pub_core_debuglog.h" - - - #define INSTR_PTR(regs) ((regs).vex.VG_INSTR_PTR) diff --git a/valgrind-3.4.0-newbu.patch b/valgrind-3.4.0-newbu.patch deleted file mode 100644 index 0953cb1..0000000 --- a/valgrind-3.4.0-newbu.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- valgrind-3.4.0/Makefile.am.jj 2009-01-02 13:40:45.000000000 -0500 -+++ valgrind-3.4.0/Makefile.am 2009-02-09 07:40:21.140994000 -0500 -@@ -209,26 +209,26 @@ valt_load_address_x86_linux.lds: Makefil - $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ -- -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ -+ -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ - - valt_load_address_amd64_linux.lds: Makefile - $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ -- -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ -+ -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ - - valt_load_address_ppc32_linux.lds: Makefile - $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ -- -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ -+ -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ - - valt_load_address_ppc64_linux.lds: Makefile - $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ -- -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ -+ -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ ---- valgrind-3.4.0/Makefile.in.jj 2009-01-02 13:50:00.000000000 -0500 -+++ valgrind-3.4.0/Makefile.in 2009-02-09 07:41:28.439218000 -0500 -@@ -946,28 +946,28 @@ valt_load_address_x86_linux.lds: Makefil - $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ -- -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ -+ -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ - - valt_load_address_amd64_linux.lds: Makefile - $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ -- -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ -+ -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ - - valt_load_address_ppc32_linux.lds: Makefile - $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ -- -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ -+ -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ - - valt_load_address_ppc64_linux.lds: Makefile - $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ -- -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ -+ -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/valgrind-3.4.0-pkg-config.patch b/valgrind-3.4.0-pkg-config.patch deleted file mode 100644 index 7258b59..0000000 --- a/valgrind-3.4.0-pkg-config.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- valgrind-3.4.0/configure.in.jj 2007-01-29 14:42:52.000000000 -0500 -+++ valgrind-3.4.0/configure.in 2007-02-13 08:02:26.000000000 -0500 -@@ -289,6 +289,7 @@ case "${host_os}" in - AC_MSG_ERROR([Valgrind is operating system specific. Sorry. Please consider doing a port.]) - ;; - esac -+VG_PLATFORM=`echo "$VG_PLATFORM_PRI" | LC_ALL=C tr A-Z_ a-z-` - - # If we are building on a 64 bit platform test to see if the system - # supports building 32 bit programs and disable 32 bit support if it -@@ -331,6 +332,7 @@ AC_MSG_CHECKING([for a supported CPU/OS - - AC_SUBST(VG_PLATFORM_PRI) - AC_SUBST(VG_PLATFORM_SEC) -+AC_SUBST(VG_PLATFORM) - AC_SUBST(VG_ARCH_PRI) - - # By default, the primary arch is the same as the "max" arch, as ---- valgrind-3.4.0/configure.jj 2007-01-29 14:45:30.000000000 -0500 -+++ valgrind-3.4.0/configure 2007-02-13 08:04:33.000000000 -0500 -@@ -311,7 +311,7 @@ ac_includes_default="\ - # include - #endif" - --ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT VEX_DIR DISTCHECK_CONFIGURE_FLAGS LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE RANLIB ac_ct_RANLIB AR PERL GDB CCAS CCASFLAGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os VG_ARCH_MAX VG_ARCH_ALL VALT_LOAD_ADDRESS VG_OS VG_PLATFORM_PRI VG_PLATFORM_SEC VG_ARCH_PRI VGP_X86_LINUX_TRUE VGP_X86_LINUX_FALSE VGP_AMD64_LINUX_TRUE VGP_AMD64_LINUX_FALSE VGP_PPC32_LINUX_TRUE VGP_PPC32_LINUX_FALSE VGP_PPC64_LINUX_TRUE VGP_PPC64_LINUX_FALSE VGP_PPC32_AIX5_TRUE VGP_PPC32_AIX5_FALSE VGP_PPC64_AIX5_TRUE VGP_PPC64_AIX5_FALSE VGO_LINUX_TRUE VGO_LINUX_FALSE VGO_AIX5_TRUE VGO_AIX5_FALSE VGP_HAVE_SECONDARY_TRUE VGP_HAVE_SECONDARY_FALSE DEFAULT_SUPP EGREP GLIBC_VERSION HAS_ALTIVEC_TRUE HAS_ALTIVEC_FALSE HAVE_ALTIVEC_H_TRUE HAVE_ALTIVEC_H_FALSE FLAG_M32 FLAG_MAIX32 FLAG_M64 FLAG_MAIX64 FLAG_MMMX FLAG_MSSE PREFERRED_STACK_BOUNDARY FLAG_WDECL_AFTER_STMT FLAG_W_NO_FORMAT_ZERO_LENGTH FLAG_W_EXTRA FLAG_FNO_STACK_PROTECTOR FLAG_UNLIMITED_INLINE_UNIT_GROWTH BUILD_SSE3_TESTS_TRUE BUILD_SSE3_TESTS_FALSE BUILD_SSSE3_TESTS_TRUE BUILD_SSSE3_TESTS_FALSE LIBOBJS MPI_CC BUILD_MPIWRAP_PRI_TRUE BUILD_MPIWRAP_PRI_FALSE BUILD_MPIWRAP_SEC_TRUE BUILD_MPIWRAP_SEC_FALSE HAVE_QTCORE_TRUE HAVE_QTCORE_FALSE BOOST_CFLAGS BOOST_LIBS HAVE_BOOST_1_35_TRUE HAVE_BOOST_1_35_FALSE HAVE_OPENMP_TRUE HAVE_OPENMP_FALSE LTLIBOBJS' -+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT VEX_DIR DISTCHECK_CONFIGURE_FLAGS LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE RANLIB ac_ct_RANLIB AR PERL GDB CCAS CCASFLAGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os VG_ARCH_MAX VG_ARCH_ALL VALT_LOAD_ADDRESS VG_OS VG_PLATFORM_PRI VG_PLATFORM_SEC VG_PLATFORM VG_ARCH_PRI VGP_X86_LINUX_TRUE VGP_X86_LINUX_FALSE VGP_AMD64_LINUX_TRUE VGP_AMD64_LINUX_FALSE VGP_PPC32_LINUX_TRUE VGP_PPC32_LINUX_FALSE VGP_PPC64_LINUX_TRUE VGP_PPC64_LINUX_FALSE VGP_PPC32_AIX5_TRUE VGP_PPC32_AIX5_FALSE VGP_PPC64_AIX5_TRUE VGP_PPC64_AIX5_FALSE VGO_LINUX_TRUE VGO_LINUX_FALSE VGO_AIX5_TRUE VGO_AIX5_FALSE VGP_HAVE_SECONDARY_TRUE VGP_HAVE_SECONDARY_FALSE DEFAULT_SUPP EGREP GLIBC_VERSION HAS_ALTIVEC_TRUE HAS_ALTIVEC_FALSE HAVE_ALTIVEC_H_TRUE HAVE_ALTIVEC_H_FALSE FLAG_M32 FLAG_MAIX32 FLAG_M64 FLAG_MAIX64 FLAG_MMMX FLAG_MSSE PREFERRED_STACK_BOUNDARY FLAG_WDECL_AFTER_STMT FLAG_W_NO_FORMAT_ZERO_LENGTH FLAG_W_EXTRA FLAG_FNO_STACK_PROTECTOR FLAG_UNLIMITED_INLINE_UNIT_GROWTH BUILD_SSE3_TESTS_TRUE BUILD_SSE3_TESTS_FALSE BUILD_SSSE3_TESTS_TRUE BUILD_SSSE3_TESTS_FALSE LIBOBJS MPI_CC BUILD_MPIWRAP_PRI_TRUE BUILD_MPIWRAP_PRI_FALSE BUILD_MPIWRAP_SEC_TRUE BUILD_MPIWRAP_SEC_FALSE HAVE_QTCORE_TRUE HAVE_QTCORE_FALSE BOOST_CFLAGS BOOST_LIBS HAVE_BOOST_1_35_TRUE HAVE_BOOST_1_35_FALSE HAVE_OPENMP_TRUE HAVE_OPENMP_FALSE LTLIBOBJS' - ac_subst_files='' - - # Initialize some variables set by options. -@@ -4365,6 +4365,7 @@ echo "$as_me: error: Valgrind is operati - { (exit 1); exit 1; }; } - ;; - esac -+VG_PLATFORM=`echo "$VG_PLATFORM_PRI" | LC_ALL=C tr A-Z_ a-z-` - - # If we are building on a 64 bit platform test to see if the system - # supports building 32 bit programs and disable 32 bit support if it -@@ -4459,6 +4460,7 @@ echo $ECHO_N "checking for a supported C - - - -+ - # By default, the primary arch is the same as the "max" arch, as - # commented above (at the definition of VG_ARCH_MAX). We may choose - # to downgrade it in the big case statement just below here, in the -@@ -10043,6 +10045,7 @@ s,@VALT_LOAD_ADDRESS@,$VALT_LOAD_ADDRESS - s,@VG_OS@,$VG_OS,;t t - s,@VG_PLATFORM_PRI@,$VG_PLATFORM_PRI,;t t - s,@VG_PLATFORM_SEC@,$VG_PLATFORM_SEC,;t t -+s,@VG_PLATFORM@,$VG_PLATFORM,;t t - s,@VG_ARCH_PRI@,$VG_ARCH_PRI,;t t - s,@VGP_X86_LINUX_TRUE@,$VGP_X86_LINUX_TRUE,;t t - s,@VGP_X86_LINUX_FALSE@,$VGP_X86_LINUX_FALSE,;t t ---- valgrind-3.4.0/valgrind.pc.in.jj 2007-01-02 09:52:30.000000000 -0500 -+++ valgrind-3.4.0/valgrind.pc.in 2007-02-13 08:04:57.000000000 -0500 -@@ -4,13 +4,13 @@ libdir=@libdir@ - includedir=@includedir@/valgrind - arch=@VG_ARCH@ - os=@VG_OS@ --platform=@VG_PLATFORM_PRI@ -+platform=@VG_PLATFORM@ - valt_load_address=@VALT_LOAD_ADDRESS@ - - Name: Valgrind - Description: A dynamic binary instrumentation framework - Version: @VERSION@ - Requires: --Libs: -L${libdir}/valgrind/@VG_PLATFORM_PRI@ -lcoregrind -lvex -lgcc -+Libs: -L${libdir}/valgrind/@VG_PLATFORM@ -lcoregrind -lvex -lgcc - Cflags: -I${includedir} - diff --git a/valgrind-3.4.0-power5+-6.patch b/valgrind-3.4.0-power5+-6.patch deleted file mode 100644 index 07a010c..0000000 --- a/valgrind-3.4.0-power5+-6.patch +++ /dev/null @@ -1,781 +0,0 @@ ---- valgrind-3.3.0/VEX/priv/guest-ppc/toIR.c.jj 2007-12-11 00:18:52.000000000 +0100 -+++ valgrind-3.3.0/VEX/priv/guest-ppc/toIR.c 2008-03-03 09:58:59.000000000 +0100 -@@ -333,6 +333,7 @@ typedef enum { - } PPC_GST; - - #define MASK_FPSCR_RN 0x3 -+#define MASK_FPSCR_FPRF 0x1F000 - #define MASK_VSCR_VALID 0x00010001 - - -@@ -2149,7 +2150,7 @@ static IRExpr* /* ::Ity_I32 */ getGST_ma - - /* We're only keeping track of the rounding mode, - so if the mask isn't asking for this, just return 0x0 */ -- if (mask & 0x3) { -+ if (mask & (MASK_FPSCR_RN|MASK_FPSCR_FPRF)) { - assign( val, IRExpr_Get( OFFB_FPROUND, Ity_I32 ) ); - } else { - assign( val, mkU32(0x0) ); -@@ -2278,7 +2279,7 @@ static void putGST_masked ( PPC_GST reg, - switch (reg) { - case PPC_GST_FPSCR: { - /* Allow writes to Rounding Mode */ -- if (mask & 0x3) { -+ if (mask & (MASK_FPSCR_RN|MASK_FPSCR_FPRF)) { - /* construct new fpround from new and old values as per mask: - new fpround = (src & (3 & mask)) | (fpround & (3 & ~mask)) */ - stmt( -@@ -2286,11 +2287,11 @@ static void putGST_masked ( PPC_GST reg, - OFFB_FPROUND, - binop( - Iop_Or32, -- binop(Iop_And32, src, mkU32(3 & mask)), -+ binop(Iop_And32, src, mkU32((MASK_FPSCR_RN|MASK_FPSCR_FPRF) & mask)), - binop( - Iop_And32, - IRExpr_Get(OFFB_FPROUND,Ity_I32), -- mkU32(3 & ~mask) -+ mkU32((MASK_FPSCR_RN|MASK_FPSCR_FPRF) & ~mask) - ) - ) - ) -@@ -3231,6 +3232,48 @@ static Bool dis_int_logic ( UInt theInst - // TODO: alternatively: assign(rA, verbose_Clz64(rS)); - break; - -+ case 0x1FC: // cmpb (Power6: compare bytes) -+ DIP("cmpb r%u,r%u,r%u\n", rA_addr, rS_addr, rB_addr); -+ -+ if (mode64) -+ assign( rA, unop( Iop_V128to64, -+ binop( Iop_CmpEQ8x16, -+ binop( Iop_64HLtoV128, mkU64(0), mkexpr(rS) ), -+ binop( Iop_64HLtoV128, mkU64(0), mkexpr(rB) ) -+ )) ); -+ else -+ assign( rA, unop( Iop_V128to32, -+ binop( Iop_CmpEQ8x16, -+ unop( Iop_32UtoV128, mkexpr(rS) ), -+ unop( Iop_32UtoV128, mkexpr(rB) ) -+ )) ); -+ break; -+ -+ case 0x2DF: { // mftgpr (move floating-point to general purpose register) -+ IRTemp frB = newTemp(Ity_F64); -+ DIP("mftgpr r%u,fr%u\n", rS_addr, rB_addr); -+ -+ assign( frB, getFReg(rB_addr)); // always F64 -+ if (mode64) -+ assign( rA, unop( Iop_ReinterpF64asI64, mkexpr(frB)) ); -+ else -+ assign( rA, unop( Iop_64to32, unop( Iop_ReinterpF64asI64, mkexpr(frB))) ); -+ -+ putIReg( rS_addr, mkexpr(rA)); -+ return True; -+ } -+ case 0x25F: { // mffgpr (move floating-point from general purpose register) -+ IRTemp frA = newTemp(Ity_F64); -+ DIP("mffgpr fr%u,r%u\n", rS_addr, rB_addr); -+ -+ if (mode64) -+ assign( frA, unop( Iop_ReinterpI64asF64, mkexpr(rB)) ); -+ else -+ assign( frA, unop( Iop_ReinterpI64asF64, unop( Iop_32Uto64, mkexpr(rB))) ); -+ -+ putFReg( rS_addr, mkexpr(frA)); -+ return True; -+ } - default: - vex_printf("dis_int_logic(ppc)(opc2)\n"); - return False; -@@ -6556,6 +6599,45 @@ static Bool dis_fp_round ( UInt theInstr - binop(Iop_I64toF64, rm, mkexpr(r_tmp64)) ); - break; - -+ case 0x188: case 0x1A8: case 0x1C8: case 0x1E8: // frin, friz, frip, frim -+ switch(opc2) { -+ case 0x188: // frin (Floating Round to Integer Nearest) -+ DIP("frin%s fr%u,fr%u\n", flag_rC ? ".":"", frD_addr, frB_addr); -+ assign( r_tmp64, -+ binop(Iop_F64toI64, mkU32(Irrm_NEAREST), mkexpr(frB)) ); -+ break; -+ case 0x1A8: // friz (Floating Round to Integer Toward Zero) -+ DIP("friz%s fr%u,fr%u\n", flag_rC ? ".":"", frD_addr, frB_addr); -+ assign( r_tmp64, -+ binop(Iop_F64toI64, mkU32(Irrm_ZERO), mkexpr(frB)) ); -+ break; -+ case 0x1C8: // frip (Floating Round to Integer Plus) -+ DIP("frip%s fr%u,fr%u\n", flag_rC ? ".":"", frD_addr, frB_addr); -+ assign( r_tmp64, -+ binop(Iop_F64toI64, mkU32(Irrm_PosINF), mkexpr(frB)) ); -+ break; -+ case 0x1E8: // frim (Floating Round to Integer Minus) -+ DIP("frim%s fr%u,fr%u\n", flag_rC ? ".":"", frD_addr, frB_addr); -+ assign( r_tmp64, -+ binop(Iop_F64toI64, mkU32(Irrm_NegINF), mkexpr(frB)) ); -+ break; -+ } -+ -+ /* don't use the rounded integer if frB is outside -9e18..9e18 */ -+ /* F64 has only log10(2**52) significant digits anyway */ -+ /* need to preserve sign of zero */ -+ /* frD = (fabs(frB) > 9e18) ? frB : -+ (sign(frB)) ? -fabs((double)r_tmp64) : (double)r_tmp64 */ -+ assign( frD, IRExpr_Mux0X( unop( Iop_32to8, binop( Iop_CmpF64, -+ IRExpr_Const(IRConst_F64(9e18)), unop( Iop_AbsF64, mkexpr(frB)))), -+ IRExpr_Mux0X( unop( Iop_32to8, binop( Iop_Shr32, unop( Iop_64HIto32, -+ unop(Iop_ReinterpF64asI64, mkexpr(frB))), mkU8(31))), -+ binop( Iop_I64toF64, mkU32(0), mkexpr(r_tmp64) ), -+ unop( Iop_NegF64, unop( Iop_AbsF64, -+ binop(Iop_I64toF64, mkU32(0), mkexpr(r_tmp64)) )) ), -+ mkexpr(frB) )); -+ break; -+ - default: - vex_printf("dis_fp_round(ppc)(opc2)\n"); - return False; -@@ -9224,6 +9306,10 @@ DisResult disInstr_PPC_WRK ( - case 0x32E: // fctid - case 0x32F: // fctidz - case 0x34E: // fcfid -+ case 0x188: // frin (Power5+) -+ case 0x1A8: // friz (Power5+) -+ case 0x1C8: // frip (Power5+) -+ case 0x1E8: // frim (Power5+) - if (dis_fp_round(theInstr)) goto decode_success; - goto decode_failure; - -@@ -9310,6 +9396,10 @@ DisResult disInstr_PPC_WRK ( - if (dis_int_arith( theInstr )) goto decode_success; - goto decode_failure; - -+ case 0x1FC: // cmpb -+ if (dis_int_logic( theInstr )) goto decode_success; -+ goto decode_failure; -+ - default: - break; // Fall through... - } -@@ -9328,6 +9418,7 @@ DisResult disInstr_PPC_WRK ( - case 0x11C: case 0x3BA: case 0x39A: // eqv, extsb, extsh - case 0x1DC: case 0x07C: case 0x1BC: // nand, nor, or - case 0x19C: case 0x13C: // orc, xor -+ case 0x2DF: case 0x25F: // mftgpr, mffgpr - if (dis_int_logic( theInstr )) goto decode_success; - goto decode_failure; - ---- valgrind-3.3.0/none/tests/ppc32/Makefile.am.jj 2007-12-11 00:18:32.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc32/Makefile.am 2008-03-03 10:00:36.000000000 +0100 -@@ -19,13 +19,15 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ - testVMX.stderr.exp testVMX.stdout.exp testVMX.vgtest \ - twi.stderr.exp twi.stdout.exp twi.vgtest \ - tw.stderr.exp tw.stdout.exp tw.vgtest \ -- xlc_dbl_u32.stderr.exp xlc_dbl_u32.stdout.exp xlc_dbl_u32.vgtest -+ xlc_dbl_u32.stderr.exp xlc_dbl_u32.stdout.exp xlc_dbl_u32.vgtest \ -+ power5+_round.stderr.exp power5+_round.stdout.exp power5+_round.vgtest \ -+ power6_bcmp.stderr.exp power6_bcmp.stdout.exp power6_bcmp.vgtest - - check_PROGRAMS = \ - bug129390-ppc32 \ - bug139050-ppc32 \ - ldstrev lsw jm-insns mftocrf mcrfs round test_fx test_gx \ -- testVMX twi tw xlc_dbl_u32 -+ testVMX twi tw xlc_dbl_u32 power5+_round power6_bcmp - - AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/include \ - @FLAG_M32@ ---- valgrind-3.3.0/none/tests/ppc32/power5+_round.c.jj 2008-03-03 09:58:59.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc32/power5+_round.c 2008-03-03 09:58:59.000000000 +0100 -@@ -0,0 +1,147 @@ -+/* Copyright (C) 2007 Pete Eberlein eberlein@us.ibm.com -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of the GNU General Public License as -+ published by the Free Software Foundation; either version 2 of the -+ License, or (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, but -+ WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307, USA. -+ -+ The GNU General Public License is contained in the file COPYING. -+*/ -+ -+ -+ -+#include -+#include -+#include -+#include -+ -+#define POS_NORMAL 0x4000 -+#define NEG_NORMAL 0x8000 -+#define POS_INF 0x5000 -+#define NEG_INF 0x9000 -+#define POS_ZERO 0x2000 -+#define NEG_ZERO 0x12000 -+#define POS_DENORMAL 0x14000 -+#define NEG_DENORMAL 0x18000 -+#define NAN 0x11000 -+#define FPRF_MASK 0x1F000 -+ -+ -+int main (int argc, char* argv[]) { -+ -+ double inf, neg0, nan; -+ union { -+ double d; -+ struct { unsigned int dummy, dummy2: 15, fprf:17; }; -+ } fpscr; -+ -+ inf = strtod("inf", NULL); -+ neg0 = copysign(0, -1); -+ nan = strtod("nan", NULL); -+ -+ -+ /* This set is disabled until fprf is implemented. */ -+ if (0) { -+ double set[] = {inf, 1.5, 0, neg0, -1.5, -inf, nan}; -+ int i, j, fprf; -+ for (i=0; i<7; ++i) { -+ for (j=0; j<7; ++j) { -+ asm ("fcmpu 1, %1, %2\n\t" \ -+ "mffs %0\n" \ -+ : "=f" (fpscr.d) \ -+ : "f" (set[i]), "f" (set[j]) \ -+ ); -+ -+ if (i == 6 || j == 6) { -+ fprf = 0x1000; // Unordered -+ } else if (i == j || (i==2 && j==3) || (i==3 && j==2)) { -+ fprf = 0x2000; // Equal -+ } else if (i < j) { -+ fprf = 0x4000; // Greater Than -+ } else if (i > j) { -+ fprf = 0x8000; // Less Than -+ } -+ -+ printf("fcmpu\t%.1f\t%.1f\t%x\t%s\n", set[i], set[j], fpscr.fprf, -+ fpscr.fprf == fprf ? "PASS" : "FAIL"); -+ } -+ } -+ } -+ -+ { -+ double set[] = {inf, 1.9, 1.1, 0, neg0, -1.1, -1.9, -inf, nan}; -+ double frin[] = {inf, 2.0, 1.0, 0, neg0, -1.0, -2.0, -inf, nan}; -+ double friz[] = {inf, 1.0, 1.0, 0, neg0, -1.0, -1.0, -inf, nan}; -+ double frip[] = {inf, 2.0, 2.0, 0, neg0, -1.0, -1.0, -inf, nan}; -+ double frim[] = {inf, 1.0, 1.0, 0, neg0, -2.0, -2.0, -inf, nan}; -+ int fprf[] = {POS_INF, POS_NORMAL, POS_NORMAL, POS_ZERO, NEG_ZERO, -+ NEG_NORMAL, NEG_NORMAL, NEG_INF, NAN}; -+ double set2[] = {0.9, 0.1, -0.1, -0.9, 1e-40, -1e-40}; -+ double frin2[] = {1.0, 0.0, -0.0, -1.0, 0.0, -0.0}; -+ int frin2rf[] = {POS_NORMAL,POS_ZERO,NEG_ZERO,NEG_NORMAL,POS_ZERO,NEG_ZERO}; -+ double friz2[] = {0.0, 0.0, -0.0, -0.0, 0.0, -0.0}; -+ int friz2rf[] = {POS_ZERO,POS_ZERO,NEG_ZERO,NEG_ZERO,POS_ZERO,NEG_ZERO}; -+ double frip2[] = {1.0, 1.0, -0.0, -0.0, 1.0, -0.0}; -+ int frip2rf[] = {POS_NORMAL,POS_NORMAL,NEG_ZERO,NEG_ZERO,POS_NORMAL,NEG_ZERO}; -+ double frim2[] = {0.0, 0.0, -1.0, -1.0, 0.0, -1.0}; -+ int frim2rf[] = {POS_ZERO,POS_ZERO,NEG_NORMAL,NEG_NORMAL,POS_ZERO,NEG_NORMAL}; -+ double ret; -+ int i; -+ -+#define DO_TEST(op,in,out,rf) for (i=0; i -+#include -+#include -+ -+#define CMPB(result,a,b) \ -+ asm __volatile ("cmpb %0, %1, %2\n" : "=r"(result) : "r"(a), "r"(b)) -+ -+ -+int main (int argc, char* argv[]) { -+ int i,j,k; -+ long mask; -+ for (i=1; i<16; i++) { -+ mask = 0; -+ if(i&1) mask+=0xff; -+ if(i&2) mask+=0xff00; -+ if(i&4) mask+=0xff0000; -+ if(i&8) mask+=0xff000000; -+ -+ for (j=0; j<256; j++) -+ for (k=0; k<256; k++) -+ if (j!=k) { -+ -+ long a, b, result; -+ a = (mask & (j*0x1010101)) + ((~mask) & (k*0x1010101)); -+ b = j*0x1010101; -+ CMPB(result, a, b); -+ if (result != mask) -+ printf("%8x %8x %8x %8x\n", mask, a, b, result); -+ exit(1); -+ } -+ -+ } -+ -+ return 0; -+} -+ ---- valgrind-3.3.0/none/tests/ppc32/power6_bcmp.stderr.exp.jj 2008-03-03 09:58:59.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc32/power6_bcmp.stderr.exp 2008-03-03 09:58:59.000000000 +0100 -@@ -0,0 +1,2 @@ -+ -+ ---- valgrind-3.3.0/none/tests/ppc32/power6_bcmp.vgtest.jj 2008-03-03 09:58:59.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc32/power6_bcmp.vgtest 2008-03-03 09:58:59.000000000 +0100 -@@ -0,0 +1 @@ -+prog: power6_bcmp ---- valgrind-3.3.0/none/tests/ppc64/Makefile.am.jj 2007-12-11 00:18:35.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc64/Makefile.am 2008-03-03 10:01:52.000000000 +0100 -@@ -9,10 +9,12 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ - std_reg_imm.vgtest std_reg_imm.stderr.exp std_reg_imm.stdout.exp \ - round.stderr.exp round.stdout.exp round.vgtest \ - twi_tdi.stderr.exp twi_tdi.stdout.exp twi_tdi.vgtest \ -- tw_td.stderr.exp tw_td.stdout.exp tw_td.vgtest -+ tw_td.stderr.exp tw_td.stdout.exp tw_td.vgtest \ -+ power6_bcmp.stderr.exp power6_bcmp.stdout.exp power6_bcmp.vgtest \ -+ power6_mf_gpr.stderr.exp power6_mf_gpr.stdout.exp power6_mf_gpr.vgtest - - check_PROGRAMS = \ -- jm-insns lsw round std_reg_imm twi_tdi tw_td -+ jm-insns lsw round std_reg_imm twi_tdi tw_td power6_bcmp power6_mf_gpr - - AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/include \ - @FLAG_M64@ ---- valgrind-3.3.0/none/tests/ppc64/power6_bcmp.c.jj 2008-03-03 09:58:59.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc64/power6_bcmp.c 2008-03-03 09:58:59.000000000 +0100 -@@ -0,0 +1,61 @@ -+/* Copyright (C) 2007 Pete Eberlein eberlein@us.ibm.com -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of the GNU General Public License as -+ published by the Free Software Foundation; either version 2 of the -+ License, or (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, but -+ WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307, USA. -+ -+ The GNU General Public License is contained in the file COPYING. -+*/ -+ -+ -+#include -+#include -+#include -+ -+#define CMPB(result,a,b) \ -+ asm ("cmpb %0, %1, %2\n" : "=r"(result) : "r"(a), "r"(b)) -+ -+ -+int main (int argc, char* argv[]) { -+ int i,j,k; -+ unsigned long mask; -+ for (i=1; i<256; i++) { -+ mask = 0; -+ if(i&1) mask+=0xff; -+ if(i&2) mask+=0xff00; -+ if(i&4) mask+=0xff0000; -+ if(i&8) mask+=0xff000000; -+ if(i&16) mask+=0xff00000000; -+ if(i&32) mask+=0xff0000000000; -+ if(i&64) mask+=0xff000000000000; -+ if(i&128) mask+=0xff00000000000000; -+ -+ for (j=0; j<256; j++) -+ for (k=0; k<256; k++) -+ if (j!=k) { -+ -+ unsigned long a, b, result; -+ a = (mask & (j*0x101010101010101)) + ((~mask) & (k*0x101010101010101)); -+ b = j*0x101010101010101; -+ CMPB(result, a, b); -+ if (result != mask) -+ printf("%8lx %8lx %8lx %8lx\n", mask, a, b, result); -+ exit(1); -+ } -+ -+ } -+ -+ return 0; -+} -+ ---- valgrind-3.3.0/none/tests/ppc64/power6_bcmp.stderr.exp.jj 2008-03-03 09:58:59.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc64/power6_bcmp.stderr.exp 2008-03-03 09:58:59.000000000 +0100 -@@ -0,0 +1,2 @@ -+ -+ ---- valgrind-3.3.0/none/tests/ppc64/power6_bcmp.vgtest.jj 2008-03-03 09:58:59.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc64/power6_bcmp.vgtest 2008-03-03 09:58:59.000000000 +0100 -@@ -0,0 +1 @@ -+prog: power6_bcmp ---- valgrind-3.3.0/none/tests/ppc64/power6_mf_gpr.c.jj 2008-03-03 09:58:59.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc64/power6_mf_gpr.c 2008-03-03 09:58:59.000000000 +0100 -@@ -0,0 +1,47 @@ -+/* Copyright (C) 2007 Pete Eberlein eberlein@us.ibm.com -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of the GNU General Public License as -+ published by the Free Software Foundation; either version 2 of the -+ License, or (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, but -+ WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307, USA. -+ -+ The GNU General Public License is contained in the file COPYING. -+*/ -+ -+#include -+#include -+ -+ -+ -+int main (int argc, char* argv[]) -+{ -+ -+ long i; -+ double f; -+ -+ i = 0; -+ f = 100.0; -+ -+ printf("%lx %f\n", i, f); -+ -+ asm ("mftgpr %0, %1\n" : "=r"(i) : "f"(f)); -+ -+ f=0.0; -+ printf("%lx %f\n", i, f); -+ -+ asm ("mffgpr %0, %1\n" : "=f"(f) : "r"(i)); -+ -+ printf("%lx %f\n", i, f); -+ -+ return 0; -+} ---- valgrind-3.3.0/none/tests/ppc64/power6_mf_gpr.stderr.exp.jj 2008-03-03 09:58:59.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc64/power6_mf_gpr.stderr.exp 2008-03-03 09:58:59.000000000 +0100 -@@ -0,0 +1,2 @@ -+ -+ ---- valgrind-3.3.0/none/tests/ppc64/power6_mf_gpr.stdout.exp.jj 2008-03-03 09:58:59.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc64/power6_mf_gpr.stdout.exp 2008-03-03 09:58:59.000000000 +0100 -@@ -0,0 +1,3 @@ -+0 100.000000 -+4059000000000000 0.000000 -+4059000000000000 100.000000 ---- valgrind-3.3.0/none/tests/ppc64/power6_mf_gpr.vgtest.jj 2008-03-03 09:58:59.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc64/power6_mf_gpr.vgtest 2008-03-03 09:58:59.000000000 +0100 -@@ -0,0 +1 @@ -+prog: power6_mf_gpr ---- valgrind-3.3.0/none/tests/ppc32/Makefile.in.jj 2007-12-11 00:23:53.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc32/Makefile.in 2008-03-03 10:02:14.000000000 +0100 -@@ -40,7 +40,8 @@ check_PROGRAMS = bug129390-ppc32$(EXEEXT - ldstrev$(EXEEXT) lsw$(EXEEXT) jm-insns$(EXEEXT) \ - mftocrf$(EXEEXT) mcrfs$(EXEEXT) round$(EXEEXT) \ - test_fx$(EXEEXT) test_gx$(EXEEXT) testVMX$(EXEEXT) \ -- twi$(EXEEXT) tw$(EXEEXT) xlc_dbl_u32$(EXEEXT) -+ twi$(EXEEXT) tw$(EXEEXT) xlc_dbl_u32$(EXEEXT) \ -+ power5+_round$(EXEEXT) power6_bcmp$(EXEEXT) - subdir = none/tests/ppc32 - DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -@@ -71,6 +72,12 @@ mcrfs_LDADD = $(LDADD) - mftocrf_SOURCES = mftocrf.c - mftocrf_OBJECTS = mftocrf.$(OBJEXT) - mftocrf_LDADD = $(LDADD) -+power5__round_SOURCES = power5+_round.c -+power5__round_OBJECTS = power5+_round.$(OBJEXT) -+power5__round_LDADD = $(LDADD) -+power6_bcmp_SOURCES = power6_bcmp.c -+power6_bcmp_OBJECTS = power6_bcmp.$(OBJEXT) -+power6_bcmp_LDADD = $(LDADD) - round_SOURCES = round.c - round_OBJECTS = round.$(OBJEXT) - round_LDADD = $(LDADD) -@@ -101,11 +108,12 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUD - CCLD = $(CC) - LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ - SOURCES = bug129390-ppc32.c bug139050-ppc32.c jm-insns.c ldstrev.c \ -- lsw.c mcrfs.c mftocrf.c round.c testVMX.c test_fx.c test_gx.c \ -- tw.c twi.c xlc_dbl_u32.c -+ lsw.c mcrfs.c mftocrf.c power5+_round.c power6_bcmp.c round.c \ -+ testVMX.c test_fx.c test_gx.c tw.c twi.c xlc_dbl_u32.c - DIST_SOURCES = bug129390-ppc32.c bug139050-ppc32.c jm-insns.c \ -- ldstrev.c lsw.c mcrfs.c mftocrf.c round.c testVMX.c test_fx.c \ -- test_gx.c tw.c twi.c xlc_dbl_u32.c -+ ldstrev.c lsw.c mcrfs.c mftocrf.c power5+_round.c \ -+ power6_bcmp.c round.c testVMX.c test_fx.c test_gx.c tw.c twi.c \ -+ xlc_dbl_u32.c - ETAGS = etags - CTAGS = ctags - DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -@@ -266,7 +275,9 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ - testVMX.stderr.exp testVMX.stdout.exp testVMX.vgtest \ - twi.stderr.exp twi.stdout.exp twi.vgtest \ - tw.stderr.exp tw.stdout.exp tw.vgtest \ -- xlc_dbl_u32.stderr.exp xlc_dbl_u32.stdout.exp xlc_dbl_u32.vgtest -+ xlc_dbl_u32.stderr.exp xlc_dbl_u32.stdout.exp xlc_dbl_u32.vgtest \ -+ power5+_round.stderr.exp power5+_round.stdout.exp power5+_round.vgtest \ -+ power6_bcmp.stderr.exp power6_bcmp.stdout.exp power6_bcmp.vgtest - - AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/include \ - @FLAG_M32@ -@@ -335,6 +346,12 @@ mcrfs$(EXEEXT): $(mcrfs_OBJECTS) $(mcrfs - mftocrf$(EXEEXT): $(mftocrf_OBJECTS) $(mftocrf_DEPENDENCIES) - @rm -f mftocrf$(EXEEXT) - $(LINK) $(mftocrf_LDFLAGS) $(mftocrf_OBJECTS) $(mftocrf_LDADD) $(LIBS) -+power5+_round$(EXEEXT): $(power5__round_OBJECTS) $(power5__round_DEPENDENCIES) -+ @rm -f power5+_round$(EXEEXT) -+ $(LINK) $(power5__round_LDFLAGS) $(power5__round_OBJECTS) $(power5__round_LDADD) $(LIBS) -+power6_bcmp$(EXEEXT): $(power6_bcmp_OBJECTS) $(power6_bcmp_DEPENDENCIES) -+ @rm -f power6_bcmp$(EXEEXT) -+ $(LINK) $(power6_bcmp_LDFLAGS) $(power6_bcmp_OBJECTS) $(power6_bcmp_LDADD) $(LIBS) - round$(EXEEXT): $(round_OBJECTS) $(round_DEPENDENCIES) - @rm -f round$(EXEEXT) - $(LINK) $(round_LDFLAGS) $(round_OBJECTS) $(round_LDADD) $(LIBS) -@@ -370,6 +387,8 @@ distclean-compile: - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsw.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcrfs.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mftocrf.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/power5+_round.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/power6_bcmp.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/round.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testVMX-testVMX.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_fx.Po@am__quote@ ---- valgrind-3.3.0/none/tests/ppc64/Makefile.in.jj 2007-12-11 00:23:55.000000000 +0100 -+++ valgrind-3.3.0/none/tests/ppc64/Makefile.in 2008-03-03 10:02:14.000000000 +0100 -@@ -37,7 +37,8 @@ POST_UNINSTALL = : - build_triplet = @build@ - host_triplet = @host@ - check_PROGRAMS = jm-insns$(EXEEXT) lsw$(EXEEXT) round$(EXEEXT) \ -- std_reg_imm$(EXEEXT) twi_tdi$(EXEEXT) tw_td$(EXEEXT) -+ std_reg_imm$(EXEEXT) twi_tdi$(EXEEXT) tw_td$(EXEEXT) \ -+ power6_bcmp$(EXEEXT) power6_mf_gpr$(EXEEXT) - subdir = none/tests/ppc64 - DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -@@ -53,6 +54,12 @@ jm_insns_LDADD = $(LDADD) - lsw_SOURCES = lsw.c - lsw_OBJECTS = lsw.$(OBJEXT) - lsw_LDADD = $(LDADD) -+power6_bcmp_SOURCES = power6_bcmp.c -+power6_bcmp_OBJECTS = power6_bcmp.$(OBJEXT) -+power6_bcmp_LDADD = $(LDADD) -+power6_mf_gpr_SOURCES = power6_mf_gpr.c -+power6_mf_gpr_OBJECTS = power6_mf_gpr.$(OBJEXT) -+power6_mf_gpr_LDADD = $(LDADD) - round_SOURCES = round.c - round_OBJECTS = round.$(OBJEXT) - round_LDADD = $(LDADD) -@@ -73,9 +80,10 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUD - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - CCLD = $(CC) - LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ --SOURCES = jm-insns.c lsw.c round.c std_reg_imm.c tw_td.c twi_tdi.c --DIST_SOURCES = jm-insns.c lsw.c round.c std_reg_imm.c tw_td.c \ -- twi_tdi.c -+SOURCES = jm-insns.c lsw.c power6_bcmp.c power6_mf_gpr.c round.c \ -+ std_reg_imm.c tw_td.c twi_tdi.c -+DIST_SOURCES = jm-insns.c lsw.c power6_bcmp.c power6_mf_gpr.c round.c \ -+ std_reg_imm.c tw_td.c twi_tdi.c - ETAGS = etags - CTAGS = ctags - DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -@@ -226,7 +235,9 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ - std_reg_imm.vgtest std_reg_imm.stderr.exp std_reg_imm.stdout.exp \ - round.stderr.exp round.stdout.exp round.vgtest \ - twi_tdi.stderr.exp twi_tdi.stdout.exp twi_tdi.vgtest \ -- tw_td.stderr.exp tw_td.stdout.exp tw_td.vgtest -+ tw_td.stderr.exp tw_td.stdout.exp tw_td.vgtest \ -+ power6_bcmp.stderr.exp power6_bcmp.stdout.exp power6_bcmp.vgtest \ -+ power6_mf_gpr.stderr.exp power6_mf_gpr.stdout.exp power6_mf_gpr.vgtest - - AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/include \ - @FLAG_M64@ -@@ -277,6 +288,12 @@ jm-insns$(EXEEXT): $(jm_insns_OBJECTS) $ - lsw$(EXEEXT): $(lsw_OBJECTS) $(lsw_DEPENDENCIES) - @rm -f lsw$(EXEEXT) - $(LINK) $(lsw_LDFLAGS) $(lsw_OBJECTS) $(lsw_LDADD) $(LIBS) -+power6_bcmp$(EXEEXT): $(power6_bcmp_OBJECTS) $(power6_bcmp_DEPENDENCIES) -+ @rm -f power6_bcmp$(EXEEXT) -+ $(LINK) $(power6_bcmp_LDFLAGS) $(power6_bcmp_OBJECTS) $(power6_bcmp_LDADD) $(LIBS) -+power6_mf_gpr$(EXEEXT): $(power6_mf_gpr_OBJECTS) $(power6_mf_gpr_DEPENDENCIES) -+ @rm -f power6_mf_gpr$(EXEEXT) -+ $(LINK) $(power6_mf_gpr_LDFLAGS) $(power6_mf_gpr_OBJECTS) $(power6_mf_gpr_LDADD) $(LIBS) - round$(EXEEXT): $(round_OBJECTS) $(round_DEPENDENCIES) - @rm -f round$(EXEEXT) - $(LINK) $(round_LDFLAGS) $(round_OBJECTS) $(round_LDADD) $(LIBS) -@@ -298,6 +315,8 @@ distclean-compile: - - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jm_insns-jm-insns.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsw.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/power6_bcmp.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/power6_mf_gpr.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/round.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/std_reg_imm.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tw_td.Po@am__quote@ diff --git a/valgrind-3.4.0-cachegrind-improvements.patch b/valgrind-3.4.1-cachegrind-improvements.patch similarity index 88% rename from valgrind-3.4.0-cachegrind-improvements.patch rename to valgrind-3.4.1-cachegrind-improvements.patch index ec8eaca..5fbb3cc 100644 --- a/valgrind-3.4.0-cachegrind-improvements.patch +++ b/valgrind-3.4.1-cachegrind-improvements.patch @@ -1,12 +1,11 @@ --- valgrind-3.4.0/cachegrind/cg_sim.c.jj 2007-01-08 02:43:10.000000000 -0500 +++ valgrind-3.4.0/cachegrind/cg_sim.c 2007-02-13 07:15:46.000000000 -0500 -@@ -42,29 +42,32 @@ typedef struct { +@@ -42,27 +42,30 @@ typedef struct { Int size; /* bytes */ Int assoc; Int line_size; /* bytes */ - Int sets; Int sets_min_1; - Int assoc_bits; Int line_size_bits; Int tag_shift; - Char desc_line[128]; @@ -33,14 +32,13 @@ - c->sets_min_1 = c->sets - 1; + sets = (c->size / c->line_size) / c->assoc; + c->sets_min_1 = sets - 1; - c->assoc_bits = VG_(log2)(c->assoc); c->line_size_bits = VG_(log2)(c->line_size); - c->tag_shift = c->line_size_bits + VG_(log2)(c->sets); + c->tag_shift = c->line_size_bits + VG_(log2)(sets); if (c->assoc == 1) { VG_(sprintf)(c->desc_line, "%d B, %d B, direct-mapped", -@@ -74,11 +77,8 @@ static void cachesim_initcache(cache_t c +@@ -72,11 +75,8 @@ static void cachesim_initcache(cache_t c c->size, c->line_size, c->assoc); } @@ -54,13 +52,13 @@ } /* This is done as a macro rather than by passing in the cache_t2 as an -@@ -141,8 +141,7 @@ void cachesim_##L##_doref(Addr a, UChar +@@ -138,8 +138,7 @@ void cachesim_##L##_doref(Addr a, UChar return; \ \ /* Second case: word straddles two lines. */ \ - /* Nb: this is a fast way of doing ((set1+1) % L.sets) */ \ - } else if (((set1 + 1) & (L.sets-1)) == set2) { \ + } else if (((set1 + 1) & (L.sets_min_1)) == set2) { \ - set = &(L.tags[set1 << L.assoc_bits]); \ + set = &(L.tags[set1 * L.assoc]); \ if (tag == set[0]) { \ goto block2; \ diff --git a/valgrind-3.4.0-openat.patch b/valgrind-3.4.1-openat.patch similarity index 100% rename from valgrind-3.4.0-openat.patch rename to valgrind-3.4.1-openat.patch diff --git a/valgrind.spec b/valgrind.spec index e687fb0..ea3846f 100644 --- a/valgrind.spec +++ b/valgrind.spec @@ -1,14 +1,11 @@ Summary: Tool for finding memory management bugs in programs Name: valgrind -Version: 3.4.0 -Release: 4 +Version: 3.4.1 +Release: 1 Epoch: 1 Source0: http://www.valgrind.org/downloads/valgrind-%{version}.tar.bz2 -Patch1: valgrind-3.4.0-cachegrind-improvements.patch -Patch2: valgrind-3.4.0-pkg-config.patch -Patch3: valgrind-3.4.0-openat.patch -Patch4: valgrind-3.4.0-newbu.patch -Patch5: valgrind-3.4.0-debug.patch +Patch1: valgrind-3.4.1-cachegrind-improvements.patch +Patch2: valgrind-3.4.1-openat.patch License: GPLv2 URL: http://www.valgrind.org/ Group: Development/Debuggers @@ -18,7 +15,7 @@ Obsoletes: valgrind-callgrind # Ensure glibc{,-devel} is installed for both multilib arches BuildRequires: /lib/libc.so.6 /usr/lib/libc.so /lib64/libc.so.6 /usr/lib64/libc.so %endif -BuildRequires: glibc-devel >= 2.8 +BuildRequires: glibc-devel >= 2.9 ExclusiveArch: %{ix86} x86_64 ppc ppc64 %ifarch %{ix86} %define valarch x86 @@ -64,9 +61,6 @@ or valgrind plugins. %setup -q %patch1 -p1 %patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 %build %ifarch x86_64 ppc64 @@ -157,8 +151,8 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/* %changelog -* Wed Feb 25 2009 Fedora Release Engineering - 1:3.4.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild +* Mon Mar 9 2009 Jakub Jelinek 3.4.1-1 +- update to 3.4.1 * Tue Feb 9 2009 Jakub Jelinek 3.4.0-3 - update to 3.4.0