summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-11-22 13:35:00 +0000
committersvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-11-22 13:35:00 +0000
commit38aa4790a7f7b70679f28ab42b8c72464a11afff (patch)
tree3766aa156023a1706a00bc00ef8670fdebfaca8d
parente02b34e500cdc49c049e1fef6df155b34910a716 (diff)
downloadfpc-38aa4790a7f7b70679f28ab42b8c72464a11afff.tar.gz
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: http://svn.freepascal.org/svn/fpc/branches/svenbarth@32492 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--packages/compiler/ngenutil.pas7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/compiler/ngenutil.pas b/packages/compiler/ngenutil.pas
index c9d8b2f8e3..a9b81d16f9 100644
--- a/packages/compiler/ngenutil.pas
+++ b/packages/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