From 9d4e322cd0c917d22d751fa31bae9234c310ec56 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Sat, 19 Mar 2016 12:29:21 +0000 Subject: [PATCH] Add AT_FUNCTION or AT_DATA to calls to (Weak)RefAsmSymbol. powerpc-macos needs them. git-svn-id: trunk@33287 - --- compiler/ncgcnv.pas | 4 ++-- compiler/ncgld.pas | 12 ++++++------ compiler/powerpc/cgcpu.pas | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/compiler/ncgcnv.pas b/compiler/ncgcnv.pas index e8215b31b5..b9a135681b 100644 --- a/compiler/ncgcnv.pas +++ b/compiler/ncgcnv.pas @@ -295,7 +295,7 @@ interface begin { FPC_EMPTYCHAR is a widechar -> 2 bytes } reference_reset(hr,2); - hr.symbol:=current_asmdata.RefAsmSymbol('FPC_EMPTYCHAR'); + hr.symbol:=current_asmdata.RefAsmSymbol('FPC_EMPTYCHAR',AT_DATA); location.register:=hlcg.getaddressregister(current_asmdata.CurrAsmList,resultdef); hlcg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,cwidechartype,resultdef,hr,location.register); end @@ -680,7 +680,7 @@ interface hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,resultdef,OC_NE,0,location.register,l1); { FPC_EMPTYCHAR is a widechar -> 2 bytes } reference_reset(hr,2); - hr.symbol:=current_asmdata.RefAsmSymbol('FPC_EMPTYCHAR'); + hr.symbol:=current_asmdata.RefAsmSymbol('FPC_EMPTYCHAR',AT_DATA); hlcg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,cwidechartype,resultdef,hr,location.register); hlcg.a_label(current_asmdata.CurrAsmList,l1); end; diff --git a/compiler/ncgld.pas b/compiler/ncgld.pas index e5b39ae3eb..a028711923 100644 --- a/compiler/ncgld.pas +++ b/compiler/ncgld.pas @@ -392,7 +392,7 @@ implementation toaddr : generate_absaddr_access(tabsolutevarsym(symtableentry)); toasm : - location.reference.symbol:=current_asmdata.RefAsmSymbol(tabsolutevarsym(symtableentry).mangledname); + location.reference.symbol:=current_asmdata.RefAsmSymbol(tabsolutevarsym(symtableentry).mangledname,AT_DATA); else internalerror(200310283); end; @@ -422,9 +422,9 @@ implementation begin hregister:=cg.getaddressregister(current_asmdata.CurrAsmList); if not(vo_is_weak_external in gvs.varoptions) then - location.reference.symbol:=current_asmdata.RefAsmSymbol(tstaticvarsym(symtableentry).mangledname) + location.reference.symbol:=current_asmdata.RefAsmSymbol(tstaticvarsym(symtableentry).mangledname,AT_DATA) else - location.reference.symbol:=current_asmdata.WeakRefAsmSymbol(tstaticvarsym(symtableentry).mangledname); + location.reference.symbol:=current_asmdata.WeakRefAsmSymbol(tstaticvarsym(symtableentry).mangledname,AT_DATA); cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,location.reference,hregister); reference_reset_base(location.reference,hregister,0,location.reference.alignment); end @@ -590,7 +590,7 @@ implementation else begin { load address of the function } - reference_reset_symbol(href,current_asmdata.RefAsmSymbol(procdef.mangledname),0,procdef.address_type.alignment); + reference_reset_symbol(href,current_asmdata.RefAsmSymbol(procdef.mangledname,AT_FUNCTION),0,procdef.address_type.alignment); location.register:=hlcg.getaddressregister(current_asmdata.CurrAsmList,cprocvardef.getreusableprocaddr(procdef)); hlcg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,procdef,cprocvardef.getreusableprocaddr(procdef),href,location.register); end; @@ -610,9 +610,9 @@ implementation { def_cgsize does not work for tprocdef, so we use pd.address_type } location.size:=def_cgsize(pd.address_type); if not(po_weakexternal in pd.procoptions) then - location.reference.symbol:=current_asmdata.RefAsmSymbol(procdef.mangledname) + location.reference.symbol:=current_asmdata.RefAsmSymbol(procdef.mangledname,AT_FUNCTION) else - location.reference.symbol:=current_asmdata.WeakRefAsmSymbol(procdef.mangledname); + location.reference.symbol:=current_asmdata.WeakRefAsmSymbol(procdef.mangledname,AT_FUNCTION); end; end; labelsym : diff --git a/compiler/powerpc/cgcpu.pas b/compiler/powerpc/cgcpu.pas index 70d31a1fda..91033613ff 100644 --- a/compiler/powerpc/cgcpu.pas +++ b/compiler/powerpc/cgcpu.pas @@ -180,16 +180,16 @@ const if target_info.system<>system_powerpc_aix then begin if not(weak) then - list.concat(taicpu.op_sym(A_BL,current_asmdata.RefAsmSymbol(s))) + list.concat(taicpu.op_sym(A_BL,current_asmdata.RefAsmSymbol(s,AT_FUNCTION))) else - list.concat(taicpu.op_sym(A_BL,current_asmdata.WeakRefAsmSymbol(s))); + list.concat(taicpu.op_sym(A_BL,current_asmdata.WeakRefAsmSymbol(s,AT_FUNCTION))); end else begin if not(weak) then - list.concat(taicpu.op_sym(A_BL,current_asmdata.RefAsmSymbol('.'+s))) + list.concat(taicpu.op_sym(A_BL,current_asmdata.RefAsmSymbol('.'+s,AT_FUNCTION))) else - list.concat(taicpu.op_sym(A_BL,current_asmdata.WeakRefAsmSymbol('.'+s))); + list.concat(taicpu.op_sym(A_BL,current_asmdata.WeakRefAsmSymbol('.'+s,AT_FUNCTION))); end; if target_info.system in [system_powerpc_macos,system_powerpc_aix] then