blob: 40e989a774c379abf846b49082352f12f9fc2168 [file] [log] [blame]
Petr Machata50b96032012-03-24 04:56:52 +01001#ifndef LTRACE_PPC_ARCH_H
2#define LTRACE_PPC_ARCH_H
3
4#include <gelf.h>
5
Juan Cespedes5bfb0612002-03-31 20:01:28 +02006#define BREAKPOINT_VALUE { 0x7f, 0xe0, 0x00, 0x08 }
Juan Cespedesf1bfe202002-03-27 00:22:23 +01007#define BREAKPOINT_LENGTH 4
8#define DECR_PC_AFTER_BREAK 0
Juan Cespedesd914a202004-11-10 00:15:33 +01009
10#define LT_ELFCLASS ELFCLASS32
11#define LT_ELF_MACHINE EM_PPC
Petr Machatab3f8fef2006-11-30 14:45:07 +010012
Paul Gilliam76c61f12006-06-14 06:55:21 +020013#ifdef __powerpc64__ // Says 'ltrace' is 64 bits, says nothing about target.
Ian Wienand9a2ad352006-02-20 22:44:45 +010014#define LT_ELFCLASS2 ELFCLASS64
15#define LT_ELF_MACHINE2 EM_PPC64
Petr Machatab3f8fef2006-11-30 14:45:07 +010016#define ARCH_SUPPORTS_OPD
Petr Machata7003fee2006-07-18 13:06:26 +020017#endif
Ian Wienand9a2ad352006-02-20 22:44:45 +010018
Paul Gilliambe320772006-04-24 22:06:23 +020019#define PLT_REINITALISATION_BP "_start"
Ian Wienand9a2ad352006-02-20 22:44:45 +010020
Luis Machado55c5feb2008-03-12 15:56:01 +010021#define ARCH_HAVE_UMOVELONG
Petr Machataa266acb2012-04-12 23:50:23 +020022#define ARCH_HAVE_ATOMIC_SINGLESTEP
Petr Machata50b96032012-03-24 04:56:52 +010023#define ARCH_HAVE_ADD_PLT_ENTRY
Petr Machata644d6692012-03-24 02:06:48 +010024#define ARCH_HAVE_LTELF_DATA
Petr Machatab64b5c72012-03-27 03:19:42 +020025#define ARCH_HAVE_BREAKPOINT_DATA
26#define ARCH_HAVE_LIBRARY_SYMBOL_DATA
Petr Machata50b96032012-03-24 04:56:52 +010027
28struct library_symbol;
Petr Machatae67635d2012-03-21 03:37:39 +010029struct arch_ltelf_data {
Petr Machatae67635d2012-03-21 03:37:39 +010030 GElf_Addr plt_stub_vma;
Petr Machata4e2073f2012-03-21 05:15:44 +010031 int secure_plt;
Petr Machata50b96032012-03-24 04:56:52 +010032 struct library_symbol *stubs;
Petr Machatae67635d2012-03-21 03:37:39 +010033};
Petr Machata50b96032012-03-24 04:56:52 +010034
Petr Machatab64b5c72012-03-27 03:19:42 +020035enum 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 orig_addr;
52};
53
54struct arch_breakpoint_data {
55};
56
Petr Machata50b96032012-03-24 04:56:52 +010057#endif /* LTRACE_PPC_ARCH_H */