RO Elf program headers

Paul Floyd pjfloyd at wanadoo.fr
Sun Feb 23 15:31:34 UTC 2020


Hi

I’ve been working on getting Valgrind to work again on FreeBSD.

Probably the biggest problem at the moment is that Valgrind doesn’t (yet) handle the read-only program headers.

If I run “readelf -l libc++.so.1.0” on Linux I see two LOAD headers, the first one “R E” (read-execute) and the second one “RW” (read-write). If I do the same on FreeBSD then I see a third program header which is “R” (read-only), before the other two.

My questions are
- Does anyone know when this extra header was added? (I assume that it was added sometime in the past 5 years or so)
- What is in these segments, and is it safe to assume that multiple shared libraries can map the same RO content to the same address?

A+
Paul


More information about the freebsd-toolchain mailing list