|
From: Paul F. <pa...@so...> - 2022-05-09 05:50:42
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=407c00c2e9ef2bf3e87412d01e8ebc7baefbe8ef commit 407c00c2e9ef2bf3e87412d01e8ebc7baefbe8ef Author: Paul Floyd <pj...@wa...> Date: Mon May 9 07:49:56 2022 +0200 FreeBSD: only set osrel for executables. Diff: --- coregrind/m_debuginfo/readelf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c index c586e3f332..998bc08fab 100644 --- a/coregrind/m_debuginfo/readelf.c +++ b/coregrind/m_debuginfo/readelf.c @@ -1147,6 +1147,12 @@ void read_and_set_osrel(DiImage* img) ElfXX_Ehdr ehdr; ML_(img_get)(&ehdr, img, 0, sizeof(ehdr)); + + /* only set osrel for executable files, not for subsequent shared libraries */ + if (ehdr.e_type != ET_EXEC) { + return; + } + /* Skip the phdrs when we have to search the shdrs. In separate .debug files the phdrs might not be valid (they are a copy of the main ELF file) and might trigger assertions when getting |