]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD: only set osrel for executables.
authorPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 9 May 2022 05:49:56 +0000 (07:49 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 9 May 2022 05:49:56 +0000 (07:49 +0200)
coregrind/m_debuginfo/readelf.c

index c586e3f3329db53c63aa97274d43b606a3ddb23b..998bc08fabd1fd2394bed6abac9b5e37a453d940 100644 (file)
@@ -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