aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2013-11-04 22:50:11 -0500
committerPetr Machata <pmachata@redhat.com>2013-11-05 04:53:29 +0100
commit9e33f5ac1037adeb32e9d693e6555967e9be68a6 (patch)
tree6ae30e7d50b76b6053a0c57688e7a6d650a68cce
parent1383e5bd876baa123b39210c2210d256bcfa5bec (diff)
downloadltrace-9e33f5ac1037adeb32e9d693e6555967e9be68a6.tar.gz
Fix compilation on ARM
- This was broken several commits back by removing pltrel from struct ltelf.
-rw-r--r--sysdeps/linux-gnu/arm/arch.h4
-rw-r--r--sysdeps/linux-gnu/arm/plt.c14
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. */