* Always generate CFI-information. During linking it can be omitted when

no debug-information is requested. On Linux this needed a change in the
   linker-script. On Windows it already works as desired. Other targets
   may need some adjustments as well.
This commit is contained in:
Joost van der Sluis 2022-07-10 12:21:17 +02:00
parent 776c39dc0a
commit 3385ce92a2
2 changed files with 7 additions and 3 deletions

View File

@ -238,10 +238,12 @@ implementation
inherited;
if tf_use_psabieh in target_info.flags then
datatype:=dt_eh_frame
else if cs_debuginfo in current_settings.moduleswitches then
datatype:=dt_debug
else
datatype:=dt_none;
{ The CFI-information is always generated, regardless of the debug
settings. This way the CFI-information for units is always available
and during linking it can be omitted or not, based on the debug
settings. }
datatype:=dt_debug;
end;
{****************************************************************************

View File

@ -715,6 +715,8 @@ begin
add(' {');
add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
add(' }');
if not ((cs_debuginfo in current_settings.moduleswitches)) then
add(' /DISCARD/ : {*(.debug_frame)}');
add(' .threadvar : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }');
add('}');
{ this "INSERT" means "merge into the original linker script, even if