diff options
-rw-r--r-- | common.h | 2 | ||||
-rw-r--r-- | ltrace-elf.c | 12 |
2 files changed, 7 insertions, 7 deletions
@@ -220,7 +220,7 @@ void trace_fail_warning(pid_t pid); int os_ltrace_exiting_sighandler(void); void os_ltrace_exiting(void); -int arch_elf_init(struct ltelf *lte); +int arch_elf_init(struct ltelf *lte, struct library *lib); void arch_elf_destroy(struct ltelf *lte); enum plt_status { diff --git a/ltrace-elf.c b/ltrace-elf.c index ca08c13..bae9853 100644 --- a/ltrace-elf.c +++ b/ltrace-elf.c @@ -24,7 +24,7 @@ extern char *PLTs_initialized_by_here; #ifndef ARCH_HAVE_LTELF_DATA int -arch_elf_init(struct ltelf *lte) +arch_elf_init(struct ltelf *lte, struct library *lib) { return 0; } @@ -423,11 +423,6 @@ do_init_elf(struct ltelf *lte, const char *filename, GElf_Addr bias) if (soname_offset != 0) lte->soname = lte->dynstr + soname_offset; - if (arch_elf_init(lte) < 0) { - fprintf(stderr, "Backend initialization failed.\n"); - return -1; - } - return 0; } @@ -650,6 +645,11 @@ ltelf_read_library(struct library *lib, struct Process *proc, struct ltelf lte = {}; if (do_init_elf(<e, filename, bias) < 0) return -1; + if (arch_elf_init(<e, lib) < 0) { + fprintf(stderr, "Backend initialization failed.\n"); + return -1; + } + proc->e_machine = lte.ehdr.e_machine; int status = 0; |