On Mon, 2008-04-21 at 00:04 +0200, Carl-Daniel Hailfinger wrote:
Is there a way to strip out the debugging information from an image compiled with -g? I would like to have an image without debugging info, especially for the bootblock and initram because both are uncompressed and storing uncompressed debug info in a ROM is a total waste of space. The debugging info for each LAR member can be stored in a separate (always compressed) member.
There is the question of including the debug symbols in the ROM (compiler default), provided with the ROM in a separate file (put both in a .tgz for distribution from a website), or offering as a separate download. There's probably a use case for all 3, so configure/build option?
Debian/Ubuntu has separate -dbg packages for some things, which contain the debug symbol files. (separate from the .so libraries) The man page for "strip" suggests:
$ objcopy --only-keep-debug foo foo.dbg $ objcopy --strip-debug foo $ objcopy --add-gnu-debuglink=foo.dbg foo
By the way, the debugging info is similar to one of the pet projects I have: Providing a symbol file for the boot block, enabling people to build initram and stage2 against a given bootblock.
This sounds like a special case, but in general, "there's nothing new under the sun" and compilers/assemblers/linkers do this every day... wouldn't that just be a matter of providing the .o/.a object file and/or .h header file?