diff options
author | Petr Machata <pmachata@redhat.com> | 2013-11-04 22:50:11 -0500 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-08-22 20:38:23 +0900 |
commit | e3d52520042f0995ce9a73a27f12fda4b2c39bdd (patch) | |
tree | 6ae30e7d50b76b6053a0c57688e7a6d650a68cce /sysdeps | |
parent | bf95c098bba38573ee9b3f8918b0cdca30e6d5fc (diff) | |
download | ltrace-e3d52520042f0995ce9a73a27f12fda4b2c39bdd.tar.gz ltrace-e3d52520042f0995ce9a73a27f12fda4b2c39bdd.tar.bz2 ltrace-e3d52520042f0995ce9a73a27f12fda4b2c39bdd.zip |
Fix compilation on ARM
- This was broken several commits back by removing pltrel from
struct ltelf.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/linux-gnu/arm/arch.h | 4 | ||||
-rw-r--r-- | sysdeps/linux-gnu/arm/plt.c | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/sysdeps/linux-gnu/arm/arch.h b/sysdeps/linux-gnu/arm/arch.h index 58a7fdf..6d0d902 100644 --- a/sysdeps/linux-gnu/arm/arch.h +++ b/sysdeps/linux-gnu/arm/arch.h @@ -22,6 +22,8 @@ #ifndef LTRACE_ARM_ARCH_H #define LTRACE_ARM_ARCH_H +#include <libelf.h> + #define ARCH_HAVE_ENABLE_BREAKPOINT 1 #define ARCH_HAVE_DISABLE_BREAKPOINT 1 @@ -47,7 +49,7 @@ struct arch_breakpoint_data { #define ARCH_HAVE_LTELF_DATA struct arch_ltelf_data { - /* We have this only for the hooks. */ + Elf_Data *jmprel_data; }; #define ARCH_HAVE_LIBRARY_DATA diff --git a/sysdeps/linux-gnu/arm/plt.c b/sysdeps/linux-gnu/arm/plt.c index 649f73a..9e9e37f 100644 --- a/sysdeps/linux-gnu/arm/plt.c +++ b/sysdeps/linux-gnu/arm/plt.c @@ -1,5 +1,6 @@ /* * This file is part of ltrace. + * Copyright (C) 2013 Petr Machata, Red Hat Inc. * Copyright (C) 2010 Zach Welch, CodeSourcery * Copyright (C) 2004,2008,2009 Juan Cespedes * @@ -40,6 +41,19 @@ get_hardfp(uint64_t abi_vfp_args) int arch_elf_init(struct ltelf *lte, struct library *lib) { + GElf_Addr jmprel_addr; + Elf_Scn *jmprel_sec; + GElf_Shdr jmprel_shdr; + if (elf_load_dynamic_entry(lte, DT_JMPREL, &jmprel_addr) < 0 + || elf_get_section_covering(lte, jmprel_addr, + &jmprel_sec, &jmprel_shdr) < 0 + || jmprel_sec == NULL) + return -1; + + lte->arch.jmprel_data = elf_loaddata(jmprel_sec, &jmprel_shdr); + if (lte->arch.jmprel_data == NULL) + return -1; + /* Nothing in this section is strictly critical. It's not * that much of a deal if we fail to guess right whether the * ABI is softfp or hardfp. */ |