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

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