<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 01/11/2024 16:16, Martin Frb via
fpc-pascal wrote:<br>
</div>
<blockquote type="cite"
cite="mid:b16b3460-38fb-41be-91fb-5b3055896c70@mfriebe.de">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">On 01/11/2024 15:59, Henry Vermaak
via fpc-pascal wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAOVzLrfbbnMZnDz6+VDQKNiH08YESaX+8=y=sogQKD=MEPmaSg@mail.gmail.com">
<pre wrap="" class="moz-quote-pre">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.
</pre>
</blockquote>
</blockquote>
<br>
Ok, I misread that.<br>
<br>
Thinking you change it to O2 for one of the builds only...<br>
<br>
------------<br>
Another factor could be that debug info affects smartlinking. Or
leaves symbols for the linker in sections that are shared with
non-debug info.<br>
<br>
But I don't know either of that.<br>
<br>
Afaik external debug info is created at the end by using objcopy or
similar to split the one big exe.<br>
<br>
In theory therefore, debug info could have created symbols in
sections used by the linker, and left behind.<br>
Also debug info may in the worst case have referred code and
prevented smart linking.<br>
<br>
Again, neither of those are know by me.<br>
</body>
</html>