patchelf icon indicating copy to clipboard operation
patchelf copied to clipboard

adding an RPATH makes it impossible to extract the GNU Build ID from a core dump

Open calminghydra opened this issue 1 year ago • 0 comments

Adding an RPATH to an executable without an RPATH moves the elf note segment containing the GNU Build ID to the end of the file. This renders it impossible to extract the Build ID from a core dump as it is no longer loaded into process memory. This note segment corresponds to the section .note.gnu.build-id and is deliberately placed at the beginning of the elf file. It is still contained in the binary and can be extracted with tools like readelf, but it will not be loaded into process memory and is therefore not part of a core dump.

I don't care about other elf notes, only this one. Among other tools, gdb has debuginfod support and can download executables and debug symbols if the Build ID can be extracted from a core dump.

calminghydra avatar Jul 09 '24 15:07 calminghydra