[fpc-pascal] Separate debug info for release builds

Henry Vermaak henry.vermaak at gmail.com
Fri Nov 1 15:59:13 CET 2024


When I add -Xg, the compiler writes the debug info into a separate
.dbg file and adds a .gnu_debuglink section so the debugger can find
the info.  So far so good (and simpler than having the use objcopy).

The size of the binary is much larger than building without debug
info, though.  E.g. with -O2 it goes from 35K to 188K.

When I do exactly the same with gcc (via objcopy and strip), there's
almost no difference between the stripped binary and a binary built
without debugging info (even diffing objdump output).

Can anyone explain why this is?

Henry


More information about the fpc-pascal mailing list