Blame SOURCES/ltrace-0.7.91-s390-irelative.patch

b79ac1
@@ -, +, @@ 
b79ac1
---
b79ac1
 sysdeps/linux-gnu/s390/arch.h |  2 ++
b79ac1
 sysdeps/linux-gnu/s390/plt.c  | 22 ++++++++++++++++++++++
b79ac1
 2 files changed, 24 insertions(+)
b79ac1
--- a/sysdeps/linux-gnu/s390/arch.h	
b79ac1
+++ a/sysdeps/linux-gnu/s390/arch.h	
b79ac1
@@ -1,5 +1,6 @@ 
b79ac1
 /*
b79ac1
  * This file is part of ltrace.
b79ac1
+ * Copyright (C) 2013 Petr Machata, Red Hat Inc.
b79ac1
  * Copyright (C) 2001 IBM Poughkeepsie, IBM Corporation
b79ac1
  *
b79ac1
  * This program is free software; you can redistribute it and/or
b79ac1
@@ -25,6 +26,7 @@ 
b79ac1
 #define ARCH_HAVE_FETCH_ARG
b79ac1
 #define ARCH_HAVE_SIZEOF
b79ac1
 #define ARCH_HAVE_ALIGNOF
b79ac1
+#define ARCH_HAVE_ADD_PLT_ENTRY
b79ac1
 
b79ac1
 #define LT_ELFCLASS	ELFCLASS32
b79ac1
 #define LT_ELF_MACHINE	EM_S390
b79ac1
--- a/sysdeps/linux-gnu/s390/plt.c	
b79ac1
+++ a/sysdeps/linux-gnu/s390/plt.c	
b79ac1
@@ -1,5 +1,6 @@ 
b79ac1
 /*
b79ac1
  * This file is part of ltrace.
b79ac1
+ * Copyright (C) 2013 Petr Machata, Red Hat Inc.
b79ac1
  * Copyright (C) 2004,2008,2009 Juan Cespedes
b79ac1
  *
b79ac1
  * This program is free software; you can redistribute it and/or
b79ac1
@@ -19,9 +20,12 @@ 
b79ac1
  */
b79ac1
 
b79ac1
 #include <gelf.h>
b79ac1
+#include <stdbool.h>
b79ac1
+
b79ac1
 #include "proc.h"
b79ac1
 #include "common.h"
b79ac1
 #include "library.h"
b79ac1
+#include "trace.h"
b79ac1
 
b79ac1
 GElf_Addr
b79ac1
 arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela) {
b79ac1
@@ -33,3 +37,21 @@ sym2addr(struct process *proc, struct library_symbol *sym)
b79ac1
 {
b79ac1
 	return sym->enter_addr;
b79ac1
 }
b79ac1
+
b79ac1
+enum plt_status
b79ac1
+arch_elf_add_plt_entry(struct process *proc, struct ltelf *lte,
b79ac1
+		       const char *a_name, GElf_Rela *rela, size_t ndx,
b79ac1
+		       struct library_symbol **ret)
b79ac1
+{
b79ac1
+#ifdef R_390_IRELATIVE
b79ac1
+	bool irelative = GELF_R_TYPE(rela->r_info) == R_390_IRELATIVE;
b79ac1
+#else
b79ac1
+	bool irelative = false;
b79ac1
+#endif
b79ac1
+
b79ac1
+	if (irelative)
b79ac1
+		return linux_elf_add_plt_entry_irelative(proc, lte, rela,
b79ac1
+							 ndx, ret);
b79ac1
+
b79ac1
+	return PLT_DEFAULT;
b79ac1
+}
b79ac1
--