1
0
mirror of https://github.com/golang/go synced 2024-10-03 00:21:22 -06:00
Commit Graph

19 Commits

Author SHA1 Message Date
Russ Cox
141a4a1759 runtime: fix arm reflect.call boundary case
The fault was lucky: when it wasn't faulting it was silently
copying a word from some other block and later putting
that same word back.  If some other goroutine had changed
that word of memory in the interim, too bad.

The ARM code was inconsistent about whether the
"argument frame" included the saved LR.  Including it made
some things more regular but mostly just caused confusion
in the places where the regularity broke.  Now the rule
reflects reality: argp is always a pointer to arguments,
never a saved link register.

Renamed struct fields to make meaning clearer.

Running ARM in QEMU, package time's gotest:
  * before: 27/58 failed
  * after: 0/50

R=r, r2
CC=golang-dev
https://golang.org/cl/3993041
2011-01-14 14:05:20 -05:00
Russ Cox
68b4255a96 runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries.  The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.

The symbols left alone are:

	** known to cgo **
	_cgo_free
	_cgo_malloc
	libcgo_thread_start
	initcgo
	ncgocall

	** known to linker **
	_rt0_$GOARCH
	_rt0_$GOARCH_$GOOS
	text
	etext
	data
	end
	pclntab
	epclntab
	symtab
	esymtab

	** known to C compiler **
	_divv
	_modv
	_div64by32
	etc (arch specific)

Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.

Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.

R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 14:00:19 -04:00
Russ Cox
e473f42b2d amd64: use segment memory for thread-local storage
Returns R14 and R15 to the available register pool.
Plays more nicely with ELF ABI C code.
In particular, our signal handlers will no longer crash
when a signal arrives during execution of a cgo C call.

Fixes #720.

R=ken2, r
CC=golang-dev
https://golang.org/cl/1847051
2010-08-04 17:50:22 -07:00
Ian Lance Taylor
a4f8d36ba5 Run initcgo for all amd64 targets, not just GNU/Linux.
This is required to make cgo export work on Darwin.  Note that
this corrects the stack alignment when calling initcgo to that
required by gcc on amd64.

R=rsc
CC=golang-dev
https://golang.org/cl/907041
2010-04-09 14:15:15 -07:00
Ian Lance Taylor
2d0ff3f1a6 Support cgo export on amd64.
R=rsc
CC=golang-dev
https://golang.org/cl/857045
2010-04-09 13:30:11 -07:00
Russ Cox
6c196015e0 runtime: various arm fixes
* correct symbol table size
  * do not reorder functions in output
  * traceback
  * signal handling
  * use same code for go + defer
  * handle leaf functions in symbol table

R=kaib, dpx
CC=golang-dev
https://golang.org/cl/884041
2010-04-05 12:51:09 -07:00
Russ Cox
63e878a750 runtime: make type assertion a runtime.Error, the first of many
R=r
CC=golang-dev
https://golang.org/cl/805043
2010-03-31 15:55:10 -07:00
Russ Cox
01eaf780a8 gc: add panic and recover (still unimplemented in runtime)
main semantic change is to enforce single argument to panic.

runtime: change to 1-argument panic.
use String method on argument if it has one.

R=ken2, r
CC=golang-dev
https://golang.org/cl/812043
2010-03-30 10:53:16 -07:00
Russ Cox
83727ccf7c runtime: run deferred calls at Goexit
baby step toward panic+recover.

Fixes #349.

R=r
CC=golang-dev
https://golang.org/cl/825043
2010-03-29 21:48:22 -07:00
Russ Cox
718be3215f in C and asm, replace pkg·name with ·name
(eliminate assumption of package global name space,
make code easier to move between packages).

R=r
CC=golang-dev
https://golang.org/cl/194072
2010-01-25 18:52:55 -08:00
Devon H. O'Dell
5a4a08fab8 Fix stack on FreeBSD / add stack check across the board
FreeBSD was passing stk as the new thread's stack base, while
stk is the top of the stack in go. The added check should cause
a trap if this ever comes up in any new ports, or regresses
in current ones.

R=rsc
CC=golang-dev
https://golang.org/cl/167055
2009-12-08 18:19:30 -08:00
Devon H. O'Dell
0489a260da FreeBSD-specific porting work.
cgo/libmach remain unimplemented. However, compilers, runtime,
and packages are 100%. I still need to go through and implement
missing syscalls (at least make sure they're all listed), but
for all shipped functionality, this is done. Ship! ;)

R=rsc, VenkateshSrinivas
https://golang.org/cl/152142
2009-11-17 08:20:58 -08:00
Russ Cox
22a5c78f44 rename sys functions to runtime,
because they are in package runtime.

another step to enforcing package boundaries.

R=r
DELTA=732  (114 added, 93 deleted, 525 changed)
OCL=35811
CL=35824
2009-10-15 23:10:49 -07:00
Russ Cox
add89dd1ba stack overflow debugging and fix.
* in 6l, -K already meant check for stack underflow.
    add -KK to mean double-check stack overflows
    even in nosplit functions.

  * comment out print locks; they deadlock too easily
     but are still useful to put back for special occasions.

  * let runcgo assembly switch to scheduler stack
    without involving scheduler directly.  because runcgo
    gets called from matchmg, it is too hard to keep it
    from being called on other stacks.

R=r
DELTA=94  (65 added, 18 deleted, 11 changed)
OCL=35591
CL=35604
2009-10-12 10:26:38 -07:00
Russ Cox
133a158bd8 8c, 8l dynamic loading support.
better mach binaries.
cgo working on darwin+linux amd64+386.
eliminated context switches - pi is 30x faster.
add libcgo to build.

on snow leopard:
  - non-cgo binaries work; all tests pass.
  - cgo binaries work on amd64 but not 386.

R=r
DELTA=2031  (1316 added, 626 deleted, 89 changed)
OCL=35264
CL=35304
2009-10-03 10:37:12 -07:00
Russ Cox
bba278a43b reflection for functions
add channel send type check (thanks austin).
fix type mismatch message.

R=r
DELTA=241  (225 added, 5 deleted, 11 changed)
OCL=31370
CL=31375
2009-07-08 18:16:09 -07:00
Russ Cox
380200953a Forgot to check in 386/asm.h.
Rather than do that, fix build by
generating asm.h automatically.

R=r
DELTA=97  (48 added, 36 deleted, 13 changed)
OCL=30449
CL=30452
2009-06-17 16:31:02 -07:00
Russ Cox
7343e03c43 runtime: stack growth adjustments, cleanup
* keep coherent SP/PC in gobuf
	  (i.e., SP that would be in use at that PC)
	* gogocall replaces setspgoto,
	  should work better in presence of link registers
	* delete unused system calls

only amd64; 386 is now broken

R=r
DELTA=548  (183 added, 183 deleted, 182 changed)
OCL=30381
CL=30442
2009-06-17 15:12:16 -07:00
Rob Pike
d90e7cbac6 mv src/lib to src/pkg
tests: all.bash passes, gobuild still works, godoc still works.

R=rsc
OCL=30096
CL=30102
2009-06-09 09:53:44 -07:00