diff --git a/compiler/powerpc/cgcpu.pas b/compiler/powerpc/cgcpu.pas index 5c8563d1de..ccff16f6af 100644 --- a/compiler/powerpc/cgcpu.pas +++ b/compiler/powerpc/cgcpu.pas @@ -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 diff --git a/compiler/powerpc/rappcgas.pas b/compiler/powerpc/rappcgas.pas index 1a3ca2a518..742ebb414f 100644 --- a/compiler/powerpc/rappcgas.pas +++ b/compiler/powerpc/rappcgas.pas @@ -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; diff --git a/compiler/ppcgen/cgppc.pas b/compiler/ppcgen/cgppc.pas index 08ab945d6b..d5eaddd103 100644 --- a/compiler/ppcgen/cgppc.pas +++ b/compiler/ppcgen/cgppc.pas @@ -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