Commit f4ecfaa4 authored by Ian Lance Taylor's avatar Ian Lance Taylor

liblink: remove code that is never executed

This code tests linkmode == LinkExternal but is only invoked
by the compiler/assembler, not the linker.

Update #7164

LGTM=rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/85080043
parent 78025fb2
......@@ -2415,21 +2415,6 @@ putrelv:
r = addrel(ctxt->cursym);
*r = rel;
r->off = ctxt->curp->pc + ctxt->andptr - ctxt->and;
} else if(ctxt->iself && ctxt->linkmode == LinkExternal && a->type == D_INDIR+D_FS
&& ctxt->headtype != Hopenbsd) {
Reloc *r;
LSym *s;
r = addrel(ctxt->cursym);
r->off = ctxt->curp->pc + ctxt->andptr - ctxt->and;
r->add = a->offset - ctxt->tlsoffset;
r->xadd = r->add;
r->siz = 4;
r->type = D_TLS;
s = linklookup(ctxt, "runtime.tlsgm", 0);
r->sym = s;
r->xsym = s;
v = 0;
}
put4(ctxt, v);
......
......@@ -1728,14 +1728,6 @@ vaddr(Link *ctxt, Addr *a, Reloc *r)
return v;
}
static int
istls(Link *ctxt, Addr *a)
{
if(ctxt->headtype == Hlinux || ctxt->headtype == Hnacl)
return a->index == D_GS;
return a->type == D_INDIR+D_GS;
}
static void
asmand(Link *ctxt, Addr *a, int r)
{
......@@ -1857,20 +1849,6 @@ putrelv:
r = addrel(ctxt->cursym);
*r = rel;
r->off = ctxt->curp->pc + ctxt->andptr - ctxt->and;
} else if(ctxt->iself && ctxt->linkmode == LinkExternal && istls(ctxt, a) && ctxt->headtype != Hopenbsd) {
Reloc *r;
LSym *s;
r = addrel(ctxt->cursym);
r->off = ctxt->curp->pc + ctxt->andptr - ctxt->and;
r->add = a->offset - ctxt->tlsoffset;
r->xadd = r->add;
r->siz = 4;
r->type = D_TLS;
s = linklookup(ctxt, "runtime.tlsgm", 0);
r->sym = s;
r->xsym = s;
v = 0;
}
put4(ctxt, v);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment