| Petr Machata | 50b9603 | 2012-03-24 04:56:52 +0100 | [diff] [blame] | 1 | #ifndef LTRACE_PPC_ARCH_H |
| 2 | #define LTRACE_PPC_ARCH_H |
| 3 | |
| 4 | #include <gelf.h> |
| 5 | |
| Juan Cespedes | 5bfb061 | 2002-03-31 20:01:28 +0200 | [diff] [blame] | 6 | #define BREAKPOINT_VALUE { 0x7f, 0xe0, 0x00, 0x08 } |
| Juan Cespedes | f1bfe20 | 2002-03-27 00:22:23 +0100 | [diff] [blame] | 7 | #define BREAKPOINT_LENGTH 4 |
| 8 | #define DECR_PC_AFTER_BREAK 0 |
| Juan Cespedes | d914a20 | 2004-11-10 00:15:33 +0100 | [diff] [blame] | 9 | |
| 10 | #define LT_ELFCLASS ELFCLASS32 |
| 11 | #define LT_ELF_MACHINE EM_PPC |
| Petr Machata | b3f8fef | 2006-11-30 14:45:07 +0100 | [diff] [blame] | 12 | |
| Paul Gilliam | 76c61f1 | 2006-06-14 06:55:21 +0200 | [diff] [blame] | 13 | #ifdef __powerpc64__ // Says 'ltrace' is 64 bits, says nothing about target. |
| Ian Wienand | 9a2ad35 | 2006-02-20 22:44:45 +0100 | [diff] [blame] | 14 | #define LT_ELFCLASS2 ELFCLASS64 |
| 15 | #define LT_ELF_MACHINE2 EM_PPC64 |
| Petr Machata | b3f8fef | 2006-11-30 14:45:07 +0100 | [diff] [blame] | 16 | #define ARCH_SUPPORTS_OPD |
| Petr Machata | 7003fee | 2006-07-18 13:06:26 +0200 | [diff] [blame] | 17 | #endif |
| Ian Wienand | 9a2ad35 | 2006-02-20 22:44:45 +0100 | [diff] [blame] | 18 | |
| Paul Gilliam | be32077 | 2006-04-24 22:06:23 +0200 | [diff] [blame] | 19 | #define PLT_REINITALISATION_BP "_start" |
| Ian Wienand | 9a2ad35 | 2006-02-20 22:44:45 +0100 | [diff] [blame] | 20 | |
| Luis Machado | 55c5feb | 2008-03-12 15:56:01 +0100 | [diff] [blame] | 21 | #define ARCH_HAVE_UMOVELONG |
| Petr Machata | a266acb | 2012-04-12 23:50:23 +0200 | [diff] [blame] | 22 | #define ARCH_HAVE_ATOMIC_SINGLESTEP |
| Petr Machata | 50b9603 | 2012-03-24 04:56:52 +0100 | [diff] [blame] | 23 | #define ARCH_HAVE_ADD_PLT_ENTRY |
| Petr Machata | 644d669 | 2012-03-24 02:06:48 +0100 | [diff] [blame] | 24 | #define ARCH_HAVE_LTELF_DATA |
| Petr Machata | b64b5c7 | 2012-03-27 03:19:42 +0200 | [diff] [blame] | 25 | #define ARCH_HAVE_BREAKPOINT_DATA |
| 26 | #define ARCH_HAVE_LIBRARY_SYMBOL_DATA |
| Petr Machata | 50b9603 | 2012-03-24 04:56:52 +0100 | [diff] [blame] | 27 | |
| 28 | struct library_symbol; |
| Petr Machata | e67635d | 2012-03-21 03:37:39 +0100 | [diff] [blame] | 29 | struct arch_ltelf_data { |
| Petr Machata | e67635d | 2012-03-21 03:37:39 +0100 | [diff] [blame] | 30 | GElf_Addr plt_stub_vma; |
| Petr Machata | 4e2073f | 2012-03-21 05:15:44 +0100 | [diff] [blame] | 31 | int secure_plt; |
| Petr Machata | 50b9603 | 2012-03-24 04:56:52 +0100 | [diff] [blame] | 32 | struct library_symbol *stubs; |
| Petr Machata | e67635d | 2012-03-21 03:37:39 +0100 | [diff] [blame] | 33 | }; |
| Petr Machata | 50b9603 | 2012-03-24 04:56:52 +0100 | [diff] [blame] | 34 | |
| Petr Machata | b64b5c7 | 2012-03-27 03:19:42 +0200 | [diff] [blame] | 35 | enum 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 | |
| 49 | struct arch_library_symbol_data { |
| 50 | enum ppc64_plt_type type; |
| Petr Machata | 58b2d0f | 2012-03-28 02:19:20 +0200 | [diff] [blame^] | 51 | GElf_Addr resolved_value; |
| 52 | |
| 53 | /* Address of corresponding slot in .plt. */ |
| 54 | GElf_Addr plt_slot_addr; |
| Petr Machata | b64b5c7 | 2012-03-27 03:19:42 +0200 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | struct arch_breakpoint_data { |
| 58 | }; |
| 59 | |
| Petr Machata | 50b9603 | 2012-03-24 04:56:52 +0100 | [diff] [blame] | 60 | #endif /* LTRACE_PPC_ARCH_H */ |