Commit Graph

6560 Commits

Author SHA1 Message Date
Russ Cox
19fd5c787f 5l, 6l, 8l: link pclntab and symtab as ordinary rodata symbols
That is, move the pc/ln table and the symbol table
into the read-only data segment.  This eliminates
the need for a special load command to map the
symbol table into memory, which makes the
information available on systems that couldn't handle
the magic load to 0x99000000, like NaCl and ARM QEMU
and Linux without config_highmem=y.  It also
eliminates an #ifdef and some clumsy code to
find the symbol table on Windows.

The bad news is that the binary appears to be bigger
than it used to be.  This is not actually the case, though:
the same amount of data is being mapped into memory
as before, and the tables are still read-only, so they're
still shared across multiple instances of the binary as
they were before.  The difference is just that the tables
aren't squirreled away in some section that "size" doesn't
know to look at.

This is a checkpoint.
It probably breaks Windows and breaks NaCl more
than it used to be broken, but those will be fixed.
The logic involving -s needs to be revisited too.

Fixes #871.

R=ken2
CC=golang-dev
https://golang.org/cl/2587041
2010-10-19 18:07:19 -04:00
Russ Cox
01df088f8d 5l, 6l, 8l: separate pass to fix addresses
Lay out code before data.

R=ken2
CC=golang-dev
https://golang.org/cl/2490043
2010-10-19 13:08:17 -04:00
Luuk van Dijk
54aba2e6dd [68]l: expose genasmsym.
R=rsc
CC=golang-dev
https://golang.org/cl/2512042
2010-10-19 18:09:18 +02:00
Yasuhiro Matsumoto
e64280ecfa goplay: fix to run under windows.
Fixes #1204.

R=golang-dev, brainman, Joe Poirier, alex.brainman, adg
CC=golang-dev, math-nuts
https://golang.org/cl/2532041
2010-10-19 11:29:31 +11:00
Andrew Gerrand
91e69efb0d A+C: Yasuhiro Matsumoto
R=r, r2
CC=golang-dev
https://golang.org/cl/2543044
2010-10-19 10:20:32 +11:00
Rob Pike
122fc3b5b7 fix bug in example. need to convert Value to float in Abs example
R=adg
CC=golang-dev
https://golang.org/cl/2486043
2010-10-18 16:05:50 -07:00
Andrew Gerrand
f1e1fd8b46 gc: update usage string in doc.go
R=rsc, r2, r
CC=golang-dev
https://golang.org/cl/2550041
2010-10-19 09:26:11 +11:00
Rob Pike
1ffb1f2b66 netchan: add new method Hangup to terminate transmission on a channel
Fixes #1151.

R=rsc
CC=golang-dev
https://golang.org/cl/2469043
2010-10-18 15:09:43 -07:00
Florian Uekermann
e9c35ac55d big: add random number generation
Adds func (z *Int) RandIntn(src rand.Source,n *Int) *Int

R=rsc
CC=golang-dev, gri
https://golang.org/cl/2315045
2010-10-18 14:09:20 -04:00
Russ Cox
ee3db0f5cf A+C: Florian Ukermann (individual CLA)
R=r, r2
CC=florian, golang-dev
https://golang.org/cl/2554042
2010-10-18 14:02:24 -04:00
Russ Cox
71c4244430 5l: handle jump to middle of floating point sequence
R=ken2
CC=golang-dev
https://golang.org/cl/2473042
2010-10-18 13:44:39 -04:00
Russ Cox
2012604002 runtime: fix arm softfloat again for R12
Missed a case, so now generalized.

R=ken2
CC=golang-dev
https://golang.org/cl/2540042
2010-10-18 13:24:19 -04:00
Russ Cox
9cc8e9ef48 runtime: fix amd64 build (broke by 386 support for Plan 9)
TBR=r
CC=golang-dev
https://golang.org/cl/2556041
2010-10-18 13:01:10 -04:00
Yuval Pavel Zholkover
99a10eff16 8l, runtime: initial support for Plan 9
No multiple processes/locks, managed to compile
and run a hello.go (with print not fmt).  Also test/sieve.go
seems to run until 439 and stops with a
'throw: all goroutines are asleep - deadlock!'
- just like runtime/tiny.

based on Russ's suggestions at:
http://groups.google.com/group/comp.os.plan9/browse_thread/thread/cfda8b82535d2d68/243777a597ec1612

Build instructions:
cd src/pkg/runtime
make clean && GOOS=plan9 make install
this will build and install the runtime.

When linking with 8l, you should pass -s to suppress symbol
generation in the a.out, otherwise the generated executable will not run.

This is runtime only, the porting of the toolchain has already
been done: http://code.google.com/p/go-plan9/source/browse
in the plan9-quanstro branch.

R=rsc
CC=golang-dev
https://golang.org/cl/2273041
2010-10-18 12:32:55 -04:00
Russ Cox
6ac08ba638 runtime: update arm softfloat - no more R12
R=ken2
CC=golang-dev
https://golang.org/cl/2555041
2010-10-18 12:24:59 -04:00
Russ Cox
18ccbda50c A+C: Yuval Pavel Zholkover (individual CLA)
R=r, r2
CC=golang-dev
https://golang.org/cl/2506045
2010-10-18 12:01:59 -04:00
Russ Cox
67941bf644 gc: say that shift must be unsigned integer
R=ken2
CC=golang-dev
https://golang.org/cl/2519044
2010-10-18 11:28:57 -04:00
Russ Cox
3d0a85785a 5l: data-relocatable code layout
R=ken2
CC=golang-dev
https://golang.org/cl/2479043
2010-10-18 11:09:59 -04:00
Luuk van Dijk
a647f59c1f [68]l: proper end of instruction ranges in dwarf.
R=rsc
CC=golang-dev
https://golang.org/cl/2542042
2010-10-17 22:35:55 +02:00
Luuk van Dijk
cc9e6b5cdb [68]l: fix off by one instruction in dwarf frame unwinding.
R=rsc
CC=golang-dev
https://golang.org/cl/2543043
2010-10-17 21:13:55 +02:00
Rob Pike
8abb8e1d20 log: update the documentation to clarify the behavior
R=rsc, PeterGo
CC=golang-dev
https://golang.org/cl/2519043
2010-10-17 09:20:23 -07:00
Russ Cox
8052786e51 5l: stop using R12 as SB
Because the SB is only good for 8k and Go programs
tend to have much more data than that, SB doesn't
save very much.  A fmt.Printf-based hello world program
has  360 kB text segment.  Removing SB makes the text
500 bytes (0.14%) longer.

R=ken2, r2, ken3
CC=golang-dev
https://golang.org/cl/2487042
2010-10-17 11:41:23 -04:00
Wei Guangjing
77eb94c032 8l: fix windows build.
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/2543042
2010-10-15 23:37:14 -04:00
Russ Cox
eb6f683691 8l: function at a time code layout
R=ken2
CC=golang-dev
https://golang.org/cl/2481042
2010-10-15 20:19:57 -04:00
Rob Pike
e39bd1dd56 log: roll back the rollback of the deprecation of the old interface.
R=adg
CC=golang-dev
https://golang.org/cl/2521042
2010-10-15 13:14:29 -07:00
Russ Cox
6e18e8c82f 8l: blind attempt to fix windows build
or at least gather more information

R=ken2
CC=golang-dev
https://golang.org/cl/2515042
2010-10-15 15:29:25 -04:00
Luuk van Dijk
49a835fc97 gc: keep track of real actual type of identifiers.
R=rsc
CC=golang-dev
https://golang.org/cl/2519042
2010-10-15 21:25:34 +02:00
Russ Cox
9c20485268 6l: function at a time code layout
Also change the span-dependent jump algorithm
to use fewer iterations:

* resolve forward jumps at their targets (comefrom list)
* mark jumps as small or big and only do small->big
* record whether a jump failed to be encodable

These changes mean that a function with only small
jumps can be laid out in a single iteration, and the
vast majority of functions take just two iterations.
I was seeing a maximum of 5 iterations before; the
max now is 3 and there are fewer that get even that far.

R=ken2
CC=golang-dev
https://golang.org/cl/2537041
2010-10-15 15:18:47 -04:00
Russ Cox
837c204ada 6l, 8l: avoid recursion in asmandsz
The old code said

	if(x) {
		handle a
		return
	}
	aa = *a
	rewrite aa to make x true
	recursivecall(&aa)

The new code says

	params = copy out of a
	if(!x) {
		rewrite params to make x true
	}
	handle params

but it's hard to see that in the Rietveld diffs because
it gets confused by changes in indentation.

Avoiding the recursion makes other changes easier.

R=ken2
CC=golang-dev
https://golang.org/cl/2533041
2010-10-15 13:01:03 -04:00
Russ Cox
be2c2120d0 5l, 6l, 8l: accumulate data image during import
Using explicit relocations internally, we can
represent the data for a particular symbol as
an initialized block of memory instead of a
linked list of ADATA instructions.  The real
goal here is to be able to hand off some of the
relocations to the dynamic linker when interacting
with system libraries, but a pleasant side effect is
that the memory image is much more compact
than the ADATA list, so the linkers use less memory.

R=ken2
CC=golang-dev
https://golang.org/cl/2512041
2010-10-14 23:48:40 -04:00
Andrew Gerrand
def0d7199b tag release.2010-10-13.1
R=r
CC=golang-dev
https://golang.org/cl/2526041
2010-10-15 12:06:34 +11:00
Andrew Gerrand
6b21949a91 release.2010-10-13.1
R=r, r2
CC=golang-dev
https://golang.org/cl/2493043
2010-10-15 12:05:05 +11:00
Rob Pike
84834feffd log: roll back deprecation of old API to apply fix to log.Output in public release.
R=adg
CC=golang-dev
https://golang.org/cl/2525042
2010-10-14 18:02:08 -07:00
Andrew Gerrand
568eccd12d log: fix custom output bug
R=r
CC=golang-dev
https://golang.org/cl/2525041
2010-10-15 11:55:51 +11:00
Russ Cox
0b2af925db arm: enable 6 more tests after net fix
R=ken2
CC=golang-dev
https://golang.org/cl/2520042
2010-10-14 17:15:45 -04:00
Russ Cox
14d2242fb9 syscall: fix arm networking
Suggested by fango (fan.howard@gmail.com)

