summaryrefslogtreecommitdiff
path: root/src/liblink
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2014-02-09 16:45:38 -0500
committerShenghou Ma <minux.ma@gmail.com>2014-02-09 16:45:38 -0500
commitdcb4a6132d446afa527ff2bbf9e5dcd9600042c9 (patch)
treeb269b431f1fce3b1bcaec0e6567ab8a7cd10441a /src/liblink
parente56c42d7f7578c100a0c02889fad65b075a459b4 (diff)
downloadgo-dcb4a6132d446afa527ff2bbf9e5dcd9600042c9.tar.gz
include, linlink, cmd/6l, cmd/ld: part 1 of solaris/amd64 linker changes.
rsc suggested that we split the whole linker changes into three parts. This is the first one, mostly dealing with adding Hsolaris. LGTM=iant R=golang-codereviews, iant, dave CC=golang-codereviews https://codereview.appspot.com/54210050
Diffstat (limited to 'src/liblink')
-rw-r--r--src/liblink/obj6.c6
-rw-r--r--src/liblink/sym.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/liblink/obj6.c b/src/liblink/obj6.c
index 6bb65a286..e8967f3ec 100644
--- a/src/liblink/obj6.c
+++ b/src/liblink/obj6.c
@@ -137,7 +137,8 @@ progedit(Link *ctxt, Prog *p)
}
if(ctxt->headtype == Hlinux || ctxt->headtype == Hfreebsd
|| ctxt->headtype == Hopenbsd || ctxt->headtype == Hnetbsd
- || ctxt->headtype == Hplan9 || ctxt->headtype == Hdragonfly) {
+ || ctxt->headtype == Hplan9 || ctxt->headtype == Hdragonfly
+ || ctxt->headtype == Hsolaris) {
// ELF uses FS instead of GS.
if(p->from.type == D_INDIR+D_GS)
p->from.type = D_INDIR+D_FS;
@@ -577,7 +578,8 @@ load_g_cx(Link *ctxt, Prog *p)
p->as = AMOVQ;
if(ctxt->headtype == Hlinux || ctxt->headtype == Hfreebsd
|| ctxt->headtype == Hopenbsd || ctxt->headtype == Hnetbsd
- || ctxt->headtype == Hplan9 || ctxt->headtype == Hdragonfly)
+ || ctxt->headtype == Hplan9 || ctxt->headtype == Hdragonfly
+ || ctxt->headtype == Hsolaris)
// ELF uses FS
p->from.type = D_INDIR+D_FS;
else
diff --git a/src/liblink/sym.c b/src/liblink/sym.c
index e2527da3a..7ff64350d 100644
--- a/src/liblink/sym.c
+++ b/src/liblink/sym.c
@@ -52,6 +52,7 @@ static struct {
"netbsd", Hnetbsd,
"openbsd", Hopenbsd,
"plan9", Hplan9,
+ "solaris", Hsolaris,
"windows", Hwindows,
"windowsgui", Hwindows,
0, 0
@@ -129,6 +130,7 @@ linknew(LinkArch *arch)
case Hnetbsd:
case Hopenbsd:
case Hdragonfly:
+ case Hsolaris:
/*
* ELF uses TLS offset negative from FS.
* Translate 0(FS) and 8(FS) into -16(FS) and -8(FS).