瀏覽代碼

For systems that support both internal and external resources (in this case only Darwin ones) we need to generate the FPC_RESLOCATION symbol always, because the SysInit unit is resource type agnostic.

ngenutil.pas, tnodeutils:
  * InsertResourceInfo: generate FPC_RESLOCATION symbol pointing to 0 in case the program is compiled on Darwin with resources set to external ones (-We)

git-svn-id: branches/svenbarth/packages@32492 -
svenbarth 9 年之前
父節點
當前提交
6bb43ac381
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      compiler/ngenutil.pas

+ 5 - 2
compiler/ngenutil.pas

@@ -964,14 +964,17 @@ implementation
     var
       ResourceInfo : TAsmList;
     begin
-      if (target_res.id in [res_elf,res_macho,res_xcoff]) then
+      if (target_res.id in [res_elf,res_macho,res_xcoff]) or
+         { generate the FPC_RESLOCATION symbol even when using external resources,
+           because in SysInit we can only reference it unconditionally }
+         ((target_res.id=res_ext) and (target_info.system in systems_darwin)) then
         begin
         ResourceInfo:=TAsmList.Create;
 
         maybe_new_object_file(ResourceInfo);
         new_section(ResourceInfo,sec_data,'FPC_RESLOCATION',sizeof(aint));
         ResourceInfo.concat(Tai_symbol.Createname_global('FPC_RESLOCATION',AT_DATA,0));
-        if ResourcesUsed then
+        if ResourcesUsed and (target_res.id<>res_ext) then
           { Valid pointer to resource information }
           ResourceInfo.concat(Tai_const.Createname('FPC_RESSYMBOL',0))
         else