summaryrefslogtreecommitdiff
path: root/src/cmd/6l
AgeCommit message (Collapse)AuthorFilesLines
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý11-2816/+1942
2010-07-016l: drop confusing commentRuss Cox1-1/+1
R=ken2 CC=golang-dev http://codereview.appspot.com/1693047
2010-07-016l: implement MOVLQZX as "mov", not "movsxd"Russ Cox1-1/+1
(Here, quoted strings are the official AMD names.) The amd64 "movsxd" instruction, when invoked with a 64-bit REX prefix, moves and sign extends a 32-bit value from register or memory into a 64-bit register. 6.out.h spells this MOVLQSX. 6.out.h also includes MOVLQZX, the zero extending version, which it implements as "movsxd" without the REX prefix. Without the REX prefix it's only sign extending 32 bits to 32 bits (i.e., not doing anything to the bits) and then storing in a 32-bit register. Any write to a 32-bit register zeros the top half of the corresponding 64-bit register, giving the advertised effect. This particular implementation of the functionality is non-standard, because an ordinary 32-bit "mov" would do the same thing. Because it is non-standard, it is often mishandled or not handled by binary translation tools like valgrind. Switching to the standard "mov" makes the binaries work better with those tools. It's probably useful in 6c and 6g to have an explicit instruction, though, so that the intent of the size change is clear. Thus we leave the concept of MOVLQZX and just implement it by the standard "mov" instead of the non-standard 32-bit "movsxd". Fixes issue 896. R=ken2 CC=golang-dev http://codereview.appspot.com/1733046
2010-06-30cgo: use slash-free relative paths for .so referencesRuss Cox1-0/+2
The Makefile and cgo now rewrite / to _ when creating the path. The .so for gosqlite.googlecode.com/hg/sqlite is named cgo_gosqlite.googlecode.com_hg_sqlite.so, and then 6l and 8l both include a default rpath of $GOROOT/pkg/$GOOS_$GOARCH. This should make it easier to move binaries from one system to another. Fixes issue 857. R=iant, r CC=golang-dev http://codereview.appspot.com/1700048
2010-06-21ld: add -u flag to check safe bits; discard old -u, -x flagsRuss Cox1-10/+0
R=r, r2 CC=golang-dev http://codereview.appspot.com/1707043
2010-06-11Pad Go symbol table out to page boundary when linking dynamically.Ian Lance Taylor1-2/+4
This avoids a crash when using cgo where glibc's malloc thinks that it can use some of the memory following the symbol table. This fails because the symbol table is mapped read-only, which affects the whole page. R=rsc CC=golang-dev http://codereview.appspot.com/1616042
2010-04-275l, 6l, 8l, runtime: make -s binaries workRuss Cox4-12/+70
5l, 6l, 8l: change ELF header so that strip doesn't destroy binary Fixes issue 261. R=iant, r CC=golang-dev http://codereview.appspot.com/994044
2010-04-206l, 8l: include ELF header in PT_LOAD mapping for text segmentRuss Cox1-5/+5
Due to page boundary rounding, the header would have been loaded as part of the text segment already, but this change placates the "paxctl" tool on so-called hardened Linux distributions (as if normal distributions weren't already hard enough to use). R=r CC=golang-dev http://codereview.appspot.com/954041
2010-03-23Add support for #pragma dynexport.Ian Lance Taylor2-31/+47
R=rsc CC=golang-dev http://codereview.appspot.com/661043
2010-03-22Rename dynld to dynimport throughout.Ian Lance Taylor2-7/+7
Cgo users will need to rerun cgo. R=rsc CC=golang-dev http://codereview.appspot.com/692041
2010-02-26Add -r option to 6l/8l/5l.Ian Lance Taylor4-1/+9
This permits more flexibility with cgo and swig in cases where the program is run on a machine other than the one on which it is built. Rather than storing the absolute path to the shared library in the DT_NEEDED entry, we can store just the name, and let the dynamic linker find it using DT_RUNPATH or the LD_LIBRARY_PATH environment variable. R=rsc CC=golang-dev http://codereview.appspot.com/223068
2010-02-08*l/*c: add -V flag to display version numberAndrew Gerrand2-0/+5
R=rsc CC=golang-dev http://codereview.appspot.com/204044
2010-02-046l: move mapped symbol table lower in memoryAndrew Gerrand1-1/+1
Allows binary to run on some Linux system. Fix for issue 365. R=rsc CC=golang-dev http://codereview.appspot.com/199096
2010-02-03search for runtime.a in the package path instead of hardcodingKai Backman1-5/+4
the location. remove last remnants of broken -l flag. R=rsc CC=golang-dev http://codereview.appspot.com/201042
2010-02-03ld: include main and runtime in the library loopRuss Cox1-1/+1
Fixes issue 585. R=r CC=golang-dev http://codereview.appspot.com/195075
2010-01-27change print print buffer sizeKen Thompson1-3/+3
to go with the full path names R=rsc CC=golang-dev http://codereview.appspot.com/195079
2010-01-255l, 6l, 8l: accept only one object fileRuss Cox1-5/+4
(package main; others are pulled in automatically) R=ken2 CC=golang-dev http://codereview.appspot.com/194069
2010-01-25ld: do not load the same object file multiple times.Russ Cox1-0/+6
eliminates spurious multiple initialization errors. give more information in the multiple init errors that remain. Fixes issue 87. R=r CC=golang-dev http://codereview.appspot.com/194052
2010-01-22eliminate the package global name space assumption in object filesRuss Cox1-4/+8
5g/6g/8g: add import statements to export metadata, mapping package path to package name. recognize "" as the path of the package in export metadata. use "" as the path of the package in object symbol names. 5c/6c/8c, 5a/6a/8a: rewrite leading . to "". so that ·Sin means Sin in this package. 5l/6l/8l: rewrite "" in symbol names as object files are read. gotest: handle new symbol names. gopack: handle new import lines in export metadata. Collectively, these changes eliminate the assumption of a global name space in the object file formats. Higher level pieces such as reflect and the computation of type hashes still depend on the assumption; we're not done yet. R=ken2, r, ken3 CC=golang-dev http://codereview.appspot.com/186263 Committer: Russ Cox <rsc@golang.org>
2010-01-19cleanup toward eliminating package global name spaceRuss Cox1-11/+11
* switch to real dot (.) instead of center dot (·) everywhere in object files. before it was half and half depending on where in the name it appeared. * in 6c/6a/etc identifiers, · can still be used but turns into . immediately. * in export metadata, replace package identifiers with quoted strings (still package names, not paths). R=ken2, r CC=golang-dev http://codereview.appspot.com/190076
2009-12-076l, 8l: make string buffer big enough for 8 chars (and then some)Russ Cox1-1/+1
Fixes issue 221. R=ken2 http://codereview.appspot.com/165086
2009-11-23go: makes it build for the case $GOROOT has whitespacesSergio Luis O. B. Correia1-2/+2
the bash scripts and makefiles for building go didn't take into account the fact $GOROOT / $GOBIN could both be directories containing whitespaces, and was not possible to build it in such a situation. this commit adjusts the various makefiles/scripts to make it aware of that possibility, and now it builds successfully when using a path with whitespaces as well. Fixes issue 115. R=rsc, dsymonds1 http://codereview.appspot.com/157067 Committer: Russ Cox <rsc@golang.org>
2009-11-18More FreeBSD-touchups. Thundercats are GOOOOO!Devon H. O'Dell1-3/+2
R=rsc CC=golang-dev http://codereview.appspot.com/157074 Committer: Russ Cox <rsc@golang.org>
2009-11-186l, 8l: add trivial hash table for dynamic symbolsRuss Cox1-18/+21
R=r http://codereview.appspot.com/156085
2009-11-18ld: move interpreter string into first block of ELF fileRuss Cox1-15/+10
necessary on freebsd. R=r, dho CC=golang-dev http://codereview.appspot.com/157069
2009-11-17fix botchKen Thompson1-1270/+0
R=rsc http://codereview.appspot.com/157046
2009-11-17change a n^2 algorithm inKen Thompson1-2/+1385
data initialization to n*log(n) R=rsc http://codereview.appspot.com/158041
2009-11-17FreeBSD-specific porting work.Devon H. O'Dell2-2/+21
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 http://codereview.appspot.com/152142 Committer: Russ Cox <rsc@golang.org>
2009-11-166l: fix divide by zero in glibc linker.Russ Cox1-5/+12
repeats 8l change http://code.google.com/p/go/source/detail?r=7594e16b5cf9 Fixes issue 179. R=iant http://codereview.appspot.com/154145
2009-11-09tweak documentation of commandsRuss Cox1-1/+1
so that first sentence is better for cmd page. live at http://r45:3456/cmd/ R=gri, r http://go/go-review/1024034
2009-11-05gofmt'ed 6l 8l cgoRobert Griesemer1-1/+1
R=r http://go/go-review/1020002
2009-11-04speed up 6lKen Thompson5-46/+126
hopefully no change R=rsc http://go/go-review/1017035
2009-11-03document the gc go compilers.Rob Pike1-0/+2
fix the usage message. R=rsc CC=go-dev http://go/go-review/1016033
2009-11-03more command documentation, including nm and profRob Pike1-1/+1
R=rsc http://go/go-review/1017022
2009-11-03document the assemblers.Rob Pike1-0/+7
add details about -d and -e flags in the loaders. R=rsc CC=go-dev http://go/go-review/1018031
2009-11-03First steps at command documentation: C compilers and linkers.Rob Pike1-0/+32
Each command gets a doc.go file for godoc to analyze. Its main element is a package comment. R=rsc CC=go-dev http://go/go-review/1018029
2009-11-036l -e: emit external ELF symbol table.Russ Cox3-15/+139
enough to make nm and oprofile work. R=r http://go/go-review/1017016
2009-10-15rename sys functions to runtime,Russ Cox1-11/+11
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-12stack overflow debugging and fix.Russ Cox1-6/+44
* 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-07factor portable object+library bits out of 5l/6l/8l into ldRuss Cox10-706/+26
R=r DELTA=3214 (904 added, 2260 deleted, 50 changed) OCL=35425 CL=35427
2009-10-05allow multiple -L optionsRob Pike2-9/+16
R=rsc DELTA=31 (15 added, 3 deleted, 13 changed) OCL=35364 CL=35364
2009-10-03clean moreRuss Cox1-1/+1
R=r DELTA=40 (9 added, 3 deleted, 28 changed) OCL=35277 CL=35305
2009-10-038c, 8l dynamic loading support.Russ Cox5-96/+36
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-09-30step toward darwin ffi: factor out macho codeRuss Cox4-185/+99
R=r DELTA=771 (374 added, 287 deleted, 110 changed) OCL=35187 CL=35187
2009-09-24convert 8l to new ELF code.Russ Cox1-86/+39
mostly cut and paste from 6l. R=r DELTA=930 (525 added, 182 deleted, 223 changed) OCL=34976 CL=34976
2009-09-16use /bin/ed to avoid portability issuesRob Pike1-1/+1
R=rsc DELTA=1 (0 added, 0 deleted, 1 changed) OCL=34696 CL=34700
2009-08-30fix line numbers, again.Russ Cox2-1/+7
if first function in file was dead code, it was being discarded along with the file name information for that file. leave the functions in the master function list longer: let xfol take the dead code out of the code list, and let span skip the unreachable functions during output. before throw: sys·mapaccess1: key not in map panic PC=0x2e7b20 throw+0x33 /Users/rsc/go/src/pkg/runtime/runtime.c:65 throw(0x5834f, 0x0) sys·mapaccess1+0x73 /Users/rsc/go/src/pkg/runtime/hashmap.c:769 sys·mapaccess1(0x2b9bd0, 0x0) gob·*Encoder·Encode+0x16b /Users/rsc/go/src/pkg/fmt/print.go:2926 gob·*Encoder·Encode(0x2bb440, 0x0, 0x558b0, 0x0, 0x2e4be0, ...) main·walk+0x331 :1603 main·walk(0x33a480, 0x0) main·walk+0x271 :1596 main·walk(0x300640, 0x0) main·walk+0x271 :1596 main·walk(0x300520, 0x0) main·walk+0x271 :1596 main·walk(0x300240, 0x0) main·walk+0x271 :1596 main·walk(0x678f8, 0x0) main·main+0x22 :1610 main·main() after throw: sys·mapaccess1: key not in map panic PC=0x2e7b20 throw+0x33 /Users/rsc/go/src/pkg/runtime/runtime.c:65 throw(0x5834f, 0x0) sys·mapaccess1+0x73 /Users/rsc/go/src/pkg/runtime/hashmap.c:769 sys·mapaccess1(0x2b9bd0, 0x0) gob·*Encoder·Encode+0x16b /Users/rsc/go/src/pkg/gob/encoder.go:319 gob·*Encoder·Encode(0x2bb3c0, 0x0, 0x558b0, 0x0, 0x2e4be0, ...) main·walk+0x331 /Users/rsc/dir.go:121 main·walk(0x2f6ab0, 0x0) main·walk+0x271 /Users/rsc/dir.go:114 main·walk(0x301640, 0x0) main·walk+0x271 /Users/rsc/dir.go:114 main·walk(0x301520, 0x0) main·walk+0x271 /Users/rsc/dir.go:114 main·walk(0x301240, 0x0) main·walk+0x271 /Users/rsc/dir.go:114 main·walk(0x678f8, 0x0) main·main+0x22 /Users/rsc/dir.go:128 main·main() mainstart+0xe /Users/rsc/go/src/pkg/runtime/amd64/asm.s:55 mainstart() goexit /Users/rsc/go/src/pkg/runtime/proc.c:133 goexit() R=r DELTA=46 (20 added, 25 deleted, 1 changed) OCL=34094 CL=34103
2009-08-24ffi -> dynld.Russ Cox2-16/+8
move out of export data into its own section R=r DELTA=222 (71 added, 99 deleted, 52 changed) OCL=33801 CL=33808
2009-08-24linker workRuss Cox2-22/+57
* use //ffi comments in package import data to generate relocation entries and library loads. * call initffi in rt0.s if present R=r DELTA=117 (91 added, 3 deleted, 23 changed) OCL=33739 CL=33750
2009-08-23linker workRuss Cox1-55/+67
* more elf constants from FreeBSD * simple relocation demo R=r DELTA=410 (354 added, 49 deleted, 7 changed) OCL=33689 CL=33729