R=r, r2
CC=golang-dev
https://golang.org/cl/2514041
2010-10-14 16:13:44 -04:00
Rob Pike
b6cd8f869d log: delete deprecated functionality
Fixes #1195.

R=rsc
CC=golang-dev
https://golang.org/cl/2504043
2010-10-14 12:50:36 -07:00
Russ Cox
9b15ad8c22 arm: adjust recover for new reflect.call
R=ken2
CC=golang-dev
https://golang.org/cl/2471043
2010-10-14 10:45:32 -04:00
Andrew Gerrand
1748dc34e7 doc: add The Expressiveness of Go talk to docs.html
R=r, r2
CC=golang-dev
https://golang.org/cl/2494042
2010-10-14 17:25:23 +11:00
Andrew Gerrand
88a7dbdb27 tag release.2010-10-13
R=stephenm
CC=golang-dev
https://golang.org/cl/2471042
2010-10-14 14:56:11 +11:00
Andrew Gerrand
39ee9a0396 release.2010-10-13
R=r, rsc, r2
CC=golang-dev
https://golang.org/cl/2499041
2010-10-14 14:52:08 +11:00
Andrew Gerrand
e2df7f42ac misc: add goplay
R=rsc, r
CC=golang-dev
https://golang.org/cl/2473041
2010-10-14 14:06:02 +11:00
Evan Shaw
df74d8df09 smtp: new package
R=rsc, iant, agl
CC=golang-dev
https://golang.org/cl/2052042
2010-10-13 22:07:28 -04:00
Rob Pike
52e3c99cfb bufio: bulletproof UnreadRune
After a fill(), there is nothing to back up.  Make sure UnreadRune
recognizes the situation.

Fixes #1137.
(Stops the crash, but doesn't make UnreadRune usable after a Peek()).

R=rsc
CC=golang-dev
https://golang.org/cl/2498041
2010-10-13 17:12:43 -07:00
Russ Cox
d6df301774 arm: enable 8 more packages
The remaining failures include:

* something about bit operations?
	crypto/block
	encoding/binary

* something about file I/O?
	archive/tar
	archive/zip
	debug/dwarf
	debug/elf
	debug/macho
	image/png

* floating point
	cmath
	expvar
	flag
	fmt
	gob
	json
	math
	strconv
	template
	xml

* network (maybe fixed by a pending CL)
	http
	netchan
	rpc
	rpc/jsonrpc
	syslog
	websocket

* line numbers
	log

* haven't bothered / not sure
	exp/datafmt
	exp/eval
	go/printer
	os
	os/signal
	testing/quick

R=ken2
CC=golang-dev
https://golang.org/cl/2496041
2010-10-13 18:16:44 -04:00
Ken Thompson
b33f5d537f fix arm bug in reflect.call
R=rsc
CC=golang-dev
https://golang.org/cl/2475042
2010-10-13 13:24:14 -07:00
Russ Cox
d9c989fa25 various: avoid %ld etc
The Plan 9 tools assume that long is 32 bits.
We converted all instances of long to int32 when
importing the code but missed the print formats.
Because int32 is always int on the compilers we use,
it is never correct to use %lux, %ld, etc.  Convert to %ux, %d, etc.

(It matters because on 64-bit gcc, long is 64 bits,
so we were printing 32-bit quantities with 64-bit formats.)

R=ken2
CC=golang-dev
https://golang.org/cl/2491041
2010-10-13 16:20:22 -04:00
Russ Cox
085be1740a 5l, 6l, 8l: first pass cleanup
* Maintain Sym* list for text with individual
  prog lists instead of using one huge list and
  overloading p->pcond.
* Comment what each file is for.
* Move some output code from span.c to asm.c.
* Move profiling into prof.c, symbol table into symtab.c.
* Move mkfwd to ld/lib.c.
* Throw away dhog dynamic loading code.
* Throw away Alef become.
* Fix printing of WORD instructions in 5l -a.

Goal here is to be able to handle each piece of text or data
as a separate piece, both to make it easier to load the
occasional .o file and also to make it possible to split the
work across multiple threads.

R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/2335043
2010-10-13 15:51:21 -04:00
Russ Cox
d42903119b 5l, 6l, 8l: indent, outdent
This is entirely adding and removing tabs.
It looks weird but will make the diffs for the
next change easier to read.

R=ken2
CC=golang-dev
https://golang.org/cl/2490041
2010-10-13 15:19:53 -04:00
Rob Pike
dd8afb800b log: fix out-of-date package comment
R=rsc
CC=golang-dev
https://golang.org/cl/2485041
2010-10-13 11:05:45 -07:00