On 01/11/2024 16:16, Martin Frb via fpc-pascal wrote:
On 01/11/2024 15:59, Henry Vermaak via fpc-pascal wrote:
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.


Ok, I misread that.

Thinking you change it to O2 for one of the builds only...

------------
Another factor could be that debug info affects smartlinking. Or leaves symbols for the linker in sections that are shared with non-debug info.

But I don't know either of that.

Afaik external debug info is created at the end by using objcopy or similar to split the one big exe.

In theory therefore, debug info could have created symbols in sections used by the linker, and left behind. Also debug info may in the worst case have referred code and prevented smart linking.

Again, neither of those are know by me.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to