In modern linux almost all objects are stripped and splitted in two parts (two files). First is executable itself and second is debug symbols, stripped out from original ELF. Such files are created with
objcopy --only-keep-debug original.elf binary.dbg
mv original.elf binary
objcopy --strip-debug binary
How can I merge binary
and binary.dbg
into ELF file with debugging info? I want to recreate unstripped, original binary. It can be not byte-to-byte equal to the original, but it must to have a debug symbols inside.
PS Yes, I know about gnu.debuglink
section, but it doesn't work for some debuggers (etnus) and disassemblers (objdump can't restore symbols info)
eu-unstrip
combine stripped files with separate symbols and debug information." and this is homepage fedorahosted.org/elfutils and this is source git.fedorahosted.org/cgit/elfutils.git/tree/src/unstrip.c "Combine stripped files with separate symbols and debug information. Copyright (C) 2007-2012, 2014, 2015 Red Hat, Inc...Roland McGrath". If I have "program.bin" as normal stripped ELF, and "program.dbg" with only debug info, how should I starteu-unstrip
and which file will be changed? – Ebeneser