aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2013-11-27 14:26:13 +0100
committerPetr Machata <pmachata@redhat.com>2013-11-27 14:26:13 +0100
commitf7864d60f0c8180806ed9b7d8dac26b250bd7120 (patch)
treea0d0693e803fb767ae6710bb566f166c78921509
parent42cccc91299718b95eecffa6941e29c33d5616b3 (diff)
downloadltrace-f7864d60f0c8180806ed9b7d8dac26b250bd7120.tar.gz
Support IRELATIVE relocations on s390
-rw-r--r--sysdeps/linux-gnu/s390/arch.h2
-rw-r--r--sysdeps/linux-gnu/s390/plt.c22
2 files changed, 24 insertions, 0 deletions
diff --git a/sysdeps/linux-gnu/s390/arch.h b/sysdeps/linux-gnu/s390/arch.h
index 0d412dc..de24b8f 100644
--- a/sysdeps/linux-gnu/s390/arch.h
+++ b/sysdeps/linux-gnu/s390/arch.h
@@ -1,5 +1,6 @@
/*
* This file is part of ltrace.
+ * Copyright (C) 2013 Petr Machata, Red Hat Inc.
* Copyright (C) 2001 IBM Poughkeepsie, IBM Corporation
*
* This program is free software; you can redistribute it and/or
@@ -25,6 +26,7 @@
#define ARCH_HAVE_FETCH_ARG
#define ARCH_HAVE_SIZEOF
#define ARCH_HAVE_ALIGNOF
+#define ARCH_HAVE_ADD_PLT_ENTRY
#define LT_ELFCLASS ELFCLASS32
#define LT_ELF_MACHINE EM_S390
diff --git a/sysdeps/linux-gnu/s390/plt.c b/sysdeps/linux-gnu/s390/plt.c
index 8893d45..fb7ebcb 100644
--- a/sysdeps/linux-gnu/s390/plt.c
+++ b/sysdeps/linux-gnu/s390/plt.c
@@ -1,5 +1,6 @@
/*
* This file is part of ltrace.
+ * Copyright (C) 2013 Petr Machata, Red Hat Inc.
* Copyright (C) 2004,2008,2009 Juan Cespedes
*
* This program is free software; you can redistribute it and/or
@@ -19,9 +20,12 @@
*/
#include <gelf.h>
+#include <stdbool.h>
+
#include "proc.h"
#include "common.h"
#include "library.h"
+#include "trace.h"
GElf_Addr
arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela) {
@@ -33,3 +37,21 @@ sym2addr(struct process *proc, struct library_symbol *sym)
{
return sym->enter_addr;
}
+
+enum plt_status
+arch_elf_add_plt_entry(struct process *proc, struct ltelf *lte,
+ const char *a_name, GElf_Rela *rela, size_t ndx,
+ struct library_symbol **ret)
+{
+#ifdef R_390_IRELATIVE
+ bool irelative = GELF_R_TYPE(rela->r_info) == R_390_IRELATIVE;
+#else
+ bool irelative = false;
+#endif
+
+ if (irelative)
+ return linux_elf_add_plt_entry_irelative(proc, lte, rela,
+ ndx, ret);
+
+ return PLT_DEFAULT;
+}