|
From: <sv...@va...> - 2008-05-21 14:33:12
|
Author: bart Date: 2008-05-21 15:33:07 +0100 (Wed, 21 May 2008) New Revision: 8114 Log: Added more comments and assert statements. Modified: branches/CROSS_COMPILATION/exp-drd/drd_main.c Modified: branches/CROSS_COMPILATION/exp-drd/drd_main.c =================================================================== --- branches/CROSS_COMPILATION/exp-drd/drd_main.c 2008-05-21 14:27:42 UTC (rev 8113) +++ branches/CROSS_COMPILATION/exp-drd/drd_main.c 2008-05-21 14:33:07 UTC (rev 8114) @@ -554,10 +554,16 @@ drd_stop_using_mem(a1, len, False); } -/** Suppress data race reports on all addresses contained in .plt sections - * inside the address range [ a, a + len [. +/** Suppress data race reports on all addresses contained in .plt and + * .got.plt sections inside the address range [ a, a + len [. The data in + * these sections is modified by _dl_relocate_object() every time a function + * in a shared library is called for the first time. Since the first call + * to a function in a shared library can happen from a multithreaded context, + * such calls can cause conflicting accesses. See also Ulrich Drepper's + * paper "How to Write Shared Libraries" for more information about relocation + * (http://people.redhat.com/drepper/dsohowto.pdf). */ -static void suppress_plt(const Addr a, const SizeT len) +static void suppress_relocation_conflicts(const Addr a, const SizeT len) { const DebugInfo* di; @@ -577,6 +583,7 @@ #if 0 VG_(printf)("Suppressing .plt @ 0x%lx size %ld\n", avma, size); #endif + tl_assert(VG_(seginfo_sect_kind)(NULL, 0, avma) == Vg_SectPLT); drd_start_suppression(avma, avma + size, ".plt"); } @@ -587,6 +594,7 @@ #if 0 VG_(printf)("Suppressing .got.plt @ 0x%lx size %ld\n", avma, size); #endif + tl_assert(VG_(seginfo_sect_kind)(NULL, 0, avma) == Vg_SectGOTPLT); drd_start_suppression(avma, avma + size, ".gotplt"); } } @@ -600,7 +608,7 @@ drd_start_using_mem(a, len); - suppress_plt(a, len); + suppress_relocation_conflicts(a, len); } /* Called by the core when the stack of a thread grows, to indicate that */ |