浏览代码

+ implemented writing of dwarf debug info (by calling writeDebugElf) in
TMZExeOutput.writeData. Note that writing i8086 debug info with the internal
linker is still disabled (i.e. it switches to external linking) in
options.TOption.checkoptionscompatibility

git-svn-id: trunk@39219 -

nickysn 7 年之前
父节点
当前提交
c56ebad183
共有 1 个文件被更改,包括 17 次插入5 次删除
  1. 17 5
      compiler/ogomf.pas

+ 17 - 5
compiler/ogomf.pas

@@ -2978,10 +2978,22 @@ cleanup:
 
     function TMZExeOutput.writeData: boolean;
       begin
-        if apptype=app_com then
-          Result:=WriteCom
-        else
-          Result:=WriteExe;
+        Result:=False;
+        if ExeWriteMode in [ewm_exefull,ewm_exeonly] then
+          begin
+            if apptype=app_com then
+              Result:=WriteCom
+            else
+              Result:=WriteExe;
+            if not Result then
+              exit;
+          end;
+        if ((cs_debuginfo in current_settings.moduleswitches) and
+            (target_dbg.id in [dbg_dwarf2,dbg_dwarf3,dbg_dwarf4])) and
+           ((ExeWriteMode=ewm_dbgonly) or
+            ((ExeWriteMode=ewm_exefull) and
+              not(cs_link_strip in current_settings.globalswitches))) then
+          Result:=writeDebugElf;
       end;
 
     constructor TMZExeOutput.create;
@@ -3028,7 +3040,7 @@ cleanup:
             asmbin : '';
             asmcmd : '';
             supported_targets : [system_i8086_msdos,system_i8086_embedded];
-            flags : [af_outputbinary,af_no_debug,af_smartlink_sections];
+            flags : [af_outputbinary,af_smartlink_sections];
             labelprefix : '..@';
             comment : '; ';
             dollarsign: '$';