| skipped 25 lines |
26 | 26 | | #include "ELF/DataHandler/Node.hpp" |
27 | 27 | | #include "ELF/DataHandler/Handler.hpp" |
28 | 28 | | |
| 29 | + | #include "internal_utils.hpp" |
| 30 | + | |
29 | 31 | | #include <numeric> |
30 | 32 | | |
31 | 33 | | #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) |
| skipped 25 lines |
57 | 59 | | case Relocation::TYPE::ARM_GLOB_DAT: |
58 | 60 | | case Relocation::TYPE::ARM_IRELATIVE: |
59 | 61 | | { |
60 | | - | LIEF_DEBUG("Patch addend of {}", relocation); |
| 62 | + | LIEF_DEBUG("Patch addend of {}", to_string(relocation)); |
61 | 63 | | patch_addend<uint32_t>(relocation, from, shift); |
62 | 64 | | break; |
63 | 65 | | } |
| skipped 28 lines |
92 | 94 | | case Relocation::TYPE::AARCH64_IRELATIVE: |
93 | 95 | | case Relocation::TYPE::AARCH64_ABS64: |
94 | 96 | | { |
95 | | - | LIEF_DEBUG("Patch addend of {}", relocation); |
| 97 | + | LIEF_DEBUG("Patch addend of {}", to_string(relocation)); |
96 | 98 | | patch_addend<uint64_t>(relocation, from, shift); |
97 | 99 | | break; |
98 | 100 | | } |
99 | 101 | | |
100 | 102 | | case Relocation::TYPE::AARCH64_ABS32: |
101 | 103 | | { |
102 | | - | LIEF_DEBUG("Patch addend of {}", relocation); |
| 104 | + | LIEF_DEBUG("Patch addend of {}", to_string(relocation)); |
103 | 105 | | patch_addend<uint32_t>(relocation, from, shift); |
104 | 106 | | break; |
105 | 107 | | } |
106 | 108 | | |
107 | 109 | | case Relocation::TYPE::AARCH64_ABS16: |
108 | 110 | | { |
109 | | - | LIEF_DEBUG("Patch addend of {}", relocation); |
| 111 | + | LIEF_DEBUG("Patch addend of {}", to_string(relocation)); |
110 | 112 | | patch_addend<uint16_t>(relocation, from, shift); |
111 | 113 | | break; |
112 | 114 | | } |
113 | 115 | | |
114 | 116 | | case Relocation::TYPE::AARCH64_PREL64: |
115 | 117 | | { |
116 | | - | LIEF_DEBUG("Patch addend of {}", relocation); |
| 118 | + | LIEF_DEBUG("Patch addend of {}", to_string(relocation)); |
117 | 119 | | patch_addend<uint64_t>(relocation, from, shift); |
118 | 120 | | break; |
119 | 121 | | } |
120 | 122 | | |
121 | 123 | | case Relocation::TYPE::AARCH64_PREL32: |
122 | 124 | | { |
123 | | - | LIEF_DEBUG("Patch addend of {}", relocation); |
| 125 | + | LIEF_DEBUG("Patch addend of {}", to_string(relocation)); |
124 | 126 | | patch_addend<uint32_t>(relocation, from, shift); |
125 | 127 | | break; |
126 | 128 | | } |
127 | 129 | | |
128 | 130 | | case Relocation::TYPE::AARCH64_PREL16: |
129 | 131 | | { |
130 | | - | LIEF_DEBUG("Patch addend of {}", relocation); |
| 132 | + | LIEF_DEBUG("Patch addend of {}", to_string(relocation)); |
131 | 133 | | patch_addend<uint16_t>(relocation, from, shift); |
132 | 134 | | break; |
133 | 135 | | } |
| skipped 26 lines |
160 | 162 | | case Relocation::TYPE::X86_GLOB_DAT: |
161 | 163 | | case Relocation::TYPE::X86_32: |
162 | 164 | | { |
163 | | - | LIEF_DEBUG("Patch addend of {}", relocation); |
| 165 | + | LIEF_DEBUG("Patch addend of {}", to_string(relocation)); |
164 | 166 | | patch_addend<uint32_t>(relocation, from, shift); |
165 | 167 | | break; |
166 | 168 | | } |
| skipped 32 lines |
199 | 201 | | case Relocation::TYPE::X86_64_GLOB_DAT: |
200 | 202 | | case Relocation::TYPE::X86_64_64: |
201 | 203 | | { |
202 | | - | LIEF_DEBUG("Patch addend of {}", relocation); |
| 204 | + | LIEF_DEBUG("Patch addend of {}", to_string(relocation)); |
203 | 205 | | patch_addend<uint64_t>(relocation, from, shift); |
204 | 206 | | break; |
205 | 207 | | } |
206 | 208 | | |
207 | 209 | | case Relocation::TYPE::X86_64_32: |
208 | 210 | | { |
209 | | - | LIEF_DEBUG("Patch addend of {}", relocation); |
| 211 | + | LIEF_DEBUG("Patch addend of {}", to_string(relocation)); |
210 | 212 | | patch_addend<uint32_t>(relocation, from, shift); |
211 | 213 | | break; |
212 | 214 | | } |
| skipped 22 lines |
235 | 237 | | switch (type) { |
236 | 238 | | case Relocation::TYPE::PPC_RELATIVE: |
237 | 239 | | { |
238 | | - | LIEF_DEBUG("Patch addend of {}", relocation); |
| 240 | + | LIEF_DEBUG("Patch addend of {}", to_string(relocation)); |
239 | 241 | | patch_addend<uint32_t>(relocation, from, shift); |
240 | 242 | | break; |
241 | 243 | | } |
| skipped 36 lines |
278 | 280 | | } |
279 | 281 | | |
280 | 282 | | if (relative_offset >= segment_size || (relative_offset + sizeof(T)) > segment_size) { |
281 | | - | LIEF_DEBUG("Offset out of bound for relocation: {}", relocation); |
| 283 | + | LIEF_DEBUG("Offset out of bound for relocation: {}", to_string(relocation)); |
282 | 284 | | return; |
283 | 285 | | } |
284 | 286 | | |
| skipped 369 lines |