Juan Cespedes | 1cd999a | 2001-07-03 00:46:04 +0200 | [diff] [blame] | 1 | #ifndef LTRACE_ELF_H |
| 2 | #define LTRACE_ELF_H |
| 3 | |
Juan Cespedes | d914a20 | 2004-11-10 00:15:33 +0100 | [diff] [blame] | 4 | #include <gelf.h> |
| 5 | #include <stdlib.h> |
| 6 | |
Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 7 | #include "ltrace.h" |
Juan Cespedes | 96935a9 | 1997-08-09 23:45:39 +0200 | [diff] [blame] | 8 | |
Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 9 | struct ltelf { |
| 10 | int fd; |
| 11 | Elf *elf; |
| 12 | GElf_Ehdr ehdr; |
| 13 | Elf_Data *dynsym; |
| 14 | size_t dynsym_count; |
| 15 | const char *dynstr; |
| 16 | GElf_Addr plt_addr; |
| 17 | size_t plt_size; |
| 18 | Elf_Data *relplt; |
| 19 | size_t relplt_count; |
| 20 | Elf_Data *symtab; |
| 21 | const char *strtab; |
| 22 | size_t symtab_count; |
| 23 | Elf_Data *opd; |
| 24 | GElf_Addr *opd_addr; |
| 25 | size_t opd_size; |
| 26 | Elf32_Word *hash; |
Petr Machata | 35fe518 | 2006-07-18 12:58:12 +0200 | [diff] [blame] | 27 | int hash_type; |
Paul Gilliam | 76c61f1 | 2006-06-14 06:55:21 +0200 | [diff] [blame] | 28 | int lte_flags; |
Juan Cespedes | 1cd999a | 2001-07-03 00:46:04 +0200 | [diff] [blame] | 29 | }; |
| 30 | |
Paul Gilliam | 76c61f1 | 2006-06-14 06:55:21 +0200 | [diff] [blame] | 31 | #define LTE_HASH_MALLOCED 1 |
| 32 | #define LTE_PLT_EXECUTABLE 2 |
| 33 | |
| 34 | #define PLTS_ARE_EXECUTABLE(lte) ((lte->lte_flags & LTE_PLT_EXECUTABLE) != 0) |
| 35 | |
Juan Cespedes | 1cd999a | 2001-07-03 00:46:04 +0200 | [diff] [blame] | 36 | extern int library_num; |
| 37 | extern char *library[MAX_LIBRARY]; |
Juan Cespedes | 1cd999a | 2001-07-03 00:46:04 +0200 | [diff] [blame] | 38 | |
Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 39 | extern struct library_symbol *read_elf(struct process *); |
Juan Cespedes | d914a20 | 2004-11-10 00:15:33 +0100 | [diff] [blame] | 40 | |
Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 41 | extern GElf_Addr arch_plt_sym_val(struct ltelf *, size_t, GElf_Rela *); |
Juan Cespedes | 96935a9 | 1997-08-09 23:45:39 +0200 | [diff] [blame] | 42 | |
Olaf Hering | 03c087b | 2006-09-25 02:31:27 +0200 | [diff] [blame^] | 43 | #ifndef SHT_GNU_HASH |
| 44 | #define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */ |
| 45 | #endif |
Juan Cespedes | 1cd999a | 2001-07-03 00:46:04 +0200 | [diff] [blame] | 46 | #endif |