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

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