summaryrefslogtreecommitdiff
path: root/src/cmd/8l
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-02-27 20:37:00 -0500
committerRuss Cox <rsc@golang.org>2014-02-27 20:37:00 -0500
commit7d945de10bfc48118799dbfc8dabf50954074b38 (patch)
tree40abe92a9fb62456630a51d27c32ea726af4be35 /src/cmd/8l
parente88dfc14e2bcc8c151af8d6c3264e2704698281e (diff)
downloadgo-7d945de10bfc48118799dbfc8dabf50954074b38.tar.gz
all: final merge of NaCl tree
This CL replays the following one CL from the rsc-go13nacl repo. This is the last replay CL: after this CL the main repo will have everything the rsc-go13nacl repo did. Changes made to the main repo after the rsc-go13nacl repo branched off probably mean that NaCl doesn't actually work after this CL, but all the code is now moved over and just needs to be redebugged. --- cmd/6l, cmd/8l, cmd/ld: support for Native Client See golang.org/s/go13nacl for design overview. This CL is publicly visible but not CC'ed to golang-dev, to avoid distracting from the preparation of the Go 1.2 release. This CL and the others will be checked into my rsc-go13nacl clone repo for now, and I will send CLs against the main repo early in the Go 1.3 development. R?khr https://codereview.appspot.com/15750044 --- LGTM=bradfitz, dave, iant R=dave, bradfitz, iant CC=golang-codereviews https://codereview.appspot.com/69040044
Diffstat (limited to 'src/cmd/8l')
-rw-r--r--src/cmd/8l/asm.c1
-rw-r--r--src/cmd/8l/l.h1
-rw-r--r--src/cmd/8l/obj.c18
3 files changed, 20 insertions, 0 deletions
diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c
index 03f9e95c9..cc4ec564b 100644
--- a/src/cmd/8l/asm.c
+++ b/src/cmd/8l/asm.c
@@ -696,6 +696,7 @@ asmb(void)
case Hnetbsd:
case Hopenbsd:
case Hdragonfly:
+ case Hnacl:
asmbelf(symo);
break;
case Hwindows:
diff --git a/src/cmd/8l/l.h b/src/cmd/8l/l.h
index f19c570c8..c9695ade0 100644
--- a/src/cmd/8l/l.h
+++ b/src/cmd/8l/l.h
@@ -43,6 +43,7 @@ enum
thechar = '8',
PtrSize = 4,
IntSize = 4,
+ RegSize = 4,
MaxAlign = 32, // max data alignment
FuncAlign = 16
};
diff --git a/src/cmd/8l/obj.c b/src/cmd/8l/obj.c
index 8acb5cab1..ddbd96aa0 100644
--- a/src/cmd/8l/obj.c
+++ b/src/cmd/8l/obj.c
@@ -42,6 +42,11 @@ char* thestring = "386";
LinkArch* thelinkarch = &link386;
void
+linkarchinit(void)
+{
+}
+
+void
archinit(void)
{
// getgoextlinkenabled is based on GO_EXTLINK_ENABLED when
@@ -104,6 +109,19 @@ archinit(void)
if(INITRND == -1)
INITRND = 4096;
break;
+
+ case Hnacl:
+ elfinit();
+ HEADR = 0x10000;
+ funcalign = 32;
+ if(INITTEXT == -1)
+ INITTEXT = 0x20000;
+ if(INITDAT == -1)
+ INITDAT = 0;
+ if(INITRND == -1)
+ INITRND = 0x10000;
+ break;
+
case Hwindows: /* PE executable */
peinit();
HEADR = PEFILEHEADR;