Skip to content

Commit 2415864

Browse files
committed
cmd/link/internal/ld: camelCase a buch of snake_case names
I've also unexported a few symbols that weren't used outside the package. Updates #16818 Change-Id: I39d9d87b3eec30b88b4a17c1333cfbbfa6b3518f Reviewed-on: https://go-review.googlesource.com/27468 Run-TryBot: Michael Matloob <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: David Crawshaw <[email protected]>
1 parent 5e66ac9 commit 2415864

File tree

13 files changed

+233
-233
lines changed

13 files changed

+233
-233
lines changed

src/cmd/link/internal/ld/data.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,15 +1133,15 @@ func (p *GCProg) AddSym(s *Symbol) {
11331133
}
11341134

11351135
ptrsize := int64(SysArch.PtrSize)
1136-
nptr := decodetype_ptrdata(p.ctxt.Arch, typ) / ptrsize
1136+
nptr := decodetypePtrdata(p.ctxt.Arch, typ) / ptrsize
11371137

11381138
if debugGCProg {
11391139
fmt.Fprintf(os.Stderr, "gcprog sym: %s at %d (ptr=%d+%d)\n", s.Name, s.Value, s.Value/ptrsize, nptr)
11401140
}
11411141

1142-
if decodetype_usegcprog(typ) == 0 {
1142+
if decodetypeUsegcprog(typ) == 0 {
11431143
// Copy pointers from mask into program.
1144-
mask := decodetype_gcmask(p.ctxt, typ)
1144+
mask := decodetypeGcmask(p.ctxt, typ)
11451145
for i := int64(0); i < nptr; i++ {
11461146
if (mask[i/8]>>uint(i%8))&1 != 0 {
11471147
p.w.Ptr(s.Value/ptrsize + i)
@@ -1151,7 +1151,7 @@ func (p *GCProg) AddSym(s *Symbol) {
11511151
}
11521152

11531153
// Copy program.
1154-
prog := decodetype_gcprog(p.ctxt, typ)
1154+
prog := decodetypeGcprog(p.ctxt, typ)
11551155
p.w.ZeroUntil(s.Value / ptrsize)
11561156
p.w.Append(prog[4:], nptr)
11571157
}
@@ -1539,12 +1539,12 @@ func (ctxt *Link) dodata() {
15391539
// situation.
15401540
// TODO(mwhudson): It would make sense to do this more widely, but it makes
15411541
// the system linker segfault on darwin.
1542-
relro_perms := 04
1543-
relro_prefix := ""
1542+
relroPerms := 04
1543+
relroPrefix := ""
15441544

15451545
if UseRelro() {
1546-
relro_perms = 06
1547-
relro_prefix = ".data.rel.ro"
1546+
relroPerms = 06
1547+
relroPrefix = ".data.rel.ro"
15481548
/* data only written by relocations */
15491549
sect = addsection(segro, ".data.rel.ro", 06)
15501550

@@ -1587,7 +1587,7 @@ func (ctxt *Link) dodata() {
15871587
}
15881588

15891589
/* typelink */
1590-
sect = addsection(segro, relro_prefix+".typelink", relro_perms)
1590+
sect = addsection(segro, relroPrefix+".typelink", relroPerms)
15911591
sect.Align = dataMaxAlign[obj.STYPELINK]
15921592
datsize = Rnd(datsize, int64(sect.Align))
15931593
sect.Vaddr = uint64(datsize)
@@ -1604,7 +1604,7 @@ func (ctxt *Link) dodata() {
16041604
sect.Length = uint64(datsize) - sect.Vaddr
16051605

16061606
/* itablink */
1607-
sect = addsection(segro, relro_prefix+".itablink", relro_perms)
1607+
sect = addsection(segro, relroPrefix+".itablink", relroPerms)
16081608
sect.Align = dataMaxAlign[obj.SITABLINK]
16091609
datsize = Rnd(datsize, int64(sect.Align))
16101610
sect.Vaddr = uint64(datsize)
@@ -1621,7 +1621,7 @@ func (ctxt *Link) dodata() {
16211621
sect.Length = uint64(datsize) - sect.Vaddr
16221622

16231623
/* gosymtab */
1624-
sect = addsection(segro, relro_prefix+".gosymtab", relro_perms)
1624+
sect = addsection(segro, relroPrefix+".gosymtab", relroPerms)
16251625
sect.Align = dataMaxAlign[obj.SSYMTAB]
16261626
datsize = Rnd(datsize, int64(sect.Align))
16271627
sect.Vaddr = uint64(datsize)
@@ -1638,7 +1638,7 @@ func (ctxt *Link) dodata() {
16381638
sect.Length = uint64(datsize) - sect.Vaddr
16391639

16401640
/* gopclntab */
1641-
sect = addsection(segro, relro_prefix+".gopclntab", relro_perms)
1641+
sect = addsection(segro, relroPrefix+".gopclntab", relroPerms)
16421642
sect.Align = dataMaxAlign[obj.SPCLNTAB]
16431643
datsize = Rnd(datsize, int64(sect.Align))
16441644
sect.Vaddr = uint64(datsize)
@@ -1794,7 +1794,7 @@ func dodataSect(ctxt *Link, symn int, syms []*Symbol) (result []*Symbol, maxAlig
17941794
case obj.STYPELINK:
17951795
// Sort typelinks by the rtype.string field so the reflect
17961796
// package can binary search type links.
1797-
symsSort[i].name = string(decodetype_str(s.R[0].Sym))
1797+
symsSort[i].name = string(decodetypeStr(s.R[0].Sym))
17981798
}
17991799
}
18001800

src/cmd/link/internal/ld/deadcode.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ func (d *deadcodepass) flood() {
276276
}
277277

278278
if strings.HasPrefix(s.Name, "type.") && s.Name[5] != '.' {
279-
if decodetype_kind(s)&kindMask == kindInterface {
280-
for _, sig := range decodetype_ifacemethods(d.ctxt.Arch, s) {
279+
if decodetypeKind(s)&kindMask == kindInterface {
280+
for _, sig := range decodeIfaceMethods(d.ctxt.Arch, s) {
281281
if d.ctxt.Debugvlog > 1 {
282282
fmt.Fprintf(d.ctxt.Bso, "reached iface method: %s\n", sig)
283283
}
@@ -315,7 +315,7 @@ func (d *deadcodepass) flood() {
315315
// Decode runtime type information for type methods
316316
// to help work out which methods can be called
317317
// dynamically via interfaces.
318-
methodsigs := decodetype_methods(d.ctxt.Arch, s)
318+
methodsigs := decodetypeMethods(d.ctxt.Arch, s)
319319
if len(methods) != len(methodsigs) {
320320
panic(fmt.Sprintf("%q has %d method relocations for %d methods", s.Name, len(methods), len(methodsigs)))
321321
}

0 commit comments

Comments
 (0)