|
1 | 1 | #include "arm_relocator.h"
|
2 |
| -#include "util/hex_write.h" |
3 | 2 |
|
4 | 3 | #include <algorithm>
|
5 | 4 |
|
| 5 | +#include "util/hex_write.h" |
| 6 | + |
| 7 | +#include "elfcpp/elfcpp.h" |
| 8 | +#include "elfcpp/arm.h" |
| 9 | + |
6 | 10 | namespace lyn {
|
7 | 11 |
|
8 | 12 | struct arm_data_abs32_reloc : public arm_relocator::relocatelet {
|
@@ -180,15 +184,15 @@ struct arm_arm_bl_reloc : public arm_arm_b_reloc {
|
180 | 184 | };
|
181 | 185 |
|
182 | 186 | arm_relocator::arm_relocator() {
|
183 |
| - mRelocatelets[0x02].reset(new arm_data_abs32_reloc); // R_ARM_ABS32 |
184 |
| - mRelocatelets[0x03].reset(new arm_data_rel32_reloc); // R_ARM_REL32 |
185 |
| - mRelocatelets[0x05].reset(new arm_data_abs16_reloc); // R_ARM_ABS16 |
186 |
| - mRelocatelets[0x06].reset(new arm_data_abs8_reloc); // R_ARM_ABS8 |
187 |
| - mRelocatelets[0x0A].reset(new arm_thumb_bl_reloc); // R_ARM_THM_CALL |
188 |
| - mRelocatelets[0x1C].reset(new arm_arm_bl_reloc); // R_ARM_CALL |
189 |
| - mRelocatelets[0x1D].reset(new arm_arm_b_reloc); // R_ARM_JUMP24 |
190 |
| - mRelocatelets[0x66].reset(new arm_thumb_b_reloc); // R_ARM_THM_JUMP11 |
191 |
| - mRelocatelets[0x67].reset(new arm_thumb_bcond_reloc); // R_ARM_THM_JUMP8 |
| 187 | + mRelocatelets[elfcpp::R_ARM_ABS32].reset(new arm_data_abs32_reloc); // R_ARM_ABS32 |
| 188 | + mRelocatelets[elfcpp::R_ARM_REL32].reset(new arm_data_rel32_reloc); // R_ARM_REL32 |
| 189 | + mRelocatelets[elfcpp::R_ARM_ABS16].reset(new arm_data_abs16_reloc); // R_ARM_ABS16 |
| 190 | + mRelocatelets[elfcpp::R_ARM_ABS8].reset(new arm_data_abs8_reloc); // R_ARM_ABS8 |
| 191 | + mRelocatelets[elfcpp::R_ARM_THM_CALL].reset(new arm_thumb_bl_reloc); // R_ARM_THM_CALL |
| 192 | + mRelocatelets[elfcpp::R_ARM_CALL].reset(new arm_arm_bl_reloc); // R_ARM_CALL |
| 193 | + mRelocatelets[elfcpp::R_ARM_JUMP24].reset(new arm_arm_b_reloc); // R_ARM_JUMP24 |
| 194 | + mRelocatelets[elfcpp::R_ARM_THM_JUMP11].reset(new arm_thumb_b_reloc); // R_ARM_THM_JUMP11 |
| 195 | + mRelocatelets[elfcpp::R_ARM_THM_JUMP8].reset(new arm_thumb_bcond_reloc); // R_ARM_THM_JUMP8 |
192 | 196 | }
|
193 | 197 |
|
194 | 198 | const arm_relocator::relocatelet* arm_relocator::get_relocatelet(int relocationIndex) const {
|
|
0 commit comments