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

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