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

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