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; |
| 27 | int hash_malloced; |
Juan Cespedes | 1cd999a | 2001-07-03 00:46:04 +0200 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | extern int library_num; |
| 31 | extern char *library[MAX_LIBRARY]; |
Juan Cespedes | 1cd999a | 2001-07-03 00:46:04 +0200 | [diff] [blame] | 32 | |
Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame^] | 33 | extern struct library_symbol *read_elf(struct process *); |
Juan Cespedes | d914a20 | 2004-11-10 00:15:33 +0100 | [diff] [blame] | 34 | |
Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame^] | 35 | 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] | 36 | |
Juan Cespedes | 1cd999a | 2001-07-03 00:46:04 +0200 | [diff] [blame] | 37 | #endif |