Explorar o código

* RiscV: basic CFI stuff fixed

git-svn-id: trunk@48937 -
florian %!s(int64=4) %!d(string=hai) anos
pai
achega
577e584c77
Modificáronse 2 ficheiros con 11 adicións e 4 borrados
  1. 7 0
      compiler/cfidwarf.pas
  2. 4 4
      compiler/systems/i_linux.pas

+ 7 - 0
compiler/cfidwarf.pas

@@ -301,6 +301,13 @@ implementation
         list.concat(tai_const.create_uleb128bit(dwarf_reg(NR_STACK_POINTER_REG)));
         list.concat(tai_const.create_uleb128bit(dwarf_reg(NR_STACK_POINTER_REG)));
         list.concat(tai_const.create_uleb128bit(0));
         list.concat(tai_const.create_uleb128bit(0));
       end;
       end;
+{$elseif defined(riscv)}
+    procedure TDwarfAsmCFILowLevel.generate_initial_instructions(list:TAsmList);
+      begin
+        list.concat(tai_const.create_8bit(DW_CFA_def_cfa));
+        list.concat(tai_const.create_uleb128bit(dwarf_reg(NR_STACK_POINTER_REG)));
+        list.concat(tai_const.create_uleb128bit(0));
+      end;
 {$else}
 {$else}
     { if more cpu dependend stuff is implemented, this needs more refactoring }
     { if more cpu dependend stuff is implemented, this needs more refactoring }
     procedure TDwarfAsmCFILowLevel.generate_initial_instructions(list:TAsmList);
     procedure TDwarfAsmCFILowLevel.generate_initial_instructions(list:TAsmList);

+ 4 - 4
compiler/systems/i_linux.pas

@@ -1107,7 +1107,7 @@ unit i_linux;
             system       : system_riscv32_linux;
             system       : system_riscv32_linux;
             name         : 'Linux for RISC-V 32';
             name         : 'Linux for RISC-V 32';
             shortname    : 'Linux';
             shortname    : 'Linux';
-            flags        : [tf_needs_symbol_size,tf_smartlink_sections,
+            flags        : [tf_needs_symbol_size,tf_smartlink_sections,tf_needs_dwarf_cfi,
                             tf_needs_symbol_type,tf_files_case_sensitive,
                             tf_needs_symbol_type,tf_files_case_sensitive,
                             tf_requires_proper_alignment,tf_has_winlike_resources,
                             tf_requires_proper_alignment,tf_has_winlike_resources,
                             tf_supports_hidden_symbols];
                             tf_supports_hidden_symbols];
@@ -1144,7 +1144,7 @@ unit i_linux;
             linkextern   : ld_linux;
             linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
-            dbg          : dbg_dwarf2;
+            dbg          : dbg_dwarf3;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
@@ -1177,7 +1177,7 @@ unit i_linux;
             system       : system_riscv64_linux;
             system       : system_riscv64_linux;
             name         : 'Linux for RISC-V 64';
             name         : 'Linux for RISC-V 64';
             shortname    : 'Linux';
             shortname    : 'Linux';
-            flags        : [tf_needs_symbol_size,tf_smartlink_sections,
+            flags        : [tf_needs_symbol_size,tf_smartlink_sections,tf_needs_dwarf_cfi,
                             tf_needs_symbol_type,tf_files_case_sensitive,
                             tf_needs_symbol_type,tf_files_case_sensitive,
                             tf_requires_proper_alignment,tf_has_winlike_resources,
                             tf_requires_proper_alignment,tf_has_winlike_resources,
                             tf_supports_hidden_symbols
                             tf_supports_hidden_symbols
@@ -1215,7 +1215,7 @@ unit i_linux;
             linkextern   : ld_linux;
             linkextern   : ld_linux;
             ar           : ar_gnu_ar;
             ar           : ar_gnu_ar;
             res          : res_elf;
             res          : res_elf;
-            dbg          : dbg_dwarf2;
+            dbg          : dbg_dwarf3;
             script       : script_unix;
             script       : script_unix;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :