Browse Source

* only start a new object file for typed const data if we are instructed
to start a new section (no smart linking in the middle of section data)

git-svn-id: branches/hlcgllvm@28325 -

Jonas Maebe 11 years ago
parent
commit
5144a0d1e6
1 changed files with 4 additions and 2 deletions
  1. 4 2
      compiler/aasmcnst.pas

+ 4 - 2
compiler/aasmcnst.pas

@@ -404,11 +404,13 @@ implementation
        prelist: tasmlist;
        prelist: tasmlist;
      begin
      begin
        prelist:=tasmlist.create_without_marker;
        prelist:=tasmlist.create_without_marker;
-       maybe_new_object_file(prelist);
        { only now add items based on the symbolname, because it may be
        { only now add items based on the symbolname, because it may be
          modified by the "section" specifier in case of a typed constant }
          modified by the "section" specifier in case of a typed constant }
        if section<>sec_none then
        if section<>sec_none then
-         new_section(prelist,section,secname,const_align(alignment));
+         begin
+           maybe_new_object_file(prelist);
+           new_section(prelist,section,secname,const_align(alignment));
+         end;
        if not lab then
        if not lab then
          if sym.bind=AB_GLOBAL then
          if sym.bind=AB_GLOBAL then
            prelist.concat(tai_symbol.Create_Global(sym,0))
            prelist.concat(tai_symbol.Create_Global(sym,0))