* on AIX, functions are called via function descriptors whose name

is '.' followed by the function symbol name (like on linux/ppc64)

git-svn-id: trunk@20796 -
This commit is contained in:
Jonas Maebe 2012-04-11 18:01:21 +00:00
parent 4123df9cb8
commit b738657bf3
3 changed files with 23 additions and 6 deletions

View File

@ -181,14 +181,24 @@ const
{ MacOS: The linker on MacOS (PPCLink) inserts a call to glue code,
if it is a cross-TOC call. If so, it also replaces the NOP
with some restore code.}
if (target_info.system <> system_powerpc_darwin) then
if (target_info.system<>system_powerpc_darwin) then
begin
if not(weak) then
list.concat(taicpu.op_sym(A_BL,current_asmdata.RefAsmSymbol(s)))
if target_info.system<>system_powerpc_aix then
begin
if not(weak) then
list.concat(taicpu.op_sym(A_BL,current_asmdata.RefAsmSymbol(s)))
else
list.concat(taicpu.op_sym(A_BL,current_asmdata.WeakRefAsmSymbol(s)));
end
else
list.concat(taicpu.op_sym(A_BL,current_asmdata.WeakRefAsmSymbol(s)));
begin
if not(weak) then
list.concat(taicpu.op_sym(A_BL,current_asmdata.RefAsmSymbol('.'+s)))
else
list.concat(taicpu.op_sym(A_BL,current_asmdata.WeakRefAsmSymbol('.'+s)));
end;
if target_info.system=system_powerpc_macos then
if target_info.system in [system_powerpc_macos,system_powerpc_aix] then
list.concat(taicpu.op_none(A_NOP));
end
else

View File

@ -752,6 +752,11 @@ Unit rappcgas;
(instr.Operands[1].opr.ref.index<>NR_NO) then
Message(asmr_e_syn_operand);
end;
{ regular name is toc entry, .-based name is actual code }
if (target_info.system in (systems_aix+[system_powerpc64_linux])) and
(instr.Operands[1].opr.typ = OPR_SYMBOL) and
(instr.Operands[1].opr.symbol.typ=AT_FUNCTION) then
instr.Operands[1].opr.symbol:=current_asmdata.DefineAsmSymbol('.'+instr.Operands[1].opr.symbol.name,instr.Operands[1].opr.symbol.bind,AT_FUNCTION);
end;

View File

@ -779,7 +779,9 @@ unit cgppc;
system_powerpc_darwin,
system_powerpc64_darwin:
list.concat(taicpu.op_sym(A_B,get_darwin_call_stub(procdef.mangledname,false)));
system_powerpc64_linux:
system_powerpc64_linux,
system_powerpc_aix,
system_powerpc64_aix:
{$note ts:todo add GOT change?? - think not needed :) }
list.concat(taicpu.op_sym(A_B,current_asmdata.RefAsmSymbol('.' + procdef.mangledname)));
else