Op 05-07-2022 om 23:45 schreef Sven Barth via fpc-devel:
Joost van der Sluis via fpc-devel <fpc-devel@lists.freepascal.org <mailto:fpc-devel@lists.freepascal.org>> schrieb am Di., 5. Juli 2022, 22:37:

I think many people would be glad if you'd solve the issue of smart linking with debug information when an external linker is used. :)

That's easy. See the attachment (Linux only). The results are similar as gcc produces. Apparently ld does not regard references in debug-sections as real references, and replaces them with 0-addresses. Just like our internal linker on Windows does.

I don't dare to push it, though. Because:

1: Someone disabled this because some older version of LD cannot handle it. Maybe some version we use still use on some targets/systems?

2: Someone disabled this because of some corner-case we now don't know of anymore.

Does anyone have some more information?

Regards,

Joost
diff --git a/compiler/options.pas b/compiler/options.pas
index 75d7f6f255..64022a722b 100644
--- a/compiler/options.pas
+++ b/compiler/options.pas
@@ -3870,7 +3870,7 @@ procedure TOption.checkoptionscompatibility;
 {$endif i8086_link_intern_debuginfo}
 
   if (paratargetdbg in [dbg_dwarf2,dbg_dwarf3]) and
-     not(target_info.system in (systems_darwin+[system_i8086_msdos,system_i8086_embedded])) then
+     not(target_info.system in (systems_darwin+systems_linux+[system_i8086_msdos,system_i8086_embedded])) then
     begin
       { smartlink creation does not yet work with DWARF
         debug info on most targets, but it works in internal assembler }

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to