diff options
author | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2021-03-10 20:55:37 +0000 |
---|---|---|
committer | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2021-03-10 20:55:37 +0000 |
commit | 7fe61e020d946c74c55895443deb3eaa15fb3954 (patch) | |
tree | 3d54cba6049bfa2bc112f4816ec0319f520d931c | |
parent | a8deedbaaba064a38434474e0d6e2ee8e19a586f (diff) | |
download | fpc-7fe61e020d946c74c55895443deb3eaa15fb3954.tar.gz |
* RiscV: basic CFI stuff fixed
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@48937 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | compiler/cfidwarf.pas | 7 | ||||
-rw-r--r-- | compiler/systems/i_linux.pas | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/compiler/cfidwarf.pas b/compiler/cfidwarf.pas index ddc3a13000..fd5ff4c4dd 100644 --- a/compiler/cfidwarf.pas +++ b/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(0)); 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} { if more cpu dependend stuff is implemented, this needs more refactoring } procedure TDwarfAsmCFILowLevel.generate_initial_instructions(list:TAsmList); diff --git a/compiler/systems/i_linux.pas b/compiler/systems/i_linux.pas index a6e3e4f00b..ac384ebd0d 100644 --- a/compiler/systems/i_linux.pas +++ b/compiler/systems/i_linux.pas @@ -1107,7 +1107,7 @@ unit i_linux; system : system_riscv32_linux; name : 'Linux for RISC-V 32'; 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_requires_proper_alignment,tf_has_winlike_resources, tf_supports_hidden_symbols]; @@ -1144,7 +1144,7 @@ unit i_linux; linkextern : ld_linux; ar : ar_gnu_ar; res : res_elf; - dbg : dbg_dwarf2; + dbg : dbg_dwarf3; script : script_unix; endian : endian_little; alignment : @@ -1177,7 +1177,7 @@ unit i_linux; system : system_riscv64_linux; name : 'Linux for RISC-V 64'; 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_requires_proper_alignment,tf_has_winlike_resources, tf_supports_hidden_symbols @@ -1215,7 +1215,7 @@ unit i_linux; linkextern : ld_linux; ar : ar_gnu_ar; res : res_elf; - dbg : dbg_dwarf2; + dbg : dbg_dwarf3; script : script_unix; endian : endian_little; alignment : |