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

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