mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-07 23:06:11 +02:00
* properly fix #41161
This commit is contained in:
parent
5952c5452b
commit
835375e7e0
@ -235,6 +235,8 @@ interface
|
|||||||
of a dead-strippable data block, and references to such labels are
|
of a dead-strippable data block, and references to such labels are
|
||||||
also ignored to determine whether a data block should be live) }
|
also ignored to determine whether a data block should be live) }
|
||||||
procedure getlocaldatalabel(out l : TAsmLabel);
|
procedure getlocaldatalabel(out l : TAsmLabel);
|
||||||
|
{ data label visible within the current unit, if it's global or local depends if library based smartlinking is used }
|
||||||
|
procedure getdatalabel(out l: TAsmLabel);
|
||||||
{ generate an alternative (duplicate) symbol }
|
{ generate an alternative (duplicate) symbol }
|
||||||
procedure GenerateAltSymbol(p:TAsmSymbol);
|
procedure GenerateAltSymbol(p:TAsmSymbol);
|
||||||
procedure ResetAltSymbols;
|
procedure ResetAltSymbols;
|
||||||
@ -731,6 +733,15 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TAsmData.getdatalabel(out l : TAsmLabel);
|
||||||
|
begin
|
||||||
|
if create_smartlink_library then
|
||||||
|
getglobaldatalabel(l)
|
||||||
|
else
|
||||||
|
getlocaldatalabel(l);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TAsmData.getaddrlabel(out l : TAsmLabel);
|
procedure TAsmData.getaddrlabel(out l : TAsmLabel);
|
||||||
begin
|
begin
|
||||||
l:=TAsmLabel.createlocal(AsmSymbolDict,FNextLabelNr[alt_addr],alt_addr);
|
l:=TAsmLabel.createlocal(AsmSymbolDict,FNextLabelNr[alt_addr],alt_addr);
|
||||||
|
@ -134,10 +134,7 @@ implementation
|
|||||||
{ :-(, we must generate a new entry }
|
{ :-(, we must generate a new entry }
|
||||||
if not(assigned(lab_real)) then
|
if not(assigned(lab_real)) then
|
||||||
begin
|
begin
|
||||||
if create_smartlink_library then
|
current_asmdata.getdatalabel(lastlabel);
|
||||||
current_asmdata.getglobaldatalabel(lastlabel)
|
|
||||||
else
|
|
||||||
current_asmdata.getlocaldatalabel(lastlabel);
|
|
||||||
entry^.Data:=lastlabel;
|
entry^.Data:=lastlabel;
|
||||||
lab_real:=lastlabel;
|
lab_real:=lastlabel;
|
||||||
maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
|
maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
|
||||||
@ -324,7 +321,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
cst_shortstring:
|
cst_shortstring:
|
||||||
begin
|
begin
|
||||||
current_asmdata.getlocaldatalabel(lastlabel.lab);
|
current_asmdata.getdatalabel(lastlabel.lab);
|
||||||
|
|
||||||
{ truncate strings larger than 255 chars }
|
{ truncate strings larger than 255 chars }
|
||||||
if len>255 then
|
if len>255 then
|
||||||
@ -345,7 +342,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
cst_conststring:
|
cst_conststring:
|
||||||
begin
|
begin
|
||||||
current_asmdata.getlocaldatalabel(lastlabel.lab);
|
current_asmdata.getdatalabel(lastlabel.lab);
|
||||||
|
|
||||||
{ the data includes the terminating #0 because this
|
{ the data includes the terminating #0 because this
|
||||||
string can be used for pchar assignments (but it's
|
string can be used for pchar assignments (but it's
|
||||||
@ -406,7 +403,7 @@ implementation
|
|||||||
i: longint;
|
i: longint;
|
||||||
tcb: ttai_typedconstbuilder;
|
tcb: ttai_typedconstbuilder;
|
||||||
begin
|
begin
|
||||||
current_asmdata.getlocaldatalabel(lab);
|
current_asmdata.getdatalabel(lab);
|
||||||
result:=lab;
|
result:=lab;
|
||||||
lab_set:=lab;
|
lab_set:=lab;
|
||||||
tcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_make_dead_strippable,tcalo_apply_constalign]);
|
tcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_make_dead_strippable,tcalo_apply_constalign]);
|
||||||
@ -510,7 +507,7 @@ implementation
|
|||||||
{ :-(, we must generate a new entry }
|
{ :-(, we must generate a new entry }
|
||||||
if not assigned(entry^.Data) then
|
if not assigned(entry^.Data) then
|
||||||
begin
|
begin
|
||||||
current_asmdata.getlocaldatalabel(lastlabel);
|
current_asmdata.getdatalabel(lastlabel);
|
||||||
datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_make_dead_strippable,tcalo_apply_constalign]);
|
datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_make_dead_strippable,tcalo_apply_constalign]);
|
||||||
datatcb.emit_guid_const(value);
|
datatcb.emit_guid_const(value);
|
||||||
current_asmdata.asmlists[al_typedconsts].concatList(
|
current_asmdata.asmlists[al_typedconsts].concatList(
|
||||||
|
@ -412,7 +412,7 @@ implementation
|
|||||||
if it is 1 then we add 2**64 as float.
|
if it is 1 then we add 2**64 as float.
|
||||||
Since 2**64 can be represented exactly, use a single-precision
|
Since 2**64 can be represented exactly, use a single-precision
|
||||||
constant to save space. }
|
constant to save space. }
|
||||||
current_asmdata.getlocaldatalabel(l1);
|
current_asmdata.getdatalabel(l1);
|
||||||
current_asmdata.getjumplabel(l2);
|
current_asmdata.getjumplabel(l2);
|
||||||
if not(signtested) then
|
if not(signtested) then
|
||||||
begin
|
begin
|
||||||
|
@ -187,7 +187,7 @@ interface
|
|||||||
begin
|
begin
|
||||||
location_reset(location,LOC_MMREGISTER,def_cgsize(resultdef));
|
location_reset(location,LOC_MMREGISTER,def_cgsize(resultdef));
|
||||||
|
|
||||||
current_asmdata.getlocaldatalabel(l1);
|
current_asmdata.getdatalabel(l1);
|
||||||
new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,l1.name,const_align(16));
|
new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,l1.name,const_align(16));
|
||||||
current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(l1));
|
current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(l1));
|
||||||
case def_cgsize(resultdef) of
|
case def_cgsize(resultdef) of
|
||||||
|
@ -154,7 +154,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
current_asmdata.getlocaldatalabel(table);
|
current_asmdata.getdatalabel(table);
|
||||||
{ make it a 32bit register }
|
{ make it a 32bit register }
|
||||||
indexreg:=cg.makeregsize(current_asmdata.CurrAsmList,hregister,OS_INT);
|
indexreg:=cg.makeregsize(current_asmdata.CurrAsmList,hregister,OS_INT);
|
||||||
cg.a_load_reg_reg(current_asmdata.CurrAsmList,opcgsize,OS_INT,hregister,indexreg);
|
cg.a_load_reg_reg(current_asmdata.CurrAsmList,opcgsize,OS_INT,hregister,indexreg);
|
||||||
|
@ -110,7 +110,7 @@ implementation
|
|||||||
we load bits 0..62 and then check bit 63:
|
we load bits 0..62 and then check bit 63:
|
||||||
if it is 1 then we add $80000000 000000000
|
if it is 1 then we add $80000000 000000000
|
||||||
as double }
|
as double }
|
||||||
current_asmdata.getlocaldatalabel(l1);
|
current_asmdata.getdatalabel(l1);
|
||||||
current_asmdata.getjumplabel(l2);
|
current_asmdata.getjumplabel(l2);
|
||||||
|
|
||||||
{ Get sign bit }
|
{ Get sign bit }
|
||||||
|
Loading…
Reference in New Issue
Block a user