aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2008-09-12 12:17:13 -0700
committerRob Pike <r@golang.org>2008-09-12 12:17:13 -0700
commite9047d1fc29abe809cec69ca4aa73a8942934635 (patch)
treeb4823262e313faa5d791ca57bc452dfbfbe57847 /src/runtime
parente1a9b6ee77cf7bb2209cd3868ac8661bd75a9a29 (diff)
downloadgo-e9047d1fc29abe809cec69ca4aa73a8942934635.tar.xz
fix silly portability bug
R=gri OCL=15238 CL=15238
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/rt1_amd64_darwin.c3
-rw-r--r--src/runtime/rt1_amd64_linux.c3
-rw-r--r--src/runtime/rt2_amd64.c3
-rw-r--r--src/runtime/runtime.h1
4 files changed, 8 insertions, 2 deletions
diff --git a/src/runtime/rt1_amd64_darwin.c b/src/runtime/rt1_amd64_darwin.c
index 49ecb3a0ca..2cbc7f6134 100644
--- a/src/runtime/rt1_amd64_darwin.c
+++ b/src/runtime/rt1_amd64_darwin.c
@@ -6,6 +6,9 @@
#include "amd64_darwin.h"
#include "signals.h"
+extern void _rt0_amd64_darwin();
+byte* startsym = (byte*)_rt0_amd64_darwin;
+
typedef uint64 __uint64_t;
/* From /usr/include/mach/i386/_structs.h */
diff --git a/src/runtime/rt1_amd64_linux.c b/src/runtime/rt1_amd64_linux.c
index 403b248338..14cdf63e0b 100644
--- a/src/runtime/rt1_amd64_linux.c
+++ b/src/runtime/rt1_amd64_linux.c
@@ -6,6 +6,9 @@
#include "amd64_linux.h"
#include "signals.h"
+extern void _rt0_amd64_linux();
+byte* startsym = (byte*)_rt0_amd64_linux;
+
/* From /usr/include/asm-x86_64/sigcontext.h */
struct _fpstate {
uint16 cwd;
diff --git a/src/runtime/rt2_amd64.c b/src/runtime/rt2_amd64.c
index 2943ac0d36..b7c3b11109 100644
--- a/src/runtime/rt2_amd64.c
+++ b/src/runtime/rt2_amd64.c
@@ -94,11 +94,10 @@ int32
inlinetrap(int32 sig, byte* pc)
{
extern void etext();
- extern void _rt0_amd64_darwin();
if(sig != 5) /* SIGTRAP */
return 0;
- if(pc-2 < (byte*)_rt0_amd64_darwin || pc >= (byte*)etext)
+ if(pc-2 < startsym || pc >= (byte*)etext)
return 0;
if(pc[-2] != 0xcd) /* INTB */
return 0;
diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h
index 11d3fdac8e..e786b78ecf 100644
--- a/src/runtime/runtime.h
+++ b/src/runtime/runtime.h
@@ -208,6 +208,7 @@ G* allg;
int32 goidgen;
extern int32 gomaxprocs;
extern int32 panicking;
+extern byte *startsym;
/*
* common functions and data