mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 04:59:20 +02:00
* create proper external stubs in case of generating pic
git-svn-id: trunk@3713 -
This commit is contained in:
parent
2bf89e2040
commit
24ab8e0177
@ -1957,6 +1957,9 @@ implementation
|
|||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
procedure gen_external_stub(list:TAsmList;pd:tprocdef;const externalname:string);
|
procedure gen_external_stub(list:TAsmList;pd:tprocdef;const externalname:string);
|
||||||
|
var
|
||||||
|
ref : treference;
|
||||||
|
sym : tasmsymbol;
|
||||||
begin
|
begin
|
||||||
{ add the procedure to the al_procedures }
|
{ add the procedure to the al_procedures }
|
||||||
maybe_new_object_file(list);
|
maybe_new_object_file(list);
|
||||||
@ -1966,7 +1969,22 @@ implementation
|
|||||||
list.concat(Tai_symbol.createname_global(pd.mangledname,AT_FUNCTION,0))
|
list.concat(Tai_symbol.createname_global(pd.mangledname,AT_FUNCTION,0))
|
||||||
else
|
else
|
||||||
list.concat(Tai_symbol.createname(pd.mangledname,AT_FUNCTION,0));
|
list.concat(Tai_symbol.createname(pd.mangledname,AT_FUNCTION,0));
|
||||||
cg.a_jmp_name(list,externalname);
|
|
||||||
|
sym:=current_asmdata.RefAsmSymbol(externalname);
|
||||||
|
reference_reset_symbol(ref,sym,0);
|
||||||
|
|
||||||
|
{ create pic'ed? }
|
||||||
|
if cs_create_pic in aktmoduleswitches then
|
||||||
|
begin
|
||||||
|
{ it could be that we're called from a procedure not having the
|
||||||
|
got loaded
|
||||||
|
}
|
||||||
|
gen_got_load(list);
|
||||||
|
ref.refaddr:=addr_pic;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
ref.refaddr:=addr_full;
|
||||||
|
list.concat(taicpu.op_ref(A_JMP,S_NO,ref));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user