https://bugs.kde.org/show_bug.cgi?id=480405
--- Comment #15 from Paul Floyd <pjfl...@wanadoo.fr> --- (In reply to bugskde from comment #14) > This is a silly question: but it sort of sounds like Valgrind looks at any > mmap-opened file to see if it's a shared library (that is used by the > binary?). What if the file I'm opening happens to be a shared library that > is NOT used by the binary? Loading an executable binary doesn't just mmap the entire file. ELF (and macho on macOS) files are split into segments and sections. Segments like "NOTE" (info related to the OS and architecture) don't need to be mapped. It's only the LOAD segments that matter. And even then we aren't interested in the read-only segment as it should never be the source of errors. So there is complex code to determine when the read-write (global data) and read-execute (the program text) has been loaded. Once it's been determined that all RW and RX LOAD segments have been mmaped then we trigger reading any DWARF debuginfo. Platforms vary a lot in how they do this, and linkers keep coming up with tweaks to try to improve the memory layout and/or make the binary files smaller. -- You are receiving this mail because: You are watching all bug changes.