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

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