aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkstack.pl8
-rw-r--r--scripts/genksyms/genksyms.c3
-rw-r--r--scripts/recordmcount.c13
3 files changed, 21 insertions, 3 deletions
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 17e384396705..544aa56b6200 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -34,7 +34,7 @@ use strict;
34# $1 (first bracket) matches the dynamic amount of the stack growth 34# $1 (first bracket) matches the dynamic amount of the stack growth
35# 35#
36# use anything else and feel the pain ;) 36# use anything else and feel the pain ;)
37my (@stack, $re, $dre, $x, $xs); 37my (@stack, $re, $dre, $x, $xs, $funcre);
38{ 38{
39 my $arch = shift; 39 my $arch = shift;
40 if ($arch eq "") { 40 if ($arch eq "") {
@@ -44,6 +44,7 @@ my (@stack, $re, $dre, $x, $xs);
44 44
45 $x = "[0-9a-f]"; # hex character 45 $x = "[0-9a-f]"; # hex character
46 $xs = "[0-9a-f ]"; # hex character or space 46 $xs = "[0-9a-f ]"; # hex character or space
47 $funcre = qr/^$x* <(.*)>:$/;
47 if ($arch eq 'arm') { 48 if ($arch eq 'arm') {
48 #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64 49 #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64
49 $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o; 50 $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o;
@@ -66,6 +67,10 @@ my (@stack, $re, $dre, $x, $xs);
66 # 2b6c: 4e56 fb70 linkw %fp,#-1168 67 # 2b6c: 4e56 fb70 linkw %fp,#-1168
67 # 1df770: defc ffe4 addaw #-28,%sp 68 # 1df770: defc ffe4 addaw #-28,%sp
68 $re = qr/.*(?:linkw %fp,|addaw )#-([0-9]{1,4})(?:,%sp)?$/o; 69 $re = qr/.*(?:linkw %fp,|addaw )#-([0-9]{1,4})(?:,%sp)?$/o;
70 } elsif ($arch eq 'metag') {
71 #400026fc: 40 00 00 82 ADD A0StP,A0StP,#0x8
72 $re = qr/.*ADD.*A0StP,A0StP,\#(0x$x{1,8})/o;
73 $funcre = qr/^$x* <[^\$](.*)>:$/;
69 } elsif ($arch eq 'mips64') { 74 } elsif ($arch eq 'mips64') {
70 #8800402c: 67bdfff0 daddiu sp,sp,-16 75 #8800402c: 67bdfff0 daddiu sp,sp,-16
71 $re = qr/.*daddiu.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o; 76 $re = qr/.*daddiu.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
@@ -109,7 +114,6 @@ my (@stack, $re, $dre, $x, $xs);
109# 114#
110# main() 115# main()
111# 116#
112my $funcre = qr/^$x* <(.*)>:$/;
113my ($func, $file, $lastslash); 117my ($func, $file, $lastslash);
114 118
115while (my $line = <STDIN>) { 119while (my $line = <STDIN>) {
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c
index 8a106499ec4f..d25e4a118d37 100644
--- a/scripts/genksyms/genksyms.c
+++ b/scripts/genksyms/genksyms.c
@@ -826,7 +826,8 @@ int main(int argc, char **argv)
826 genksyms_usage(); 826 genksyms_usage();
827 return 1; 827 return 1;
828 } 828 }
829 if ((strcmp(arch, "h8300") == 0) || (strcmp(arch, "blackfin") == 0)) 829 if ((strcmp(arch, "h8300") == 0) || (strcmp(arch, "blackfin") == 0) ||
830 (strcmp(arch, "metag") == 0))
830 mod_prefix = "_"; 831 mod_prefix = "_";
831 { 832 {
832 extern int yydebug; 833 extern int yydebug;
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index ee52cb8e17ad..9c22317778eb 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -33,6 +33,13 @@
33#include <string.h> 33#include <string.h>
34#include <unistd.h> 34#include <unistd.h>
35 35
36#ifndef EM_METAG
37/* Remove this when these make it to the standard system elf.h. */
38#define EM_METAG 174
39#define R_METAG_ADDR32 2
40#define R_METAG_NONE 3
41#endif
42
36static int fd_map; /* File descriptor for file being modified. */ 43static int fd_map; /* File descriptor for file being modified. */
37static int mmap_failed; /* Boolean flag. */ 44static int mmap_failed; /* Boolean flag. */
38static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */ 45static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */
@@ -341,6 +348,12 @@ do_file(char const *const fname)
341 altmcount = "__gnu_mcount_nc"; 348 altmcount = "__gnu_mcount_nc";
342 break; 349 break;
343 case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break; 350 case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break;
351 case EM_METAG: reltype = R_METAG_ADDR32;
352 altmcount = "_mcount_wrapper";
353 rel_type_nop = R_METAG_NONE;
354 /* We happen to have the same requirement as MIPS */
355 is_fake_mcount32 = MIPS32_is_fake_mcount;
356 break;
344 case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break; 357 case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break;
345 case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break; 358 case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break;
346 case EM_PPC64: reltype = R_PPC64_ADDR64; gpfx = '_'; break; 359 case EM_PPC64: reltype = R_PPC64_ADDR64; gpfx = '_'; break;