diff options
| author | Russ Cox <rsc@golang.org> | 2015-02-13 12:50:23 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-02-13 12:51:56 -0500 |
| commit | 87de9ce212988c8bdf0630750e772d8805091bcc (patch) | |
| tree | 0bb1cc671417e9b851d35a4bbcd4d756e5aee4e9 /src/liblink | |
| parent | 01925bd3f306c899cddfa59aa2ad41c9b77fcd74 (diff) | |
| parent | 5f1efe738be296cdbc586348af92eab621d068f5 (diff) | |
| download | go-87de9ce212988c8bdf0630750e772d8805091bcc.tar.xz | |
[dev.cc] all: merge master (5f1efe7) into dev.cc
Conflicts:
src/cmd/dist/build.go
Change-Id: I98a4b5e010bee91507b85bb8efd9c74e1a1f649c
Diffstat (limited to 'src/liblink')
| -rw-r--r-- | src/liblink/asm5.c | 16 | ||||
| -rw-r--r-- | src/liblink/go.c | 21 | ||||
| -rw-r--r-- | src/liblink/list5.c | 2 | ||||
| -rw-r--r-- | src/liblink/list6.c | 2 | ||||
| -rw-r--r-- | src/liblink/list8.c | 2 | ||||
| -rw-r--r-- | src/liblink/list9.c | 2 | ||||
| -rw-r--r-- | src/liblink/obj5.c | 10 | ||||
| -rw-r--r-- | src/liblink/obj6.c | 12 | ||||
| -rw-r--r-- | src/liblink/sym.c | 9 |
9 files changed, 38 insertions, 38 deletions
diff --git a/src/liblink/asm5.c b/src/liblink/asm5.c index 8d597750b7..398b7841c2 100644 --- a/src/liblink/asm5.c +++ b/src/liblink/asm5.c @@ -96,6 +96,7 @@ static Optab optab[] = { ABL, C_NONE, C_NONE, C_SBRA, 5, 4, 0 }, { ABX, C_NONE, C_NONE, C_SBRA, 74, 20, 0 }, { ABEQ, C_NONE, C_NONE, C_SBRA, 5, 4, 0 }, + { ABEQ, C_RCON, C_NONE, C_SBRA, 5, 4, 0 }, // prediction hinted form, hint ignored { AB, C_NONE, C_NONE, C_ROREG, 6, 4, 0, LPOOL }, { ABL, C_NONE, C_NONE, C_ROREG, 7, 4, 0 }, @@ -353,14 +354,6 @@ static uchar xcmp[C_GOK+1][C_GOK+1]; static LSym *deferreturn; -static void -nocache(Prog *p) -{ - p->optab = 0; - p->from.class = 0; - p->to.class = 0; -} - /* size of a case statement including jump table */ static int32 casesz(Link *ctxt, Prog *p) @@ -1638,8 +1631,11 @@ if(0 /*debug['G']*/) print("%ux: %s: arm %d\n", (uint32)(p->pc), p->from.sym->na // runtime.tlsg is special. // Its "address" is the offset from the TLS thread pointer // to the thread-local g and m pointers. - // Emit a TLS relocation instead of a standard one. - if(rel->sym == ctxt->tlsg) { + // Emit a TLS relocation instead of a standard one if its + // type is not explicitly set by runtime. This assumes that + // all references to runtime.tlsg should be accompanied with + // its type declaration if necessary. + if(rel->sym == ctxt->tlsg && ctxt->tlsg->type == 0) { rel->type = R_TLS; if(ctxt->flag_shared) rel->add += ctxt->pc - p->pcrel->pc - 8 - rel->siz; diff --git a/src/liblink/go.c b/src/liblink/go.c index 754a7cc15e..08ce82b30c 100644 --- a/src/liblink/go.c +++ b/src/liblink/go.c @@ -133,3 +133,24 @@ double2ieee(uint64 *ieee, float64 f) { memmove(ieee, &f, 8); } + +void +nopout(Prog *p) +{ + p->as = ANOP; + p->scond = zprog.scond; + p->from = zprog.from; + p->from3 = zprog.from3; + p->reg = zprog.reg; + p->to = zprog.to; +} + +void +nocache(Prog *p) +{ + p->optab = 0; + p->from.class = 0; + p->from3.class = 0; + p->to.class = 0; +} + diff --git a/src/liblink/list5.c b/src/liblink/list5.c index bca10f6899..3ea411d2b8 100644 --- a/src/liblink/list5.c +++ b/src/liblink/list5.c @@ -168,7 +168,7 @@ Dconv(Fmt *fp) if(a->u.argsize == ArgsSizeUnknown) sprint(str, "$%lld", a->offset); else - sprint(str, "$%lld-%lld", a->offset, a->u.argsize); + sprint(str, "$%lld-%d", a->offset, a->u.argsize); break; case TYPE_SHIFT: diff --git a/src/liblink/list6.c b/src/liblink/list6.c index d9e0b45c7a..b324ec89d6 100644 --- a/src/liblink/list6.c +++ b/src/liblink/list6.c @@ -206,7 +206,7 @@ Dconv(Fmt *fp) if(a->u.argsize == ArgsSizeUnknown) sprint(str, "$%lld", a->offset); else - sprint(str, "$%lld-%lld", a->offset, a->u.argsize); + sprint(str, "$%lld-%d", a->offset, a->u.argsize); break; case TYPE_FCONST: diff --git a/src/liblink/list8.c b/src/liblink/list8.c index dbba103280..07c1d7cd67 100644 --- a/src/liblink/list8.c +++ b/src/liblink/list8.c @@ -193,7 +193,7 @@ Dconv(Fmt *fp) if(a->u.argsize == ArgsSizeUnknown) sprint(str, "$%lld", a->offset); else - sprint(str, "$%lld-%lld", a->offset, a->u.argsize); + sprint(str, "$%lld-%d", a->offset, a->u.argsize); break; case TYPE_FCONST: diff --git a/src/liblink/list9.c b/src/liblink/list9.c index a45e73e61e..ac37bb566e 100644 --- a/src/liblink/list9.c +++ b/src/liblink/list9.c @@ -172,7 +172,7 @@ Dconv(Fmt *fp) if(a->u.argsize == ArgsSizeUnknown) sprint(str, "$%lld", a->offset); else - sprint(str, "$%lld-%lld", a->offset, a->u.argsize); + sprint(str, "$%lld-%d", a->offset, a->u.argsize); break; case TYPE_MEM: diff --git a/src/liblink/obj5.c b/src/liblink/obj5.c index 805d7a59c2..abddbc3c4f 100644 --- a/src/liblink/obj5.c +++ b/src/liblink/obj5.c @@ -185,14 +185,6 @@ linkcase(Prog *casep) } static void -nocache5(Prog *p) -{ - p->optab = 0; - p->from.class = 0; - p->to.class = 0; -} - -static void preprocess(Link *ctxt, LSym *cursym) { Prog *p, *pl, *p1, *p2, *q, *q1, *q2; @@ -478,7 +470,7 @@ preprocess(Link *ctxt, LSym *cursym) break; case ARET: - nocache5(p); + nocache(p); if(cursym->text->mark & LEAF) { if(!autosize) { p->as = AB; diff --git a/src/liblink/obj6.c b/src/liblink/obj6.c index cddc723bf2..546c89d53c 100644 --- a/src/liblink/obj6.c +++ b/src/liblink/obj6.c @@ -35,18 +35,6 @@ #include "../cmd/6l/6.out.h" #include "../runtime/stack.h" -static void -nopout(Prog *p) -{ - p->as = ANOP; - p->from.type = TYPE_NONE; - p->from.reg = 0; - p->from.name = 0; - p->to.type = TYPE_NONE; - p->to.reg = 0; - p->to.name = 0; -} - static void nacladdr(Link*, Prog*, Addr*); static int diff --git a/src/liblink/sym.c b/src/liblink/sym.c index 079f600aa9..cae7e4aafe 100644 --- a/src/liblink/sym.c +++ b/src/liblink/sym.c @@ -148,15 +148,15 @@ linknew(LinkArch *arch) switch(ctxt->arch->thechar) { default: sysfatal("unknown thread-local storage offset for nacl/%s", ctxt->arch->name); + case '5': + ctxt->tlsoffset = 0; + break; case '6': ctxt->tlsoffset = 0; break; case '8': ctxt->tlsoffset = -8; break; - case '5': - ctxt->tlsoffset = 0; - break; } break; @@ -174,6 +174,9 @@ linknew(LinkArch *arch) case '8': ctxt->tlsoffset = 0x468; break; + case '5': + ctxt->tlsoffset = 0; // dummy value, not needed + break; } break; } |
