aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoel Sing <jsing@google.com>2011-08-26 15:39:23 -0400
committerRuss Cox <rsc@golang.org>2011-08-26 15:39:23 -0400
commit26d9c804f837398eef1d09d6224de59e37d1cbca (patch)
tree9f578ef365a82bf6e2caed7aa5aa05a0741aa4f2 /src
parent582f6d4fd7d094a79c506a465df6330f30b9863b (diff)
downloadgo-26d9c804f837398eef1d09d6224de59e37d1cbca.tar.xz
8l: add openbsd
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4972043
Diffstat (limited to 'src')
-rw-r--r--src/cmd/8l/asm.c9
-rw-r--r--src/cmd/8l/doc.go2
-rw-r--r--src/cmd/8l/obj.c3
3 files changed, 13 insertions, 1 deletions
diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c
index 22abd80491..518951fdee 100644
--- a/src/cmd/8l/asm.c
+++ b/src/cmd/8l/asm.c
@@ -41,6 +41,7 @@
char linuxdynld[] = "/lib/ld-linux.so.2";
char freebsddynld[] = "/usr/libexec/ld-elf.so.1";
+char openbsddynld[] = "/usr/libexec/ld.so";
int32
entryvalue(void)
@@ -956,6 +957,9 @@ asmb(void)
case Hfreebsd:
interpreter = freebsddynld;
break;
+ case Hopenbsd:
+ interpreter = openbsddynld;
+ break;
}
}
elfinterp(sh, startva, interpreter);
@@ -1122,7 +1126,10 @@ asmb(void)
eh->ident[EI_VERSION] = EV_CURRENT;
switch(HEADTYPE) {
case Hfreebsd:
- eh->ident[EI_OSABI] = 9;
+ eh->ident[EI_OSABI] = ELFOSABI_FREEBSD;
+ break;
+ case Hopenbsd:
+ eh->ident[EI_OSABI] = ELFOSABI_OPENBSD;
break;
}
diff --git a/src/cmd/8l/doc.go b/src/cmd/8l/doc.go
index b708889078..de877bb243 100644
--- a/src/cmd/8l/doc.go
+++ b/src/cmd/8l/doc.go
@@ -33,6 +33,8 @@ Options new in this version:
Write Linux ELF binaries (default when $GOOS is linux)
-Hfreebsd
Write FreeBSD ELF binaries (default when $GOOS is freebsd)
+-Hopenbsd
+ Write OpenBSD ELF binaries (default when $GOOS is openbsd)
-Hwindows
Write Windows PE32 binaries (default when $GOOS is windows)
-I interpreter
diff --git a/src/cmd/8l/obj.c b/src/cmd/8l/obj.c
index a8e1c34a53..297b5bed55 100644
--- a/src/cmd/8l/obj.c
+++ b/src/cmd/8l/obj.c
@@ -55,6 +55,7 @@ Header headers[] = {
"darwin", Hdarwin,
"linux", Hlinux,
"freebsd", Hfreebsd,
+ "openbsd", Hopenbsd,
"windows", Hwindows,
"windowsgui", Hwindows,
0, 0
@@ -69,6 +70,7 @@ Header headers[] = {
* -Hdarwin -Tx -Rx is Apple Mach-O
* -Hlinux -Tx -Rx is Linux ELF32
* -Hfreebsd -Tx -Rx is FreeBSD ELF32
+ * -Hopenbsd -Tx -Rx is OpenBSD ELF32
* -Hwindows -Tx -Rx is MS Windows PE32
*/
@@ -223,6 +225,7 @@ main(int argc, char *argv[])
break;
case Hlinux: /* elf32 executable */
case Hfreebsd:
+ case Hopenbsd:
/*
* ELF uses TLS offsets negative from %gs.
* Translate 0(GS) and 4(GS) into -8(GS) and -4(GS).