|
@@ -263,8 +263,8 @@ implementation
|
|
|
procedure AddImport(const afuncname,mangledname:string;ordnr:longint;isvar:boolean);
|
|
|
const
|
|
|
{$ifdef x86_64}
|
|
|
- jmpopcode : array[0..2] of byte = (
|
|
|
- $ff,$24,$25
|
|
|
+ jmpopcode : array[0..1] of byte = (
|
|
|
+ $ff,$25 // jmp qword [rip + offset32]
|
|
|
);
|
|
|
{$else x86_64}
|
|
|
{$ifdef arm}
|
|
@@ -367,7 +367,11 @@ implementation
|
|
|
else
|
|
|
implabel:=objdata.SymbolDefine(basedllname+'_index_'+tostr(ordnr),AB_GLOBAL,AT_FUNCTION);
|
|
|
objdata.writebytes(jmpopcode,sizeof(jmpopcode));
|
|
|
+{$ifdef x86_64}
|
|
|
+ objdata.writereloc(0,sizeof(longint),idata5label,RELOC_RELATIVE);
|
|
|
+{$else}
|
|
|
objdata.writereloc(0,sizeof(longint),idata5label,RELOC_ABSOLUTE32);
|
|
|
+{$endif x86_64}
|
|
|
objdata.writebytes(nopopcodes,align(objdata.CurrObjSec.size,sizeof(nopopcodes))-objdata.CurrObjSec.size);
|
|
|
end;
|
|
|
ObjOutput.exportsymbol(implabel);
|
|
@@ -519,6 +523,10 @@ implementation
|
|
|
current_asmdata.asmlists[al_imports].concat(tai_const.create_sym_offset(href.symbol,href.offset));
|
|
|
{$else ARM}
|
|
|
reference_reset_symbol(href,l4,0,sizeof(pint));
|
|
|
+{$ifdef X86_64}
|
|
|
+ href.base:=NR_RIP;
|
|
|
+{$endif X86_64}
|
|
|
+
|
|
|
current_asmdata.asmlists[al_imports].concat(Taicpu.Op_ref(A_JMP,S_NO,href));
|
|
|
current_asmdata.asmlists[al_imports].concat(Tai_align.Create_op(4,$90));
|
|
|
{$endif ARM}
|