views:

90

answers:

0

Hello

In modern linux almost all objects are stripped and splitted in two parts. One - 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)