|
@@ -3257,30 +3257,33 @@ implementation
|
|
flist : TFPList;
|
|
flist : TFPList;
|
|
dbgname : String;
|
|
dbgname : String;
|
|
begin
|
|
begin
|
|
- { insert DEBUGSTART and DEBUGEND labels }
|
|
|
|
- dbgname:=make_mangledname('DEBUGSTART',current_module.localsymtable,'');
|
|
|
|
- { Darwin's linker does not like two global labels both pointing to the
|
|
|
|
- end of a section, which can happen in case of units without code ->
|
|
|
|
- make them local; we don't need the debugtable stuff there either,
|
|
|
|
- so it doesn't matter that they are not global.
|
|
|
|
- }
|
|
|
|
- if (target_info.system in systems_darwin) then
|
|
|
|
- dbgname:='L'+dbgname;
|
|
|
|
- new_section(current_asmdata.asmlists[al_start],sec_code,dbgname,0,secorder_begin);
|
|
|
|
- if not(target_info.system in systems_darwin) then
|
|
|
|
- current_asmdata.asmlists[al_start].concat(tai_symbol.Createname_global(dbgname,AT_METADATA,0,voidpointertype))
|
|
|
|
- else
|
|
|
|
- current_asmdata.asmlists[al_start].concat(tai_symbol.Createname(dbgname,AT_METADATA,0,voidpointertype));
|
|
|
|
|
|
+ if not (target_info.system in systems_wasm) then
|
|
|
|
+ begin
|
|
|
|
+ { insert DEBUGSTART and DEBUGEND labels }
|
|
|
|
+ dbgname:=make_mangledname('DEBUGSTART',current_module.localsymtable,'');
|
|
|
|
+ { Darwin's linker does not like two global labels both pointing to the
|
|
|
|
+ end of a section, which can happen in case of units without code ->
|
|
|
|
+ make them local; we don't need the debugtable stuff there either,
|
|
|
|
+ so it doesn't matter that they are not global.
|
|
|
|
+ }
|
|
|
|
+ if (target_info.system in systems_darwin) then
|
|
|
|
+ dbgname:='L'+dbgname;
|
|
|
|
+ new_section(current_asmdata.asmlists[al_start],sec_code,dbgname,0,secorder_begin);
|
|
|
|
+ if not(target_info.system in systems_darwin) then
|
|
|
|
+ current_asmdata.asmlists[al_start].concat(tai_symbol.Createname_global(dbgname,AT_METADATA,0,voidpointertype))
|
|
|
|
+ else
|
|
|
|
+ current_asmdata.asmlists[al_start].concat(tai_symbol.Createname(dbgname,AT_METADATA,0,voidpointertype));
|
|
|
|
|
|
- dbgname:=make_mangledname('DEBUGEND',current_module.localsymtable,'');
|
|
|
|
- { See above. }
|
|
|
|
- if (target_info.system in systems_darwin) then
|
|
|
|
- dbgname:='L'+dbgname;
|
|
|
|
- new_section(current_asmdata.asmlists[al_end],sec_code,dbgname,0,secorder_end);
|
|
|
|
- if not(target_info.system in systems_darwin) then
|
|
|
|
- current_asmdata.asmlists[al_end].concat(tai_symbol.Createname_global(dbgname,AT_METADATA,0,voidpointertype))
|
|
|
|
- else
|
|
|
|
- current_asmdata.asmlists[al_end].concat(tai_symbol.Createname(dbgname,AT_METADATA,0,voidpointertype));
|
|
|
|
|
|
+ dbgname:=make_mangledname('DEBUGEND',current_module.localsymtable,'');
|
|
|
|
+ { See above. }
|
|
|
|
+ if (target_info.system in systems_darwin) then
|
|
|
|
+ dbgname:='L'+dbgname;
|
|
|
|
+ new_section(current_asmdata.asmlists[al_end],sec_code,dbgname,0,secorder_end);
|
|
|
|
+ if not(target_info.system in systems_darwin) then
|
|
|
|
+ current_asmdata.asmlists[al_end].concat(tai_symbol.Createname_global(dbgname,AT_METADATA,0,voidpointertype))
|
|
|
|
+ else
|
|
|
|
+ current_asmdata.asmlists[al_end].concat(tai_symbol.Createname(dbgname,AT_METADATA,0,voidpointertype));
|
|
|
|
+ end;
|
|
|
|
|
|
{ insert .Ldebug_abbrev0 label }
|
|
{ insert .Ldebug_abbrev0 label }
|
|
templist:=TAsmList.create;
|
|
templist:=TAsmList.create;
|
|
@@ -3575,19 +3578,27 @@ implementation
|
|
if (m_objectivec1 in current_settings.modeswitches) then
|
|
if (m_objectivec1 in current_settings.modeswitches) then
|
|
append_attribute(DW_AT_APPLE_major_runtime_vers,DW_FORM_data1,[1]);
|
|
append_attribute(DW_AT_APPLE_major_runtime_vers,DW_FORM_data1,[1]);
|
|
|
|
|
|
- dbgname:=make_mangledname('DEBUGSTART',current_module.localsymtable,'');
|
|
|
|
- if (target_info.system in systems_darwin) then
|
|
|
|
|
|
+ if target_info.system in systems_wasm then
|
|
begin
|
|
begin
|
|
- bind:=AB_LOCAL;
|
|
|
|
- dbgname:='L'+dbgname;
|
|
|
|
|
|
+ append_attribute(DW_AT_low_pc,DW_FORM_data4,[0]);
|
|
|
|
+ { todo: append DW_AT_ranges }
|
|
end
|
|
end
|
|
else
|
|
else
|
|
- bind:=AB_GLOBAL;
|
|
|
|
- append_labelentry(DW_AT_low_pc,current_asmdata.DefineAsmSymbol(dbgname,bind,AT_METADATA,voidpointertype));
|
|
|
|
- dbgname:=make_mangledname('DEBUGEND',current_module.localsymtable,'');
|
|
|
|
- if (target_info.system in systems_darwin) then
|
|
|
|
- dbgname:='L'+dbgname;
|
|
|
|
- append_labelentry(DW_AT_high_pc,current_asmdata.DefineAsmSymbol(dbgname,bind,AT_METADATA,voidpointertype));
|
|
|
|
|
|
+ begin
|
|
|
|
+ dbgname:=make_mangledname('DEBUGSTART',current_module.localsymtable,'');
|
|
|
|
+ if (target_info.system in systems_darwin) then
|
|
|
|
+ begin
|
|
|
|
+ bind:=AB_LOCAL;
|
|
|
|
+ dbgname:='L'+dbgname;
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ bind:=AB_GLOBAL;
|
|
|
|
+ append_labelentry(DW_AT_low_pc,current_asmdata.DefineAsmSymbol(dbgname,bind,AT_METADATA,voidpointertype));
|
|
|
|
+ dbgname:=make_mangledname('DEBUGEND',current_module.localsymtable,'');
|
|
|
|
+ if (target_info.system in systems_darwin) then
|
|
|
|
+ dbgname:='L'+dbgname;
|
|
|
|
+ append_labelentry(DW_AT_high_pc,current_asmdata.DefineAsmSymbol(dbgname,bind,AT_METADATA,voidpointertype));
|
|
|
|
+ end;
|
|
|
|
|
|
finish_entry;
|
|
finish_entry;
|
|
|
|
|
|
@@ -3671,7 +3682,7 @@ implementation
|
|
begin
|
|
begin
|
|
{ Reference all DEBUGINFO sections from the main .fpc section }
|
|
{ Reference all DEBUGINFO sections from the main .fpc section }
|
|
{ to prevent eliminating them by smartlinking }
|
|
{ to prevent eliminating them by smartlinking }
|
|
- if (target_info.system in ([system_powerpc_macosclassic]+systems_darwin)) then
|
|
|
|
|
|
+ if (target_info.system in ([system_powerpc_macosclassic]+systems_darwin+systems_wasm)) then
|
|
exit;
|
|
exit;
|
|
new_section(list,sec_fpc,'links',0);
|
|
new_section(list,sec_fpc,'links',0);
|
|
|
|
|