Преглед на файлове

* only use ".set" directive when creating dwarf relsyms on darwin and
not for other relsyms, as older versions of the darwin assembler
don't understand the ".set" directive (mantis #10541)

git-svn-id: trunk@9621 -

Jonas Maebe преди 17 години
родител
ревизия
db6e60789b
променени са 3 файла, в които са добавени 32 реда и са изтрити 9 реда
  1. 16 1
      compiler/aasmtai.pas
  2. 8 6
      compiler/aggas.pas
  3. 8 2
      compiler/dbgdwarf.pas

+ 16 - 1
compiler/aasmtai.pas

@@ -96,7 +96,22 @@ interface
           aitconst_rva_symbol,
           aitconst_secrel32_symbol,
           { darwin only }
-          aitconst_indirect_symbol
+          aitconst_indirect_symbol,
+          { From gcc/config/darwin.c (darwin_asm_output_dwarf_delta):
+            ***
+            Output a difference of two labels that will be an assembly time
+            constant if the two labels are local.  (.long lab1-lab2 will be
+            very different if lab1 is at the boundary between two sections; it
+            will be relocated according to the second section, not the first,
+            so one ends up with a difference between labels in different
+            sections, which is bad in the dwarf2 eh context for instance.)
+            ***
+            We cannot use this everywhere, because older versions of the
+            darwin assembler don't support the construct used for these
+            relsyms (nor do they support dwarf, for that matter)
+          }
+          aitconst_darwin_dwarf_delta64,
+          aitconst_darwin_dwarf_delta32
         );
 
     const

+ 8 - 6
compiler/aggas.pas

@@ -205,10 +205,10 @@ implementation
 
 
     const
-      ait_const2str : array[aitconst_128bit..aitconst_indirect_symbol] of string[20]=(
+      ait_const2str : array[aitconst_128bit..aitconst_darwin_dwarf_delta32] of string[20]=(
         #9'.fixme128'#9,#9'.quad'#9,#9'.long'#9,#9'.short'#9,#9'.byte'#9,
         #9'.sleb128'#9,#9'.uleb128'#9,
-        #9'.rva'#9,#9'.secrel32'#9,#9'.indirect_symbol'#9
+        #9'.rva'#9,#9'.secrel32'#9,#9'.indirect_symbol'#9,#9'.quad'#9,#9'.long'#9
       );
 
 {****************************************************************************}
@@ -695,10 +695,12 @@ implementation
                  aitconst_8bit,
                  aitconst_rva_symbol,
                  aitconst_secrel32_symbol,
-                 aitconst_indirect_symbol :
+                 aitconst_indirect_symbol,
+                 aitconst_darwin_dwarf_delta32,
+                 aitconst_darwin_dwarf_delta64:
                    begin
                      if (target_info.system in systems_darwin) and
-                        (tai_const(hp).consttype in [aitconst_uleb128bit,aitconst_sleb128bit]) then
+                        (constdef in [aitconst_uleb128bit,aitconst_sleb128bit]) then
                        begin
                          AsmWrite(ait_const2str[aitconst_8bit]);
                          case tai_const(hp).consttype of
@@ -710,7 +712,7 @@ implementation
                        end
                      else
                        begin
-                         AsmWrite(ait_const2str[tai_const(hp).consttype]);
+                         AsmWrite(ait_const2str[constdef]);
                          l:=0;
                          t := '';
                          repeat
@@ -718,7 +720,7 @@ implementation
                              begin
                                if assigned(tai_const(hp).endsym) then
                                  begin
-                                   if (target_info.system in systems_darwin) then
+                                   if (constdef in [aitconst_darwin_dwarf_delta32,aitconst_darwin_dwarf_delta64]) then
                                      begin
                                        s := NextSetLabel;
                                        t := #9'.set '+s+','+tai_const(hp).endsym.name+'-'+tai_const(hp).sym.name;

+ 8 - 2
compiler/dbgdwarf.pas

@@ -643,11 +643,17 @@ implementation
                offsetabstype:=aitconst_secrel32_symbol
              else
                offsetabstype:=aitconst_32bit;
-             offsetreltype:=aitconst_32bit;
+             if (target_info.system in systems_darwin) then
+                offsetreltype:=aitconst_darwin_dwarf_delta32
+              else
+                offsetreltype:=aitconst_32bit;
            end
          else
            begin
-             offsetreltype:=aitconst_64bit;
+             if (target_info.system in systems_darwin) then
+                offsetreltype:=aitconst_darwin_dwarf_delta64
+             else
+               offsetreltype:=aitconst_64bit;
              offsetabstype:=aitconst_64bit;
            end;
       end;