|
From: <sv...@va...> - 2012-09-06 14:08:41
|
bart 2012-09-06 15:08:26 +0100 (Thu, 06 Sep 2012)
New Revision: 12960
Log:
drd: Suppress race reports on .got sections too
This is a slightly modified version of a patch provided by Petar Jovanovic
<pet...@rt...>.
Modified files:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/drd/drd_main.c
trunk/include/pub_tool_debuginfo.h
Modified: trunk/coregrind/m_debuginfo/debuginfo.c (+10 -0)
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c 2012-09-06 04:26:50 +01:00 (rev 12959)
+++ trunk/coregrind/m_debuginfo/debuginfo.c 2012-09-06 15:08:26 +01:00 (rev 12960)
@@ -3788,6 +3788,16 @@
return di->gotplt_present ? di->gotplt_size : 0;
}
+Addr VG_(DebugInfo_get_got_avma)(const DebugInfo* di)
+{
+ return di->got_present ? di->got_avma : 0;
+}
+
+SizeT VG_(DebugInfo_get_got_size)(const DebugInfo* di)
+{
+ return di->got_present ? di->got_size : 0;
+}
+
const UChar* VG_(DebugInfo_get_soname)(const DebugInfo* di)
{
return di->soname;
Modified: trunk/include/pub_tool_debuginfo.h (+2 -0)
===================================================================
--- trunk/include/pub_tool_debuginfo.h 2012-09-06 04:26:50 +01:00 (rev 12959)
+++ trunk/include/pub_tool_debuginfo.h 2012-09-06 15:08:26 +01:00 (rev 12960)
@@ -188,6 +188,8 @@
SizeT VG_(DebugInfo_get_plt_size) ( const DebugInfo *di );
Addr VG_(DebugInfo_get_gotplt_avma) ( const DebugInfo *di );
SizeT VG_(DebugInfo_get_gotplt_size) ( const DebugInfo *di );
+Addr VG_(DebugInfo_get_got_avma) ( const DebugInfo *di );
+SizeT VG_(DebugInfo_get_got_size) ( const DebugInfo *di );
const UChar* VG_(DebugInfo_get_soname) ( const DebugInfo *di );
const UChar* VG_(DebugInfo_get_filename) ( const DebugInfo *di );
PtrdiffT VG_(DebugInfo_get_text_bias) ( const DebugInfo *di );
Modified: trunk/drd/drd_main.c (+12 -1)
===================================================================
--- trunk/drd/drd_main.c 2012-09-06 04:26:50 +01:00 (rev 12959)
+++ trunk/drd/drd_main.c 2012-09-06 15:08:26 +01:00 (rev 12960)
@@ -412,7 +412,7 @@
static const Bool trace_sectsuppr = False;
/**
- * Suppress data race reports on all addresses contained in .plt and
+ * Suppress data race reports on all addresses contained in .plt, .got 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
@@ -420,6 +420,7 @@
* 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).
+ * Note: the contents of the .got section is only modified by the MIPS resolver.
*/
static void DRD_(suppress_relocation_conflicts)(const Addr a, const SizeT len)
{
@@ -455,6 +456,16 @@
tl_assert(VG_(DebugInfo_sect_kind)(NULL, 0, avma) == Vg_SectGOTPLT);
DRD_(start_suppression)(avma, avma + size, ".gotplt");
}
+
+ avma = VG_(DebugInfo_get_got_avma)(di);
+ size = VG_(DebugInfo_get_got_size)(di);
+ tl_assert((avma && size) || (avma == 0 && size == 0));
+ if (size > 0) {
+ if (trace_sectsuppr)
+ VG_(dmsg)("Suppressing .got @ 0x%lx size %ld\n", avma, size);
+ tl_assert(VG_(DebugInfo_sect_kind)(NULL, 0, avma) == Vg_SectGOT);
+ DRD_(start_suppression)(avma, avma + size, ".got");
+ }
}
}
|