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

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