aboutsummaryrefslogtreecommitdiff
path: root/lib/bcheck.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2012-04-16 00:39:24 +0200
committerMichael Matz <matz@suse.de>2012-04-18 20:57:13 +0200
commitb068e29df753192bdcec5b1e41401bdc21812136 (patch)
treed279b570b136fb8bd4fe6698f0db2bcd8302ddce /lib/bcheck.c
parent4c0d70ab07b4a5a5040e53259f8e9cedd4ec89b2 (diff)
downloadtinycc-b068e29df753192bdcec5b1e41401bdc21812136.tar.gz
tinycc-b068e29df753192bdcec5b1e41401bdc21812136.tar.bz2
x86_64: Implement GET_CALLER_FP
TCC always uses %rbp frames, so we can use that one.
Diffstat (limited to 'lib/bcheck.c')
-rw-r--r--lib/bcheck.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bcheck.c b/lib/bcheck.c
index 9996649..48d7606 100644
--- a/lib/bcheck.c
+++ b/lib/bcheck.c
@@ -216,6 +216,14 @@ BOUND_PTR_INDIR(16)
__asm__ __volatile__ ("movl %%ebp,%0" :"=g" (fp1));\
fp = fp1[0];\
}
+#elif defined(__x86_64__)
+/* TCC always creates %rbp frames also on x86_64, so use them. */
+#define GET_CALLER_FP(fp)\
+{\
+ unsigned long *fp1;\
+ __asm__ __volatile__ ("movq %%rbp,%0" :"=g" (fp1));\
+ fp = fp1[0];\
+}
#else
#error put code to extract the calling frame pointer
#endif