]> Cypherpunks repositories - gostls13.git/commitdiff
fix silly portability bug
authorRob Pike <r@golang.org>
Fri, 12 Sep 2008 19:17:13 +0000 (12:17 -0700)
committerRob Pike <r@golang.org>
Fri, 12 Sep 2008 19:17:13 +0000 (12:17 -0700)
R=gri
OCL=15238
CL=15238

src/runtime/rt1_amd64_darwin.c
src/runtime/rt1_amd64_linux.c
src/runtime/rt2_amd64.c
src/runtime/runtime.h

index 49ecb3a0caf004d2190eda5e4a7d3a6d9e9233c0..2cbc7f61346c4008261fc8d7b720cf315749a792 100644 (file)
@@ -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 */
index 403b248338661adfe763d0b23c2fd31d28a4eed7..14cdf63e0b65e65c7c55ffa8167e6fdf21446965 100644 (file)
@@ -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;
index 2943ac0d36ab8656971e95f106e05532412731e8..b7c3b11109e98567d424daf97c2c912302a80069 100644 (file)
@@ -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;
index 11d3fdac8ee818e68f77ef2e988d8727869394ba..e786b78ecff6197ea329db3387acebdc6ba23e1a 100644 (file)
@@ -208,6 +208,7 @@ G*  allg;
 int32  goidgen;
 extern int32   gomaxprocs;
 extern int32   panicking;
+extern byte    *startsym;
 
 /*
  * common functions and data