From a13c9d93ff845a2ee25225332e6ae014f1a9a5c2 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Mon, 17 Sep 2012 22:30:16 +0000 Subject: [PATCH] * create new object file when creating new section for ansistring/ unicodestring constants so they can be smartlinked away on platforms using library-based smartlinking (mantis #22888) git-svn-id: trunk@22417 - --- compiler/asmutils.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/asmutils.pas b/compiler/asmutils.pas index af3c0c713f..1b1a676b87 100644 --- a/compiler/asmutils.pas +++ b/compiler/asmutils.pas @@ -60,7 +60,10 @@ uses current_asmdata.getdatalabel(result.lab); result.ofs:=0; if NewSection then - new_section(list,sec_rodata,result.lab.name,const_align(sizeof(pint))); + begin + maybe_new_object_file(list); + new_section(list,sec_rodata,result.lab.name,const_align(sizeof(pint))); + end; { put label before header on Darwin, because there the linker considers a global symbol to be the start of a new subsection } if target_info.system in systems_darwin then @@ -101,6 +104,7 @@ uses begin current_asmdata.getdatalabel(result.lab); result.ofs:=0; + maybe_new_object_file(list); new_section(list,sec_rodata,result.lab.name,const_align(sizeof(pint))); strlength := getlengthwidestring(pcompilerwidestring(data)); if Winlike then