arch.h revision 58b2d0fd5deed5f33fbd47a6b6e5c109f43908b5
1#ifndef LTRACE_PPC_ARCH_H 2#define LTRACE_PPC_ARCH_H 3 4#include <gelf.h> 5 6#define BREAKPOINT_VALUE { 0x7f, 0xe0, 0x00, 0x08 } 7#define BREAKPOINT_LENGTH 4 8#define DECR_PC_AFTER_BREAK 0 9 10#define LT_ELFCLASS ELFCLASS32 11#define LT_ELF_MACHINE EM_PPC 12 13#ifdef __powerpc64__ // Says 'ltrace' is 64 bits, says nothing about target. 14#define LT_ELFCLASS2 ELFCLASS64 15#define LT_ELF_MACHINE2 EM_PPC64 16#define ARCH_SUPPORTS_OPD 17#endif 18 19#define PLT_REINITALISATION_BP "_start" 20 21#define ARCH_HAVE_UMOVELONG 22#define ARCH_HAVE_ATOMIC_SINGLESTEP 23#define ARCH_HAVE_ADD_PLT_ENTRY 24#define ARCH_HAVE_LTELF_DATA 25#define ARCH_HAVE_BREAKPOINT_DATA 26#define ARCH_HAVE_LIBRARY_SYMBOL_DATA 27 28struct library_symbol; 29struct arch_ltelf_data { 30 GElf_Addr plt_stub_vma; 31 int secure_plt; 32 struct library_symbol *stubs; 33}; 34 35enum ppc64_plt_type { 36 /* STUB, never resolved. */ 37 PPC64PLT_STUB, 38 39 /* Unresolved PLT symbol (.plt contains PLT address). */ 40 PPC64PLT_UNRESOLVED, 41 42 /* Resolved PLT symbol. The corresponding .plt slot contained 43 * target address, which was changed to the address of 44 * corresponding PLT entry. The original is now saved in 45 * orig_addr. */ 46 PPC64PLT_RESOLVED, 47}; 48 49struct arch_library_symbol_data { 50 enum ppc64_plt_type type; 51 GElf_Addr resolved_value; 52 53 /* Address of corresponding slot in .plt. */ 54 GElf_Addr plt_slot_addr; 55}; 56 57struct arch_breakpoint_data { 58}; 59 60#endif /* LTRACE_PPC_ARCH_H */ 61