import valgrind-3.22.0-2.el8

c8-beta imports/c8-beta/valgrind-3.22.0-2.el8
MSVSphere Packaging Team 11 months ago
commit f2b8eb4d9b

1
.gitignore vendored

@ -0,0 +1 @@
SOURCES/valgrind-3.22.0.tar.bz2

@ -0,0 +1 @@
60894cbf59d480c1794674da24a8406518a8df59 SOURCES/valgrind-3.22.0.tar.bz2

@ -0,0 +1,59 @@
commit d3c977726064ba09fed6dfc7daf22b16824c97b4
Author: Mark Wielaard <mark@klomp.org>
Date: Fri May 24 18:24:56 2019 +0200
Add -Wl,-z,now to some binaries.
diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am
index 1b7842b..e211eec 100644
--- a/auxprogs/Makefile.am
+++ b/auxprogs/Makefile.am
@@ -32,7 +32,7 @@ valgrind_listener_SOURCES = valgrind-listener.c
valgrind_listener_CPPFLAGS = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI) -fstack-protector-strong
valgrind_listener_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-valgrind_listener_LDFLAGS = $(AM_CFLAGS_PRI)
+valgrind_listener_LDFLAGS = $(AM_CFLAGS_PRI) -Wl,-z,now
if VGCONF_PLATVARIANT_IS_ANDROID
valgrind_listener_CFLAGS += -static
endif
@@ -51,7 +51,7 @@ valgrind_di_server_SOURCES = valgrind-di-server.c
valgrind_di_server_CPPFLAGS = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
valgrind_di_server_CFLAGS = $(AM_CFLAGS_PRI) -fstack-protector-strong
valgrind_di_server_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-valgrind_di_server_LDFLAGS = $(AM_CFLAGS_PRI)
+valgrind_di_server_LDFLAGS = $(AM_CFLAGS_PRI) -Wl,-z,now
if VGCONF_PLATVARIANT_IS_ANDROID
valgrind_di_server_CFLAGS += -static
endif
@@ -86,7 +86,7 @@ getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = getoff.c
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -fstack-protector-strong
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
+getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@ -Wl,-z,now
if HAVE_DLINFO_RTLD_DI_TLS_MODID
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = $(LDADD) -ldl
endif
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
index 3c73210..fb6b7bb 100644
--- a/coregrind/Makefile.am
+++ b/coregrind/Makefile.am
@@ -57,7 +57,7 @@ RANLIB = ${LTO_RANLIB}
valgrind_CPPFLAGS = $(AM_CPPFLAGS_PRI)
valgrind_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fstack-protector-strong
valgrind_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-valgrind_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
+valgrind_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@ -Wl,-z,now
# If there is no secondary platform, and the platforms include x86-darwin,
# then the primary platform must be x86-darwin. Hence:
if ! VGCONF_HAVE_PLATFORM_SEC
@@ -104,7 +104,7 @@
vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI) $(GDB_SCRIPTS_DIR)
vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fstack-protector-strong
vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-vgdb_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
+vgdb_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@ -Wl,-z,now
if VGCONF_PLATVARIANT_IS_ANDROID
vgdb_CFLAGS += -static
endif

@ -0,0 +1,105 @@
commit b73fb7a614e1b5d60af23fb0752b5cead995e02e
Author: Mark Wielaard <mark@klomp.org>
Date: Sun Apr 14 00:30:05 2019 +0200
Remove no-stack-protector, add stack-protector-strong to some.
diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am
index 56cc5ef..1b7842b 100644
--- a/auxprogs/Makefile.am
+++ b/auxprogs/Makefile.am
@@ -30,7 +30,7 @@ bin_PROGRAMS = valgrind-listener valgrind-di-server
valgrind_listener_SOURCES = valgrind-listener.c
valgrind_listener_CPPFLAGS = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
-valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI)
+valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI) -fstack-protector-strong
valgrind_listener_CCASFLAGS = $(AM_CCASFLAGS_PRI)
valgrind_listener_LDFLAGS = $(AM_CFLAGS_PRI)
if VGCONF_PLATVARIANT_IS_ANDROID
@@ -49,7 +49,7 @@ endif
valgrind_di_server_SOURCES = valgrind-di-server.c
valgrind_di_server_CPPFLAGS = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
-valgrind_di_server_CFLAGS = $(AM_CFLAGS_PRI)
+valgrind_di_server_CFLAGS = $(AM_CFLAGS_PRI) -fstack-protector-strong
valgrind_di_server_CCASFLAGS = $(AM_CCASFLAGS_PRI)
valgrind_di_server_LDFLAGS = $(AM_CFLAGS_PRI)
if VGCONF_PLATVARIANT_IS_ANDROID
@@ -84,7 +84,7 @@ endif
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = getoff.c
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
-getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
+getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -fstack-protector-strong
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CCASFLAGS = $(AM_CCASFLAGS_PRI)
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
if HAVE_DLINFO_RTLD_DI_TLS_MODID
diff --git a/configure.ac b/configure.ac
index f8c798b..ccc8f52 100755
--- a/configure.ac
+++ b/configure.ac
@@ -2352,24 +2352,24 @@
AM_CONDITIONAL([HAVE_ALIGNED_CXX_ALLOC], [test x$ac_have_aligned_cxx_alloc = xyes])
# does this compiler support -fno-stack-protector ?
-AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
-
-safe_CFLAGS=$CFLAGS
-CFLAGS="-fno-stack-protector -Werror"
-
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
- return 0;
-]])], [
-no_stack_protector=yes
-FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
-AC_MSG_RESULT([yes])
-], [
-no_stack_protector=no
+#AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
+#
+#safe_CFLAGS=$CFLAGS
+#CFLAGS="-fno-stack-protector -Werror"
+#
+#AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+# return 0;
+#]])], [
+#no_stack_protector=yes
+#FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
+#AC_MSG_RESULT([yes])
+#], [
+#no_stack_protector=no
FLAG_FNO_STACK_PROTECTOR=""
-AC_MSG_RESULT([no])
-])
-CFLAGS=$safe_CFLAGS
-
+#AC_MSG_RESULT([no])
+#])
+#CFLAGS=$safe_CFLAGS
+#
AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
# does this compiler support -finline-functions ?
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
index 94030fd..3c73210 100644
--- a/coregrind/Makefile.am
+++ b/coregrind/Makefile.am
@@ -55,7 +55,7 @@ AR = ${LTO_AR}
RANLIB = ${LTO_RANLIB}
valgrind_CPPFLAGS = $(AM_CPPFLAGS_PRI)
-valgrind_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS)
+valgrind_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fstack-protector-strong
valgrind_CCASFLAGS = $(AM_CCASFLAGS_PRI)
valgrind_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
# If there is no secondary platform, and the platforms include x86-darwin,
@@ -102,7 +102,7 @@
endif
vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI) $(GDB_SCRIPTS_DIR)
-vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS)
+vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fstack-protector-strong
vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI)
vgdb_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
if VGCONF_PLATVARIANT_IS_ANDROID

