[patch 4/4] s390 mcount offset calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>

Do the mcount offset adjustment in the recordmcount.pl/recordmcount.[ch]
at compile time and not in ftrace_call_adjust at run time.

Signed-off-by: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
---


 arch/s390/include/asm/ftrace.h |    4 +---
 scripts/recordmcount.c         |    8 ++++++--
 scripts/recordmcount.pl        |    2 ++
 3 files changed, 9 insertions(+), 5 deletions(-)
Index: test-2.6/arch/s390/include/asm/ftrace.h
===================================================================
--- test-2.6.orig/arch/s390/include/asm/ftrace.h	2011-01-10 10:32:42.825504709 +0100
+++ test-2.6/arch/s390/include/asm/ftrace.h	2011-05-03 09:39:07.757500412 +0200
@@ -11,15 +11,13 @@
 
 #ifdef CONFIG_64BIT
 #define MCOUNT_INSN_SIZE  12
-#define MCOUNT_OFFSET	   8
 #else
 #define MCOUNT_INSN_SIZE  20
-#define MCOUNT_OFFSET	   4
 #endif
 
 static inline unsigned long ftrace_call_adjust(unsigned long addr)
 {
-	return addr - MCOUNT_OFFSET;
+	return addr;
 }
 
 #endif /* __ASSEMBLY__ */
Index: test-2.6/scripts/recordmcount.c
===================================================================
--- test-2.6.orig/scripts/recordmcount.c	2011-05-03 09:39:04.929486388 +0200
+++ test-2.6/scripts/recordmcount.c	2011-05-03 09:39:07.757500412 +0200
@@ -338,8 +338,10 @@
 				"unrecognized ET_REL file: %s\n", fname);
 			fail_file();
 		}
-		if (EM_S390 == w2(ehdr->e_machine))
+		if (EM_S390 == w2(ehdr->e_machine)) {
 			reltype = R_390_32;
+			mcount_adjust_32 = -4;
+		}
 		if (EM_MIPS == w2(ehdr->e_machine)) {
 			reltype = R_MIPS_32;
 			is_fake_mcount32 = MIPS32_is_fake_mcount;
@@ -354,8 +356,10 @@
 				"unrecognized ET_REL file: %s\n", fname);
 			fail_file();
 		}
-		if (EM_S390 == w2(ghdr->e_machine))
+		if (EM_S390 == w2(ghdr->e_machine)) {
 			reltype = R_390_64;
+			mcount_adjust_64 = -8;
+		}
 		if (EM_MIPS == w2(ghdr->e_machine)) {
 			reltype = R_MIPS_64;
 			Elf64_r_sym = MIPS64_r_sym;
Index: test-2.6/scripts/recordmcount.pl
===================================================================
--- test-2.6.orig/scripts/recordmcount.pl	2011-05-03 09:39:04.929486388 +0200
+++ test-2.6/scripts/recordmcount.pl	2011-05-03 09:39:07.757500412 +0200
@@ -242,12 +242,14 @@
 
 } elsif ($arch eq "s390" && $bits == 32) {
     $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$";
+    $mcount_adjust = -4;
     $alignment = 4;
     $ld .= " -m elf_s390";
     $cc .= " -m31";
 
 } elsif ($arch eq "s390" && $bits == 64) {
     $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
+    $mcount_adjust = -8;
     $alignment = 8;
     $type = ".quad";
     $ld .= " -m elf64_s390";

--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux