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

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