浏览代码

* only generate a big obj COFF file if the high bound of the sections is larger than $7fff (it could be that the final count is smaller again as sections that have the same name are combined)

git-svn-id: trunk@35409 -
svenbarth 8 年之前
父节点
当前提交
ca11a4baaa
共有 1 个文件被更改,包括 15 次插入1 次删除
  1. 15 1
      compiler/assemble.pas

+ 15 - 1
compiler/assemble.pas

@@ -894,6 +894,19 @@ Implementation
 
 
     function TExternalAssembler.MakeCmdLine: TCmdStr;
+
+      function section_high_bound:longint;
+        var
+          alt : tasmlisttype;
+        begin
+          result:=0;
+          for alt:=low(tasmlisttype) to high(tasmlisttype) do
+            result:=result+current_asmdata.asmlists[alt].section_count;
+        end;
+
+      const
+        min_big_obj_section_count = $7fff;
+
       begin
         result:=asminfo^.asmcmd;
         { for Xcode 7.x and later }
@@ -944,7 +957,8 @@ Implementation
          { as we don't keep track of the amount of sections we created we simply
            enable Big Obj COFF files always for targets that need them }
          if (cs_asm_pre_binutils_2_25 in current_settings.globalswitches) or
-            not (target_info.system in systems_all_windows+systems_nativent-[system_i8086_win16]) then
+            not (target_info.system in systems_all_windows+systems_nativent-[system_i8086_win16]) or
+            (section_high_bound<min_big_obj_section_count) then
            Replace(result,'$BIGOBJ','')
          else
            Replace(result,'$BIGOBJ','-mbig-obj');