]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/6l, cmd/internal/ld, cmd/internal/obj: remove Xsym/Xadd from compiler's Reloc
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Sun, 19 Apr 2015 23:09:14 +0000 (11:09 +1200)
committerIan Lance Taylor <iant@golang.org>
Tue, 21 Apr 2015 03:00:19 +0000 (03:00 +0000)
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>
src/cmd/6l/asm.go
src/cmd/internal/ld/objfile.go
src/cmd/internal/obj/arm/asm5.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/objfile.go
src/cmd/internal/obj/x86/asm6.go

index 25e431fc31d57c231abe7777c12d6be7099dd278..0f67fdbf90a4800af3c3e8489e5205aac5620326 100644 (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))
index 4a3212f38425a952b74b352303c2ac58429ff4fd..c424cdca8c2533b1908e56c5ad9e3d3a17bf6d71 100644 (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
                }
        }
 
index a677dc459c26e46c54273e71279ca0a9295c0173..6207c7367e924aa6988038720f5db3da6fefae40 100644 (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
index 6be5a816c29fe678a8f614d1b4c25aac5b2b0b70..33b28580eaadf13fa10e2061cd94cd56088eb332 100644 (file)
@@ -356,9 +356,7 @@ type Reloc struct {
        Siz  uint8
        Type int32
        Add  int64
-       Xadd int64
        Sym  *LSym
-       Xsym *LSym
 }
 
 // Reloc.type
index c45ddd86cae2a59b0639257fa5e8a157233504c3..461a926fe774083109e88a9c2bc83fdc2b60c9a2 100644 (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 {
index 04f829a7d7617857ee21423c192edb26eff93724..6a367c21dcd19b46eefd2cc95fa8c33d649b6e42 100644 (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
        }