Explorar o código

* prevent the DEBUGINFOTABLE from being dead stripped under darwin

git-svn-id: trunk@4615 -
Jonas Maebe %!s(int64=19) %!d(string=hai) anos
pai
achega
6894e03fb6
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      compiler/dbgstabs.pas

+ 8 - 0
compiler/dbgstabs.pas

@@ -1516,11 +1516,19 @@ implementation
     procedure tdebuginfostabs.referencesections(list:TAsmList);
       var
         hp : tmodule;
+        dbgtable : tai_symbol;
       begin
         { Reference all DEBUGINFO sections from the main .text section }
         if (target_info.system=system_powerpc_macos) then
           exit;
         list.concat(Tai_section.create(sec_data,'',0));
+        { make sure the debuginfo doesn't get stripped out }
+        if (target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
+          begin
+            dbgtable:=tai_symbol.createname('DEBUGINFOTABLE',AT_DATA,0);
+            list.concat(tai_directive.create(asd_no_dead_strip,dbgtable.sym.name));
+            list.concat(dbgtable);
+          end;
         { include reference to all debuginfo sections of used units }
         hp:=tmodule(loaded_units.first);
         while assigned(hp) do