-
Notifications
You must be signed in to change notification settings - Fork 180
/
0009-WIP-xtensa-fix-_mcount-call-for-CALL0-ABI.patch
56 lines (49 loc) · 1.82 KB
/
0009-WIP-xtensa-fix-_mcount-call-for-CALL0-ABI.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From c73b720ae2759c70a4c657962e0bcb40c42fd9bc Mon Sep 17 00:00:00 2001
From: Max Filippov <jcmvbkbc@gmail.com>
Date: Sun, 9 Nov 2014 06:26:29 +0300
Subject: [PATCH 09/16] WIP: xtensa: fix _mcount call for CALL0 ABI
_mcount is not specified, let's call it with return address in a10, and
require it to preserve all registers.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
gcc/config/xtensa/xtensa.h | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index f7e22ce..653631e 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -601,32 +601,17 @@ typedef struct xtensa_args
#define NO_PROFILE_COUNTERS 1
-#if TARGET_WINDOWED_ABI
#define FUNCTION_PROFILER(FILE, LABELNO) \
do { \
fprintf (FILE, "\t%s\ta10, a0\n", TARGET_DENSITY ? "mov.n" : "mov"); \
if (flag_pic) \
{ \
- fprintf (FILE, "\tmovi\ta8, _mcount@PLT\n"); \
- fprintf (FILE, "\tcallx8\ta8\n"); \
- } \
- else \
- fprintf (FILE, "\tcall8\t_mcount\n"); \
- } while (0)
-#else
-#define FUNCTION_PROFILER(FILE, LABELNO) \
- do { \
- fprintf (FILE, "\t%s\ta2, a0\n", TARGET_DENSITY ? "mov.n" : "mov"); \
- /* TODO save incoming args? */ \
- if (flag_pic) \
- { \
- fprintf (FILE, "\tmovi\ta0, _mcount@PLT\n"); \
- fprintf (FILE, "\tcallx0\ta0\n"); \
+ fprintf (FILE, "\tmovi\ta%d, _mcount@PLT\n", WINDOW_SIZE); \
+ fprintf (FILE, "\tcallx%d\ta%d\n", WINDOW_SIZE, WINDOW_SIZE); \
} \
else \
- fprintf (FILE, "\tcall0\t_mcount\n"); \
+ fprintf (FILE, "\tcall%d\t_mcount\n", WINDOW_SIZE); \
} while (0)
-#endif
/* Stack pointer value doesn't matter at exit. */
#define EXIT_IGNORE_STACK 1
--
1.8.1.4