1
0
mirror of https://github.com/golang/go synced 2024-11-23 20:30:04 -07:00

cmd/6l, cmd/internal/ld, cmd/internal/obj: remove Xsym/Xadd from compiler's Reloc

They don't really make any sense on this side of the compiler/linker divide.

Some of the code touching these fields was the support for R_TLS when
thechar=='6' which turns out to be dead and so I just removed all of that.

Change-Id: I4e265613c4e7fcc30a965fffb7fd5f45017f06f3
Reviewed-on: https://go-review.googlesource.com/9107
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Michael Hudson-Doyle 2015-04-20 11:09:14 +12:00 committed by Ian Lance Taylor
parent 832c573595
commit 0088ddc3a0
6 changed files with 4 additions and 24 deletions

View File

@ -392,17 +392,6 @@ func elfreloc1(r *ld.Reloc, sectoff int64) int {
} else {
return -1
}
case obj.R_TLS:
if r.Siz == 4 {
if ld.Buildmode == ld.BuildmodeCShared {
ld.Thearch.Vput(ld.R_X86_64_GOTTPOFF | uint64(elfsym)<<32)
} else {
ld.Thearch.Vput(ld.R_X86_64_TPOFF32 | uint64(elfsym)<<32)
}
} else {
return -1
}
}
ld.Thearch.Vput(uint64(r.Xadd))

View File

@ -143,9 +143,9 @@ overwrite:
r.Siz = uint8(rdint(f))
r.Type = int32(rdint(f))
r.Add = rdint(f)
r.Xadd = rdint(f)
rdint(f) // Xadd, ignored
r.Sym = rdsym(ctxt, f, pkg)
r.Xsym = rdsym(ctxt, f, pkg)
rdsym(ctxt, f, pkg) // Xsym, ignored
}
}

View File

@ -1673,8 +1673,6 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
if ctxt.Flag_shared != 0 {
rel.Add += ctxt.Pc - p.Pcrel.Pc - 8 - int64(rel.Siz)
}
rel.Xadd = rel.Add
rel.Xsym = rel.Sym
} else if ctxt.Flag_shared != 0 {
rel.Type = obj.R_PCREL
rel.Add += ctxt.Pc - p.Pcrel.Pc - 8

View File

@ -356,9 +356,7 @@ type Reloc struct {
Siz uint8
Type int32
Add int64
Xadd int64
Sym *LSym
Xsym *LSym
}
// Reloc.type

View File

@ -413,9 +413,9 @@ func writesym(ctxt *Link, b *Biobuf, s *LSym) {
wrint(b, int64(r.Siz))
wrint(b, int64(r.Type))
wrint(b, r.Add)
wrint(b, r.Xadd)
wrint(b, 0) // Xadd, ignored
wrsym(b, r.Sym)
wrsym(b, r.Xsym)
wrsym(b, nil) // Xsym, ignored
}
if s.Type == STEXT {

View File

@ -2460,11 +2460,6 @@ func vaddr(ctxt *obj.Link, p *obj.Prog, a *obj.Addr, r *obj.Reloc) int64 {
r.Off = -1 // caller must fill in
r.Sym = s
r.Add = a.Offset
if s.Type == obj.STLSBSS {
r.Xadd = r.Add - int64(r.Siz)
r.Type = obj.R_TLS
r.Xsym = s
}
return 0
}