Mark Wielaard f5bf8f
commit 200b6a5a0ea3e1e154663b0fc575bfe2becf177d
Mark Wielaard f5bf8f
Author: Mark Wielaard <mark@klomp.org>
Mark Wielaard f5bf8f
Date:   Wed Jul 21 17:55:40 2021 +0200
Mark Wielaard f5bf8f
Mark Wielaard f5bf8f
    m_debuginfo/debuginfo.c VG_(get_fnname_kind) _start is below main
Mark Wielaard f5bf8f
    
Mark Wielaard f5bf8f
    With glibc 2.34 we might see the _start symbol as the frame that
Mark Wielaard f5bf8f
    called main instead of directly after __libc_start_main or
Mark Wielaard f5bf8f
    generic_start_main.
Mark Wielaard f5bf8f
    
Mark Wielaard f5bf8f
    Fixes memcheck/tests/badjump[2], memcheck/tests/origin4-many,
Mark Wielaard f5bf8f
    helgrind/tests/tc04_free_lock, helgrind/tests/tc09_bad_unlock
Mark Wielaard f5bf8f
    and helgrind/tests/tc20_verifywrap.
Mark Wielaard f5bf8f
Mark Wielaard f5bf8f
diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c
Mark Wielaard f5bf8f
index bc2578b37..e2218f266 100644
Mark Wielaard f5bf8f
--- a/coregrind/m_debuginfo/debuginfo.c
Mark Wielaard f5bf8f
+++ b/coregrind/m_debuginfo/debuginfo.c
Mark Wielaard f5bf8f
@@ -2289,6 +2289,7 @@ Vg_FnNameKind VG_(get_fnname_kind) ( const HChar* name )
Mark Wielaard f5bf8f
        VG_STREQN(18, "__libc_start_main.", name) || // gcc optimization
Mark Wielaard f5bf8f
        VG_STREQ("generic_start_main", name) ||  // Yellow Dog doggedness
Mark Wielaard f5bf8f
        VG_STREQN(19, "generic_start_main.", name) || // gcc optimization
Mark Wielaard f5bf8f
+       VG_STREQ("_start", name) ||
Mark Wielaard f5bf8f
 #      elif defined(VGO_darwin)
Mark Wielaard f5bf8f
        // See readmacho.c for an explanation of this.
Mark Wielaard f5bf8f
        VG_STREQ("start_according_to_valgrind", name) ||  // Darwin, darling