aboutsummaryrefslogtreecommitdiff
path: root/src/liblink/obj9.c
AgeCommit message (Collapse)Author
2015-02-26liblink: delete unused codeRuss Cox
Liblink is still needed for the linker (for a bit longer) but mostly not. Delete the unused parts. Change-Id: Ie63a7c1520dee52b17425b384943cd16262d36e3 Reviewed-on: https://go-review.googlesource.com/6110 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-02-03liblink: define fixed A-numbers for common instructionsRuss Cox
This makes names like ANOP, ATEXT, AGLOBL, ACALL, AJMP, ARET available for use by architecture-independent processing passes. On arm and ppc64, the alternate names are now aliases for the official ones (ABL for ACALL, AB or ABR for AJMP, ARETURN for ARET). Change-Id: Id027771243795af2b3745199c645b6e1bedd7d18 Reviewed-on: https://go-review.googlesource.com/3577 Reviewed-by: Aram Hăvărneanu <aram@mgk.ro> Reviewed-by: Austin Clements <austin@google.com>
2015-02-03liblink: place DATA size in from3.offset alwaysRuss Cox
Like the TEXT/GLOBL flags, this was split between from.scale and reg, neither of which is appropriate. Change-Id: I2a16ef066a53b6edb7afb16cce108c0d1d26389c Reviewed-on: https://go-review.googlesource.com/3576 Reviewed-by: Aram Hăvărneanu <aram@mgk.ro> Reviewed-by: Austin Clements <austin@google.com>
2015-02-03liblink: the zero Prog is now valid and ready for useRuss Cox
Use AXXX instead of AGOK (neither is a valid instruction but AXXX is zero) for the initial setting of Prog.as, and now there are no non-zero default field settings. Remove the arch-specific zprog/zprg in favor of a single global zprog. Remove the arch-specific prg constructor in favor of emallocz(sizeof(Prog)). Change-Id: Ia73078726768333d7cdba296f548170c1bea9498 Reviewed-on: https://go-review.googlesource.com/3575 Reviewed-by: Aram Hăvărneanu <aram@mgk.ro> Reviewed-by: Austin Clements <austin@google.com>
2015-02-03liblink: place TEXT/GLOBL flags in p->from3 alwaysRuss Cox
Before, amd64 and 386 stored the flags in p->from.scale and arm and ppc64 stored the flags in p->reg. Both caused special cases in printing and in handling of the addresses. To avoid possible conflicts with the real meaning of p->from and to avoid storing a non-register value in a reg field, use from3 to hold a TYPE_CONST value giving the flags. There is still a special case for printing, because the flags are specified without a $, and normally a TYPE_CONST prints with a $. But that's much less special than what came before. This allows us to remove the textflag and settextflag methods from LinkArch. They are no longer architecture-specific. Change-Id: I931da8e1ecd92e127cd9aa44ef5a73c42e730110 Reviewed-on: https://go-review.googlesource.com/3572 Reviewed-by: Austin Clements <austin@google.com>
2015-02-03liblink: use same TEXT $frame-arg encoding for all architecturesRuss Cox
Change-Id: I3417a8c5ddd7f405939edc9fdef086e4741495a1 Reviewed-on: https://go-review.googlesource.com/3571 Reviewed-by: Austin Clements <austin@google.com>
2015-01-30cmd/9a, cmd/9g, cmd/9l, liblink: update for portable Prog, AddrRuss Cox
Change-Id: I55afed0eabf3c38e72ff105294782ac36446b66b Reviewed-on: https://go-review.googlesource.com/3519 Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
2015-01-14liblink: adjustments for c2go conversionRuss Cox
Mostly this is using uint32 instead of int32 for unsigned values like instruction encodings or float32 bit representations, removal of ternary operations, and removal of #defines. Delete sched9.c, because it is not compiled (it is still in the history if we ever need it). Change-Id: I68579cfea679438a27a80416727a9af932b088ae Reviewed-on: https://go-review.googlesource.com/2658 Reviewed-by: Austin Clements <austin@google.com>
2015-01-05Revert "liblink, cmd/ld, runtime: remove stackguard1"Russ Cox
This reverts commit ab0535ae3fb45ba734d47542cc4845f27f708d1b. I think it will remain useful to distinguish code that must run on a system stack from code that can run on either stack, even if that distinction is no longer based on the implementation language. That is, I expect to add a //go:systemstack comment that, in terms of the old implementation, tells the compiler, to pretend this function was written in C. Change-Id: I33d2ebb2f99ae12496484c6ec8ed07233d693275 Reviewed-on: https://go-review.googlesource.com/2275 Reviewed-by: Russ Cox <rsc@golang.org>
2014-12-29liblink, cmd/ld, runtime: remove stackguard1Shenghou Ma
Now that we've removed all the C code in runtime and the C compilers, there is no need to have a separate stackguard field to check for C code on Go stack. Remove field g.stackguard1 and rename g.stackguard0 to g.stackguard. Adjust liblink and cmd/ld as necessary. Change-Id: I54e75db5a93d783e86af5ff1a6cd497d669d8d33 Reviewed-on: https://go-review.googlesource.com/2144 Reviewed-by: Keith Randall <khr@golang.org>
2014-12-22liblink: code for debugging bad returnsAustin Clements
Disabled by default, but invaluable when you need it. Change-Id: If4a75d11d14f70b6840d339aaec4b940dc406493 Reviewed-on: https://go-review.googlesource.com/2012 Reviewed-by: Russ Cox <rsc@golang.org>
2014-12-18liblink: generate correct code for MOVD $-n(Rm), x on ppc64Austin Clements
On ppc64, liblink rewrites MOVD's of >32-bit constants by putting the constant in memory and rewriting the MOVD to load from that memory address. However, there were two bugs in the condition: a) owing to an incorrect sign extension, it triggered for all negative constants, and b) it could trigger for constant offsets from registers (addresses of the form $n(Rm) in assembly) Together, these meant instructions of the form MOVD $-n(Rm), x were compiled by putting -n in memory and rewriting the MOVD to load this constant from memory (completely dropping Rm). Change-Id: I1f6cc980efa3e3d6f164b46c985b2c3b55971cca Reviewed-on: https://go-review.googlesource.com/1752 Reviewed-by: Minux Ma <minux@golang.org>
2014-12-05all: power64 is now ppc64Russ Cox
Fixes #8654. LGTM=austin R=austin CC=golang-codereviews https://golang.org/cl/180600043
2014-11-14[dev.cc] liblink: fix warnings on Plan 9David du Colombier
warning: src/liblink/asm9.c:501 set and not used: bflag warning: src/liblink/list9.c:259 format mismatch .5lux INT, arg 4 warning: src/liblink/list9.c:261 format mismatch .5lux INT, arg 3 warning: src/liblink/list9.c:319 more arguments than format VLONG warning: src/liblink/obj9.c:222 set and not used: autoffset LGTM=bradfitz, austin R=rsc, bradfitz CC=austin, golang-codereviews https://golang.org/cl/175070043
2014-10-28[dev.power64] liblink: emit wrapper code in correct placeAustin Clements
The wrapper code was being emitted before the stack reservation, rather than after. LGTM=rsc R=rsc, dave CC=golang-codereviews https://golang.org/cl/161540043
2014-10-27[dev.power64] liblink: fix lost branch targetAustin Clements
A recent commit lost the branch target in the really-big-stack case of splitstack, causing an infinite loop stack preempt case. Revive the branch target. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/157790044
2014-10-27[dev.power64] liblink: power64 fixes and ports of changesAustin Clements
Ports of platform-specific changes that happened on default after dev.power64 forked (fixes for c2go, wrapper math fixes, moved stackguard field, stackguard1 support, precise stacks). Bug fixes (missing AMOVW in instruction table, correct unsigned 32-bit remainder). LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/164920044
2014-10-22build: merge the great pkg/ rename into dev.power64Austin Clements
This also removes pkg/runtime/traceback_lr.c, which was ported to Go in an earlier commit and then moved to runtime/traceback.go. Reviewer: rsc@golang.org rsc: LGTM
2014-08-18[dev.power64] liblink: recognize add instruction as adjusting SPRuss Cox
LGTM=minux R=minux CC=golang-codereviews https://golang.org/cl/128360043
2014-08-15[dev.power64] liblink: fix g->panicwrap update code generationShenghou Ma
LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://golang.org/cl/123400043
2014-08-13[dev.power64] liblink: fix handling of MOVD with large constantsRuss Cox
LGTM=minux R=golang-codereviews, minux CC=golang-codereviews https://golang.org/cl/122540043
2014-08-13[dev.power64] liblink: rewrite MOVD $con(Ra), Rb into ADD $con, Ra, Rb; fix ↵Shenghou Ma
stack split prologue LGTM=rsc R=rsc, iant CC=golang-codereviews https://golang.org/cl/129050043
2014-08-12[dev.power64] liblink: disable stack split for nowShenghou Ma
LGTM=rsc R=rsc, iant CC=golang-codereviews https://golang.org/cl/122460043
2014-08-12[dev.power64] liblink: support stack split, long conditional branchesShenghou Ma
LGTM=rsc R=rsc, iant CC=golang-codereviews https://golang.org/cl/123300043
2014-08-07[dev.power64] include/link.h, liblink: convert 9l functions to liblinkShenghou Ma
This replaces CL 122990043. LGTM=rsc R=rsc, iant CC=golang-codereviews https://golang.org/cl/123010043
2014-08-07[dev.power64] liblink: move span and asmout related function from obj9.c to ↵Shenghou Ma
asm9.c To reduce delta for the upcoming liblink CL. Just code movement, no semantic changes. LGTM=rsc R=rsc, iant CC=golang-codereviews https://golang.org/cl/124830043
2014-08-06[dev.power64] cmd/9a, cmd/9c, cmd/9l, liblink: import code from Vita Nuova.Shenghou Ma
No modifications other than adding copyright header to each file, and concatenating several cmd/9l files together to form the liblink files. LGTM=rsc R=rsc, iant CC=golang-codereviews https://golang.org/cl/123840043