@ -0,0 +1,122 @@
commit 1d00e5ce0fb069911c4b525ec38289fb5d9021b0
Author: Paul Floyd <pjfloyd@wanadoo.fr>
Date: Sat Nov 18 08:49:34 2023 +0100
Bug 476548 - valgrind 3.22.0 fails on assertion when loading debuginfo file produced by mold
(cherry picked from commit 9ea4ae66707a4dcc6f4328e11911652e4418c585)
diff --git a/coregrind/m_debuginfo/image.c b/coregrind/m_debuginfo/image.c
index 02e509071..445f95555 100644
--- a/coregrind/m_debuginfo/image.c
+++ b/coregrind/m_debuginfo/image.c
@@ -1221,6 +1221,20 @@ Int ML_(img_strcmp_c)(DiImage* img, DiOffT off1, const HChar* str2)
}
}
+Int ML_(img_strcmp_n)(DiImage* img, DiOffT off1, const HChar* str2, Word n)
+{
+ ensure_valid(img, off1, 1, "ML_(img_strcmp_c)");
+ while (n) {
+ UChar c1 = get(img, off1);
+ UChar c2 = *(const UChar*)str2;
+ if (c1 < c2) return -1;
+ if (c1 > c2) return 1;
+ if (c1 == 0) return 0;
+ off1++; str2++; --n;
+ }
+ return 0;
+}
+
UChar ML_(img_get_UChar)(DiImage* img, DiOffT offset)
{
ensure_valid(img, offset, 1, "ML_(img_get_UChar)");
diff --git a/coregrind/m_debuginfo/priv_image.h b/coregrind/m_debuginfo/priv_image.h
index a49846f14..c91e49f01 100644
--- a/coregrind/m_debuginfo/priv_image.h
+++ b/coregrind/m_debuginfo/priv_image.h
@@ -115,6 +115,10 @@ Int ML_(img_strcmp)(DiImage* img, DiOffT off1, DiOffT off2);
cast to HChar before comparison. */
Int ML_(img_strcmp_c)(DiImage* img, DiOffT off1, const HChar* str2);
+/* Do strncmp of a C string in the image vs a normal one. Chars are
+ cast to HChar before comparison. */
+Int ML_(img_strcmp_n)(DiImage* img, DiOffT off1, const HChar* str2, Word n);
+
/* Do strlen of a C string in the image. */
SizeT ML_(img_strlen)(DiImage* img, DiOffT off);
diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c
index fb64ed976..46f8c8343 100644
--- a/coregrind/m_debuginfo/readelf.c
+++ b/coregrind/m_debuginfo/readelf.c
@@ -2501,8 +2501,7 @@ Bool ML_(read_elf_object) ( struct _DebugInfo* di )
di->rodata_avma += inrw1->bias;
di->rodata_bias = inrw1->bias;
di->rodata_debug_bias = inrw1->bias;
- }
- else {
+ } else {
BAD(".rodata"); /* should not happen? */
}
di->rodata_present = True;
@@ -2977,6 +2976,46 @@ Bool ML_(read_elf_object) ( struct _DebugInfo* di )
return retval;
}
+static void find_rodata(Word i, Word shnum, DiImage* dimg, struct _DebugInfo* di, DiOffT shdr_dioff,
+ UWord shdr_dent_szB, DiOffT shdr_strtab_dioff, PtrdiffT rw_dbias)
+{
+ ElfXX_Shdr a_shdr;
+ ElfXX_Shdr a_extra_shdr;
+ ML_(img_get)(&a_shdr, dimg,
+ INDEX_BIS(shdr_dioff, i, shdr_dent_szB),
+ sizeof(a_shdr));
+ if (di->rodata_present &&
+ 0 == ML_(img_strcmp_c)(dimg, shdr_strtab_dioff
+ + a_shdr.sh_name, ".rodata")) {
+ Word sh_size = a_shdr.sh_size;
+ Word j;
+ Word next_addr = a_shdr.sh_addr + a_shdr.sh_size;
+ for (j = i + 1; j < shnum; ++j) {
+ ML_(img_get)(&a_extra_shdr, dimg,
+ INDEX_BIS(shdr_dioff, j, shdr_dent_szB),
+ sizeof(a_shdr));
+ if (0 == ML_(img_strcmp_n)(dimg, shdr_strtab_dioff
+ + a_extra_shdr.sh_name, ".rodata", 7)) {
+ if (a_extra_shdr.sh_addr ==
+ VG_ROUNDUP(next_addr, a_extra_shdr.sh_addralign)) {
+ sh_size = VG_ROUNDUP(sh_size, a_extra_shdr.sh_addralign) + a_extra_shdr.sh_size;
+ }
+ next_addr = a_extra_shdr.sh_addr + a_extra_shdr.sh_size;
+ } else {
+ break;
+ }
+ }
+ vg_assert(di->rodata_size == sh_size);
+ vg_assert(di->rodata_avma + a_shdr.sh_addr + rw_dbias);
+ di->rodata_debug_svma = a_shdr.sh_addr;
+ di->rodata_debug_bias = di->rodata_bias +
+ di->rodata_svma - di->rodata_debug_svma;
+ TRACE_SYMTAB("acquiring .rodata debug svma = %#lx .. %#lx\n",
+ di->rodata_debug_svma,
+ di->rodata_debug_svma + di->rodata_size - 1);
+ TRACE_SYMTAB("acquiring .rodata debug bias = %#lx\n", (UWord)di->rodata_debug_bias);
+ }
+}
Bool ML_(read_elf_debug) ( struct _DebugInfo* di )
{
Word i, j;
@@ -3391,7 +3430,11 @@ Bool ML_(read_elf_debug) ( struct _DebugInfo* di )
FIND(text, rx)
FIND(data, rw)
FIND(sdata, rw)
- FIND(rodata, rw)
+ // https://bugs.kde.org/show_bug.cgi?id=476548
+ // special handling for rodata as adjacent
+ // rodata sections may have been merged in ML_(read_elf_object)
+ //FIND(rodata, rw)
+ find_rodata(i, ehdr_dimg.e_shnum, dimg, di, shdr_dioff, shdr_dent_szB, shdr_strtab_dioff, rw_dbias);
FIND(bss, rw)
FIND(sbss, rw)

@ -0,0 +1,54 @@
--- valgrind-3.8.1/cachegrind/cg_sim.c.jj 2011-10-26 23:24:32.000000000 +0200
+++ valgrind-3.8.1/cachegrind/cg_sim.c 2011-12-09 17:31:19.256023683 +0100
@@ -42,27 +42,30 @@ typedef struct {
Int size; /* bytes */
Int assoc;
Int line_size; /* bytes */
- Int sets;
Int sets_min_1;
Int line_size_bits;
Int tag_shift;
- HChar desc_line[128]; /* large enough */
UWord* tags;
-} cache_t2;
+ HChar desc_line[128];
+} cache_t2
+#ifdef __GNUC__
+__attribute__ ((aligned (8 * sizeof (Int))))
+#endif
+;
/* By this point, the size/assoc/line_size has been checked. */
static void cachesim_initcache(cache_t config, cache_t2* c)
{
- Int i;
+ Int sets;
c->size = config.size;
c->assoc = config.assoc;
c->line_size = config.line_size;
- c->sets = (c->size / c->line_size) / c->assoc;
- c->sets_min_1 = c->sets - 1;
+ sets = (c->size / c->line_size) / c->assoc;
+ c->sets_min_1 = sets - 1;
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",
@@ -72,11 +75,8 @@ static void cachesim_initcache(cache_t c
c->size, c->line_size, c->assoc);
}
- c->tags = VG_(malloc)("cg.sim.ci.1",
- sizeof(UWord) * c->sets * c->assoc);
-
- for (i = 0; i < c->sets * c->assoc; i++)
- c->tags[i] = 0;
+ c->tags = VG_(calloc)("cg.sim.ci.1",
+ sizeof(UWord), sets * c->assoc);
}
/* This attribute forces GCC to inline the function, getting rid of a

@ -0,0 +1,28 @@
--- valgrind/glibc-2.X.supp.in.jj 2011-10-26 23:24:45.000000000 +0200
+++ valgrind/glibc-2.X.supp.in 2012-05-07 10:55:20.395942656 +0200
@@ -124,7 +124,7 @@
glibc-2.5.x-on-SUSE-10.2-(PPC)-2a
Memcheck:Cond
fun:index
- obj:*ld-@GLIBC_VERSION@.*.so
+ obj:*ld-@GLIBC_VERSION@*.so
}
{
glibc-2.5.x-on-SuSE-10.2-(PPC)-2b
@@ -136,14 +136,14 @@
glibc-2.5.5-on-SuSE-10.2-(PPC)-2c
Memcheck:Addr4
fun:index
- obj:*ld-@GLIBC_VERSION@.*.so
+ obj:*ld-@GLIBC_VERSION@*.so
}
{
glibc-2.3.5-on-SuSE-10.1-(PPC)-3
Memcheck:Addr4
fun:*wordcopy_fwd_dest_aligned*
fun:mem*cpy
- obj:*lib*@GLIBC_VERSION@.*.so
+ obj:*lib*@GLIBC_VERSION@*.so
}
{

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save