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

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