1 | /* |
---|
2 | * COPYRIGHT (c) 2016, 2018 Chris Johns <chrisj@rtems.org> |
---|
3 | * |
---|
4 | * The license and distribution terms for this file may be |
---|
5 | * found in the file LICENSE in this distribution or at |
---|
6 | * http://www.rtems.org/license/LICENSE. |
---|
7 | */ |
---|
8 | /** |
---|
9 | * @file |
---|
10 | * |
---|
11 | * @ingroup rtems_rtl |
---|
12 | * |
---|
13 | * @brief RTEMS Run-Time Linker Unwind DWARF Support. |
---|
14 | */ |
---|
15 | |
---|
16 | #if !defined (_RTEMS_RTL_UNWIND_DW2_H_) |
---|
17 | #define _RTEMS_RTL_UNWIND_DW2_H_ |
---|
18 | |
---|
19 | #include "rtl-elf.h" |
---|
20 | |
---|
21 | #ifdef __cplusplus |
---|
22 | extern "C" { |
---|
23 | #endif /* __cplusplus */ |
---|
24 | |
---|
25 | #if __SIZEOF_LONG__ >= __SIZEOF_POINTER__ |
---|
26 | typedef long rtems_rtl_elf_unwind_dw2_sleb128; |
---|
27 | typedef unsigned long rtems_rtl_elf_unwind_dw2_uleb128; |
---|
28 | #elif __SIZEOF_LONG_LONG__ >= __SIZEOF_POINTER__ |
---|
29 | typedef long long rtems_rtl_elf_unwind_dw2_sleb128; |
---|
30 | typedef unsigned long long rtems_rtl_elf_unwind_dw2_uleb128; |
---|
31 | #else |
---|
32 | #error No DW2 type available. |
---|
33 | #endif |
---|
34 | |
---|
35 | /** |
---|
36 | * Architecture specific handler to check if a section contains exception |
---|
37 | * handler data.. |
---|
38 | * |
---|
39 | * @param obj The object file. |
---|
40 | * @param name The section's name. |
---|
41 | * @param uint32 flags The object file's flags. |
---|
42 | * @retval true The section contains unwind information. |
---|
43 | * @retval false The section does not contain unwind information. |
---|
44 | */ |
---|
45 | bool rtems_rtl_elf_unwind_dw2_parse (const rtems_rtl_obj* obj, |
---|
46 | const char* name, |
---|
47 | uint32_t flags); |
---|
48 | |
---|
49 | /** |
---|
50 | * Architecture specific handler to add an object file's unwind information to |
---|
51 | * the base image. |
---|
52 | * |
---|
53 | * @param obj The object file. |
---|
54 | * @retval true The unwind information has been registered. |
---|
55 | * @retval false The unwind information could not be registered. |
---|
56 | */ |
---|
57 | bool rtems_rtl_elf_unwind_dw2_register (const rtems_rtl_obj* obj); |
---|
58 | |
---|
59 | /** |
---|
60 | * Architecture specific handler to remove an object file's unwind information |
---|
61 | * from the base image. |
---|
62 | * |
---|
63 | * @param obj The object file. |
---|
64 | * @retval true The unwind information has been deregistered. |
---|
65 | * @retval false The unwind information could not be deregistered. |
---|
66 | */ |
---|
67 | bool rtems_rtl_elf_unwind_dw2_deregister (const rtems_rtl_obj* obj); |
---|
68 | |
---|
69 | /** |
---|
70 | * Read signed and unsigned LEB128 values. |
---|
71 | */ |
---|
72 | const uint8_t* rtems_rtl_elf_unwind_dw2_read_uleb128 (const uint8_t* data, |
---|
73 | rtems_rtl_elf_unwind_dw2_uleb128* val); |
---|
74 | const uint8_t* rtems_rtl_elf_unwind_dw2_read_sleb128 (const uint8_t* data, |
---|
75 | rtems_rtl_elf_unwind_dw2_sleb128* val); |
---|
76 | |
---|
77 | bool rtems_rtl_elf_unwind_dw2_relocate (const Elf_Addr* where, Elf_Word value, Elf_Word mask); |
---|
78 | |
---|
79 | #ifdef __cplusplus |
---|
80 | } |
---|
81 | #endif /* __cplusplus */ |
---|
82 | |
---|
83 | #endif |
---|