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

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