summaryrefslogtreecommitdiff
path: root/src/cmd/link
Commit message (Collapse)AuthorAgeFilesLines
* cmd/{ld,link,objdump}, runtime, debug/gosym: move linker-defined symbols ↵Matthew Dempsky2014-08-2712-42/+41
| | | | | | | | | | | | | into runtime package Fixes issue 8092. LGTM=rsc R=iant, rsc CC=golang-codereviews https://codereview.appspot.com/126790043 Committer: Russ Cox <rsc@golang.org>
* cmd/link: fix testdata generationMatthew Dempsky2014-08-249-8/+11
| | | | | | | | | | | Fixes issue 8494. LGTM=rsc R=golang-codereviews, gobot, rsc, evankroske CC=golang-codereviews https://codereview.appspot.com/123040043 Committer: Russ Cox <rsc@golang.org>
* all: copy cmd/ld/textflag.h into pkg/GOOS_GOARCHRob Pike2014-08-122-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The file is used by assembly code to define symbols like NOSPLIT. Having it hidden inside the cmd directory makes it hard to access outside the standard repository. Solution: As with a couple of other files used by cgo, copy the file into the pkg directory and add a -I argument to the assembler to access it. Thus one can write just #include "textflag.h" in .s files. The names in runtime are not updated because in the boot sequence the file has not been copied yet when runtime is built. All other .s files in the repository are updated. Changes to doc/asm.html, src/cmd/dist/build.c, and src/cmd/go/build.go are hand-made. The rest are just the renaming done by a global substitution. (Yay sam). LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/128050043
* cmd/link: fix zig-zag decodingMatthew Dempsky2014-08-111-1/+1
| | | | | | | | | | | | | | | | | The >>1 shift needs to happen before converting to int32, otherwise large values will decode with an incorrect sign bit. The <<31 shift can happen before or after, but before is consistent with liblink and the go12symtab doc. Bug demo at http://play.golang.org/p/jLrhPUakIu LGTM=rsc R=golang-codereviews, minux, rsc CC=golang-codereviews https://codereview.appspot.com/119630043 Committer: Russ Cox <rsc@golang.org>
* src: fix issues found by go vet stdRobert Hencke2014-04-263-5/+5
| | | | | | | | | LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/96850043 Committer: Ian Lance Taylor <iant@golang.org>
* liblink, cmd/ld: reenable nosplit checking and testRuss Cox2014-04-167-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The new code is adapted from the Go 1.2 nosplit code, but it does not have the bug reported in issue 7623: g% go run nosplit.go g% go1.2 run nosplit.go BUG rejected incorrectly: main 0 call f; f 120 linker output: # _/tmp/go-test-nosplit021064539 main.main: nosplit stack overflow 120 guaranteed after split check in main.main 112 on entry to main.f -8 after main.f uses 120 g% Fixes issue 6931. Fixes issue 7623. LGTM=iant R=golang-codereviews, iant, ality CC=golang-codereviews, r https://codereview.appspot.com/88190043
* liblink: add leaf bit to object file formatRuss Cox2014-04-166-0/+0
| | | | | | | | | | | | | | Without the leaf bit, the linker cannot record the correct frame size in the symbol table, and then stack traces get mangled. (Only for ARM.) Fixes issue 7338. Fixes issue 7347. LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/88550043
* liblink: remove arch-specific constants from file formatRuss Cox2014-04-148-13/+7
| | | | | | | | | | | | | | | | The relocation and automatic variable types were using arch-specific numbers. Introduce portable enumerations instead. To the best of my knowledge, these are the only arch-specific bits left in the new object file format. Remove now, before Go 1.3, because file formats are forever. LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/87670044
* liblink, cmd/link: add version number to object fileRuss Cox2014-04-148-7/+12
| | | | | | | | | | There are changes we know we want to make, but not before Go 1.3 Add a version number so that we can make them more easily later. LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/87670043
* cmd/link: change cloneProg to return the cloned valueRick Arnold2014-02-181-1/+1
| | | | | | | | | | | | | | The code was returning the original value rather than the cloned value resulting in the tests not being repeatable. Fixes issue 7111. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/65720045 Committer: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/link: fix comment typo.Nigel Tao2014-02-181-1/+0
| | | | | | | LGTM=dsymonds R=dsymonds CC=golang-codereviews https://codereview.appspot.com/64100045
* cmd/link: add testdata/pclntab.6 (fix build)Russ Cox2014-01-211-0/+0
| | | | | | | | | Sorry, "hg status" hides .6 files by default. We should probably fix that. TBR=iant CC=golang-codereviews https://codereview.appspot.com/55290043
* cmd/link: pclntab generationRuss Cox2014-01-218-16/+2744
| | | | | | R=iant CC=golang-codereviews https://codereview.appspot.com/53820043
* cmd/link: fix buildRuss Cox2014-01-131-38/+16
| | | | | | | | | | The golden file for link.hello.darwin.amd64 was a little ahead of the checked-in code. R=iant TBR=iant CC=golang-codereviews https://codereview.appspot.com/51870043
* cmd/link: implement dead code removalRuss Cox2014-01-134-0/+209
| | | | | | R=iant CC=golang-codereviews https://codereview.appspot.com/51470043
* cmd/link: implement and test automatic symbolsRuss Cox2014-01-1317-56/+557
| | | | | | | | | | | | | | Related changes included in this CL: - Add explicit start symbol to Prog. - Add omitRuntime bool to Prog. - Introduce p.Packages[""] to hold automatic symbols - Add SymOrder to Prog to preserve symbol order. - Add layout test (and fix bug that was putting everything in text section). R=iant CC=golang-codereviews https://codereview.appspot.com/51260045
* cmd/link: replace golden binary files with hex dumpsRuss Cox2014-01-136-5/+81
| | | | | | | | | | | | | The hex dumps will diff better, and I hope they will avoid a repeat of http://bugs.debian.org/716853. The CL will probably show the testdata diffs as "binary", but in fact the binary versions are being replaced by textual hex dumps (output of hexdump -C). R=iant CC=golang-codereviews https://codereview.appspot.com/51000044
* cmd/link: Mach-O (OS X) file formatterRuss Cox2014-01-095-0/+788
| | | | | | | | See CL 48870044 for basic structure. R=iant CC=golang-codereviews https://codereview.appspot.com/48910043
* cmd/link: intial skeleton of linker written in GoRuss Cox2014-01-0915-0/+832
R=iant CC=golang-codereviews https://codereview.appspot.com/48870044