Commit 24158644 authored by Michael Matloob's avatar Michael Matloob

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 <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
parent 5e66ac9a
......@@ -1133,15 +1133,15 @@ func (p *GCProg) AddSym(s *Symbol) {
}
ptrsize := int64(SysArch.PtrSize)
nptr := decodetype_ptrdata(p.ctxt.Arch, typ) / ptrsize
nptr := decodetypePtrdata(p.ctxt.Arch, typ) / ptrsize
if debugGCProg {
fmt.Fprintf(os.Stderr, "gcprog sym: %s at %d (ptr=%d+%d)\n", s.Name, s.Value, s.Value/ptrsize, nptr)
}
if decodetype_usegcprog(typ) == 0 {
if decodetypeUsegcprog(typ) == 0 {
// Copy pointers from mask into program.
mask := decodetype_gcmask(p.ctxt, typ)
mask := decodetypeGcmask(p.ctxt, typ)
for i := int64(0); i < nptr; i++ {
if (mask[i/8]>>uint(i%8))&1 != 0 {
p.w.Ptr(s.Value/ptrsize + i)
......@@ -1151,7 +1151,7 @@ func (p *GCProg) AddSym(s *Symbol) {
}
// Copy program.
prog := decodetype_gcprog(p.ctxt, typ)
prog := decodetypeGcprog(p.ctxt, typ)
p.w.ZeroUntil(s.Value / ptrsize)
p.w.Append(prog[4:], nptr)
}
......@@ -1539,12 +1539,12 @@ func (ctxt *Link) dodata() {
// situation.
// TODO(mwhudson): It would make sense to do this more widely, but it makes
// the system linker segfault on darwin.
relro_perms := 04
relro_prefix := ""
relroPerms := 04
relroPrefix := ""
if UseRelro() {
relro_perms = 06
relro_prefix = ".data.rel.ro"
relroPerms = 06
relroPrefix = ".data.rel.ro"
/* data only written by relocations */
sect = addsection(segro, ".data.rel.ro", 06)
......@@ -1587,7 +1587,7 @@ func (ctxt *Link) dodata() {
}
/* typelink */
sect = addsection(segro, relro_prefix+".typelink", relro_perms)
sect = addsection(segro, relroPrefix+".typelink", relroPerms)
sect.Align = dataMaxAlign[obj.STYPELINK]
datsize = Rnd(datsize, int64(sect.Align))
sect.Vaddr = uint64(datsize)
......@@ -1604,7 +1604,7 @@ func (ctxt *Link) dodata() {
sect.Length = uint64(datsize) - sect.Vaddr
/* itablink */
sect = addsection(segro, relro_prefix+".itablink", relro_perms)
sect = addsection(segro, relroPrefix+".itablink", relroPerms)
sect.Align = dataMaxAlign[obj.SITABLINK]
datsize = Rnd(datsize, int64(sect.Align))
sect.Vaddr = uint64(datsize)
......@@ -1621,7 +1621,7 @@ func (ctxt *Link) dodata() {
sect.Length = uint64(datsize) - sect.Vaddr
/* gosymtab */
sect = addsection(segro, relro_prefix+".gosymtab", relro_perms)
sect = addsection(segro, relroPrefix+".gosymtab", relroPerms)
sect.Align = dataMaxAlign[obj.SSYMTAB]
datsize = Rnd(datsize, int64(sect.Align))
sect.Vaddr = uint64(datsize)
......@@ -1638,7 +1638,7 @@ func (ctxt *Link) dodata() {
sect.Length = uint64(datsize) - sect.Vaddr
/* gopclntab */
sect = addsection(segro, relro_prefix+".gopclntab", relro_perms)
sect = addsection(segro, relroPrefix+".gopclntab", relroPerms)
sect.Align = dataMaxAlign[obj.SPCLNTAB]
datsize = Rnd(datsize, int64(sect.Align))
sect.Vaddr = uint64(datsize)
......@@ -1794,7 +1794,7 @@ func dodataSect(ctxt *Link, symn int, syms []*Symbol) (result []*Symbol, maxAlig
case obj.STYPELINK:
// Sort typelinks by the rtype.string field so the reflect
// package can binary search type links.
symsSort[i].name = string(decodetype_str(s.R[0].Sym))
symsSort[i].name = string(decodetypeStr(s.R[0].Sym))
}
}
......
......@@ -276,8 +276,8 @@ func (d *deadcodepass) flood() {
}
if strings.HasPrefix(s.Name, "type.") && s.Name[5] != '.' {
if decodetype_kind(s)&kindMask == kindInterface {
for _, sig := range decodetype_ifacemethods(d.ctxt.Arch, s) {
if decodetypeKind(s)&kindMask == kindInterface {
for _, sig := range decodeIfaceMethods(d.ctxt.Arch, s) {
if d.ctxt.Debugvlog > 1 {
fmt.Fprintf(d.ctxt.Bso, "reached iface method: %s\n", sig)
}
......@@ -315,7 +315,7 @@ func (d *deadcodepass) flood() {
// Decode runtime type information for type methods
// to help work out which methods can be called
// dynamically via interfaces.
methodsigs := decodetype_methods(d.ctxt.Arch, s)
methodsigs := decodetypeMethods(d.ctxt.Arch, s)
if len(methods) != len(methodsigs) {
panic(fmt.Sprintf("%q has %d method relocations for %d methods", s.Name, len(methods), len(methodsigs)))
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -66,10 +66,10 @@ import (
* padded to a word boundary. The values of n_namesz and n_descsz do
* not include the padding.
*/
type Elf_Note struct {
n_namesz uint32
n_descsz uint32
n_type uint32
type elfNote struct {
nNamesz uint32
nDescsz uint32
nType uint32
}
const (
......
......@@ -309,13 +309,13 @@ type ElfSym struct {
var ElfMagic = [4]uint8{0x7F, 'E', 'L', 'F'}
const (
Tag_file = 1
Tag_CPU_name = 4
Tag_CPU_raw_name = 5
Tag_compatibility = 32
Tag_nodefaults = 64
Tag_also_compatible_with = 65
Tag_ABI_VFP_args = 28
TagFile = 1
TagCPUName = 4
TagCPURawName = 5
TagCompatibility = 32
TagNoDefaults = 64
TagAlsoCompatibleWith = 65
TagABIVFPArgs = 28
)
type elfAttribute struct {
......@@ -356,7 +356,7 @@ func (a *elfAttributeList) uleb128() uint64 {
func (a *elfAttributeList) armAttr() elfAttribute {
attr := elfAttribute{tag: a.uleb128()}
switch {
case attr.tag == Tag_compatibility:
case attr.tag == TagCompatibility:
attr.ival = a.uleb128()
attr.sval = a.string()
......@@ -367,7 +367,7 @@ func (a *elfAttributeList) armAttr() elfAttribute {
attr.sval = a.string()
// Tag with string argument
case attr.tag == Tag_CPU_name || attr.tag == Tag_CPU_raw_name || (attr.tag >= 32 && attr.tag&1 != 0):
case attr.tag == TagCPUName || attr.tag == TagCPURawName || (attr.tag >= 32 && attr.tag&1 != 0):
attr.sval = a.string()
default: // Tag with integer argument
......@@ -421,11 +421,11 @@ func parseArmAttributes(ctxt *Link, e binary.ByteOrder, data []byte) {
subsectiondata := sectiondata[sz+4 : subsectionsize]
sectiondata = sectiondata[subsectionsize:]
if subsectiontag == Tag_file {
if subsectiontag == TagFile {
attrList := elfAttributeList{data: subsectiondata}
for !attrList.done() {
attr := attrList.armAttr()
if attr.tag == Tag_ABI_VFP_args && attr.ival == 1 {
if attr.tag == TagABIVFPArgs && attr.ival == 1 {
ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard-float ABI
}
}
......
......@@ -43,7 +43,7 @@ const (
N_STAB = 0xe0
)
type LdMachoObj struct {
type ldMachoObj struct {
f *bio.Reader
base int64 // off in f where Mach-O begins
length int64 // length of Mach-O
......@@ -54,20 +54,20 @@ type LdMachoObj struct {
subcputype uint
filetype uint32
flags uint32
cmd []LdMachoCmd
cmd []ldMachoCmd
ncmd uint
}
type LdMachoCmd struct {
type ldMachoCmd struct {
type_ int
off uint32
size uint32
seg LdMachoSeg
sym LdMachoSymtab
dsym LdMachoDysymtab
seg ldMachoSeg
sym ldMachoSymtab
dsym ldMachoDysymtab
}
type LdMachoSeg struct {
type ldMachoSeg struct {
name string
vmaddr uint64
vmsize uint64
......@@ -77,10 +77,10 @@ type LdMachoSeg struct {
initprot uint32
nsect uint32
flags uint32
sect []LdMachoSect
sect []ldMachoSect
}
type LdMachoSect struct {
type ldMachoSect struct {
name string
segname string
addr uint64
......@@ -93,10 +93,10 @@ type LdMachoSect struct {
res1 uint32
res2 uint32
sym *Symbol
rel []LdMachoRel
rel []ldMachoRel
}
type LdMachoRel struct {
type ldMachoRel struct {
addr uint32
symnum uint32
pcrel uint8
......@@ -107,16 +107,16 @@ type LdMachoRel struct {
value uint32
}
type LdMachoSymtab struct {
type ldMachoSymtab struct {
symoff uint32
nsym uint32
stroff uint32
strsize uint32
str []byte
sym []LdMachoSym
sym []ldMachoSym
}
type LdMachoSym struct {
type ldMachoSym struct {
name string
type_ uint8
sectnum uint8
......@@ -126,7 +126,7 @@ type LdMachoSym struct {
sym *Symbol
}
type LdMachoDysymtab struct {
type ldMachoDysymtab struct {
ilocalsym uint32
nlocalsym uint32
iextdefsym uint32
......@@ -175,7 +175,7 @@ const (
LdMachoFilePreload = 5
)
func unpackcmd(p []byte, m *LdMachoObj, c *LdMachoCmd, type_ uint, sz uint) int {
func unpackcmd(p []byte, m *ldMachoObj, c *ldMachoCmd, type_ uint, sz uint) int {
e4 := m.e.Uint32
e8 := m.e.Uint64
......@@ -198,12 +198,12 @@ func unpackcmd(p []byte, m *LdMachoObj, c *LdMachoCmd, type_ uint, sz uint) int
c.seg.initprot = e4(p[44:])
c.seg.nsect = e4(p[48:])
c.seg.flags = e4(p[52:])
c.seg.sect = make([]LdMachoSect, c.seg.nsect)
c.seg.sect = make([]ldMachoSect, c.seg.nsect)
if uint32(sz) < 56+c.seg.nsect*68 {
return -1
}
p = p[56:]
var s *LdMachoSect
var s *ldMachoSect
for i := 0; uint32(i) < c.seg.nsect; i++ {
s = &c.seg.sect[i]
s.name = cstring(p[0:16])
......@@ -233,12 +233,12 @@ func unpackcmd(p []byte, m *LdMachoObj, c *LdMachoCmd, type_ uint, sz uint) int
c.seg.initprot = e4(p[60:])
c.seg.nsect = e4(p[64:])
c.seg.flags = e4(p[68:])
c.seg.sect = make([]LdMachoSect, c.seg.nsect)
c.seg.sect = make([]ldMachoSect, c.seg.nsect)
if uint32(sz) < 72+c.seg.nsect*80 {
return -1
}
p = p[72:]
var s *LdMachoSect
var s *ldMachoSect
for i := 0; uint32(i) < c.seg.nsect; i++ {
s = &c.seg.sect[i]
s.name = cstring(p[0:16])
......@@ -293,11 +293,11 @@ func unpackcmd(p []byte, m *LdMachoObj, c *LdMachoCmd, type_ uint, sz uint) int
return 0
}
func macholoadrel(m *LdMachoObj, sect *LdMachoSect) int {
func macholoadrel(m *ldMachoObj, sect *ldMachoSect) int {
if sect.rel != nil || sect.nreloc == 0 {
return 0
}
rel := make([]LdMachoRel, sect.nreloc)
rel := make([]ldMachoRel, sect.nreloc)
n := int(sect.nreloc * 8)
buf := make([]byte, n)
if m.f.Seek(m.base+int64(sect.reloff), 0) < 0 {
......@@ -307,7 +307,7 @@ func macholoadrel(m *LdMachoObj, sect *LdMachoSect) int {
return -1
}
var p []byte
var r *LdMachoRel
var r *ldMachoRel
var v uint32
for i := 0; uint32(i) < sect.nreloc; i++ {
r = &rel[i]
......@@ -345,7 +345,7 @@ func macholoadrel(m *LdMachoObj, sect *LdMachoSect) int {
return 0
}
func macholoaddsym(m *LdMachoObj, d *LdMachoDysymtab) int {
func macholoaddsym(m *ldMachoObj, d *ldMachoDysymtab) int {
n := int(d.nindirectsyms)
p := make([]byte, n*4)
......@@ -363,7 +363,7 @@ func macholoaddsym(m *LdMachoObj, d *LdMachoDysymtab) int {
return 0
}
func macholoadsym(m *LdMachoObj, symtab *LdMachoSymtab) int {
func macholoadsym(m *ldMachoObj, symtab *ldMachoSymtab) int {
if symtab.sym != nil {
return 0
}
......@@ -388,9 +388,9 @@ func macholoadsym(m *LdMachoObj, symtab *LdMachoSymtab) int {
if _, err := io.ReadFull(m.f, symbuf); err != nil {
return -1
}
sym := make([]LdMachoSym, symtab.nsym)
sym := make([]ldMachoSym, symtab.nsym)
p := symbuf
var s *LdMachoSym
var s *ldMachoSym
var v uint32
for i := 0; uint32(i) < symtab.nsym; i++ {
s = &sym[i]
......@@ -428,18 +428,18 @@ func ldmacho(ctxt *Link, f *bio.Reader, pkg string, length int64, pn string) {
var ty uint32
var sz uint32
var off uint32
var m *LdMachoObj
var m *ldMachoObj
var e binary.ByteOrder
var sect *LdMachoSect
var rel *LdMachoRel
var sect *ldMachoSect
var rel *ldMachoRel
var rpi int
var s *Symbol
var s1 *Symbol
var outer *Symbol
var c *LdMachoCmd
var symtab *LdMachoSymtab
var dsymtab *LdMachoDysymtab
var sym *LdMachoSym
var c *ldMachoCmd
var symtab *ldMachoSymtab
var dsymtab *ldMachoDysymtab
var sym *ldMachoSym
var r []Reloc
var rp *Reloc
var name string
......@@ -471,7 +471,7 @@ func ldmacho(ctxt *Link, f *bio.Reader, pkg string, length int64, pn string) {
f.Seek(4, 1) // skip reserved word in header
}
m = new(LdMachoObj)
m = new(ldMachoObj)
m.f = f
m.e = e
......@@ -503,7 +503,7 @@ func ldmacho(ctxt *Link, f *bio.Reader, pkg string, length int64, pn string) {
}
}
m.cmd = make([]LdMachoCmd, ncmd)
m.cmd = make([]ldMachoCmd, ncmd)
off = uint32(len(hdr))
cmdp = make([]byte, cmdsz)
if _, err2 := io.ReadFull(f, cmdp); err2 != nil {
......@@ -778,7 +778,7 @@ func ldmacho(ctxt *Link, f *bio.Reader, pkg string, length int64, pn string) {
// now consider the desired symbol.
// find the section where it lives.
var ks *LdMachoSect
var ks *ldMachoSect
for k := 0; uint32(k) < c.seg.nsect; k++ {
ks = &c.seg.sect[k]
if ks.addr <= uint64(rel.value) && uint64(rel.value) < ks.addr+ks.size {
......
......@@ -1416,7 +1416,7 @@ func ldshlibsyms(ctxt *Link, shlib string) {
ctxt.Diag("cannot read symbols from shared library: %s", libpath)
return
}
gcdata_locations := make(map[uint64]*Symbol)
gcdataLocations := make(map[uint64]*Symbol)
for _, elfsym := range syms {
if elf.ST_TYPE(elfsym.Info) == elf.STT_NOTYPE || elf.ST_TYPE(elfsym.Info) == elf.STT_SECTION {
continue
......@@ -1439,11 +1439,11 @@ func ldshlibsyms(ctxt *Link, shlib string) {
// the type data.
if strings.HasPrefix(lsym.Name, "type.") && !strings.HasPrefix(lsym.Name, "type..") {
lsym.P = readelfsymboldata(ctxt, f, &elfsym)
gcdata_locations[elfsym.Value+2*uint64(SysArch.PtrSize)+8+1*uint64(SysArch.PtrSize)] = lsym
gcdataLocations[elfsym.Value+2*uint64(SysArch.PtrSize)+8+1*uint64(SysArch.PtrSize)] = lsym
}
}
}
gcdata_addresses := make(map[*Symbol]uint64)
gcdataAddresses := make(map[*Symbol]uint64)
if SysArch.Family == sys.ARM64 {
for _, sect := range f.Sections {
if sect.Type == elf.SHT_RELA {
......@@ -1461,8 +1461,8 @@ func ldshlibsyms(ctxt *Link, shlib string) {
if t != elf.R_AARCH64_RELATIVE {
continue
}
if lsym, ok := gcdata_locations[rela.Off]; ok {
gcdata_addresses[lsym] = uint64(rela.Addend)
if lsym, ok := gcdataLocations[rela.Off]; ok {
gcdataAddresses[lsym] = uint64(rela.Addend)
}
}
}
......@@ -1480,7 +1480,7 @@ func ldshlibsyms(ctxt *Link, shlib string) {
}
ctxt.Textp = textp
ctxt.Shlibs = append(ctxt.Shlibs, Shlib{Path: libpath, Hash: hash, Deps: deps, File: f, gcdata_addresses: gcdata_addresses})
ctxt.Shlibs = append(ctxt.Shlibs, Shlib{Path: libpath, Hash: hash, Deps: deps, File: f, gcdataAddresses: gcdataAddresses})
}
func mywhatsys() {
......@@ -1552,9 +1552,9 @@ func Be32(b []byte) uint32 {
return uint32(b[0])<<24 | uint32(b[1])<<16 | uint32(b[2])<<8 | uint32(b[3])
}
type Chain struct {
type chain struct {
sym *Symbol
up *Chain
up *chain
limit int // limit on entry to sym
}
......@@ -1575,7 +1575,7 @@ func callsize(ctxt *Link) int {
}
func (ctxt *Link) dostkcheck() {
var ch Chain
var ch chain
morestack = Linklookup(ctxt, "runtime.morestack", 0)
......@@ -1616,7 +1616,7 @@ func (ctxt *Link) dostkcheck() {
}
}
func stkcheck(ctxt *Link, up *Chain, depth int) int {
func stkcheck(ctxt *Link, up *chain, depth int) int {
limit := up.limit
s := up.sym
......@@ -1659,7 +1659,7 @@ func stkcheck(ctxt *Link, up *Chain, depth int) int {
return 0
}
var ch Chain
var ch chain
ch.up = up
if !s.Attr.NoSplit() {
......@@ -1684,7 +1684,7 @@ func stkcheck(ctxt *Link, up *Chain, depth int) int {
ri := 0
endr := len(s.R)
var ch1 Chain
var ch1 chain
var pcsp Pciter
var r *Reloc
for pciterinit(ctxt, &pcsp, &s.FuncInfo.Pcsp); pcsp.done == 0; pciternext(&pcsp) {
......@@ -1729,12 +1729,12 @@ func stkcheck(ctxt *Link, up *Chain, depth int) int {
return 0
}
func stkbroke(ctxt *Link, ch *Chain, limit int) {
func stkbroke(ctxt *Link, ch *chain, limit int) {
ctxt.Diag("nosplit stack overflow")
stkprint(ctxt, ch, limit)
}
func stkprint(ctxt *Link, ch *Chain, limit int) {
func stkprint(ctxt *Link, ch *chain, limit int) {
var name string
if ch.sym != nil {
......
......@@ -151,11 +151,11 @@ type Auto struct {
}
type Shlib struct {
Path string
Hash []byte
Deps []string
File *elf.File
gcdata_addresses map[*Symbol]uint64
Path string
Hash []byte
Deps []string
File *elf.File
gcdataAddresses map[*Symbol]uint64
}
type Link struct {
......
......@@ -131,7 +131,7 @@ var nsortsym int
// "big enough" header size. The initial header is
// one page, the non-dynamic library stuff takes
// up about 1300 bytes; we overestimate that as 2k.
var load_budget int = INITIAL_MACHO_HEADR - 2*1024
var loadBudget int = INITIAL_MACHO_HEADR - 2*1024
func Machoinit() {
macho64 = SysArch.RegSize == 8
......@@ -336,12 +336,12 @@ func Machoadddynlib(lib string) {
// and 24 bytes of header metadata. If not enough
// space, grab another page of initial space at the
// beginning of the output file.
load_budget -= (len(lib)+7)/8*8 + 24
loadBudget -= (len(lib)+7)/8*8 + 24
if load_budget < 0 {
if loadBudget < 0 {
HEADR += 4096
*FlagTextAddr += 4096
load_budget += 4096
loadBudget += 4096
}
dylib = append(dylib, lib)
......
......@@ -198,7 +198,7 @@ func container(s *Symbol) int {
// pclntab initializes the pclntab symbol with
// runtime function and file name information.
var pclntab_zpcln FuncInfo
var pclntabZpcln FuncInfo
// These variables are used to initialize runtime.firstmoduledata, see symtab.go:symtab.
var pclntabNfunc int32
......@@ -208,7 +208,7 @@ var pclntabFirstFunc *Symbol
var pclntabLastFunc *Symbol
func (ctxt *Link) pclntab() {
funcdata_bytes := int64(0)
funcdataBytes := int64(0)
ftab := Linklookup(ctxt, "runtime.pclntab", 0)
ftab.Type = obj.SPCLNTAB
ftab.Attr |= AttrReachable
......@@ -251,7 +251,7 @@ func (ctxt *Link) pclntab() {
}
pcln := ctxt.Cursym.FuncInfo
if pcln == nil {
pcln = &pclntab_zpcln
pcln = &pclntabZpcln
}
if pclntabFirstFunc == nil {
......@@ -294,7 +294,7 @@ func (ctxt *Link) pclntab() {
// TODO: Remove entirely.
off = int32(setuint32(ctxt, ftab, int64(off), 0x1234567))
if pcln != &pclntab_zpcln {
if pcln != &pclntabZpcln {
renumberfiles(ctxt, pcln.File, &pcln.Pcfile)
if false {
// Sanity check the new numbering
......@@ -330,7 +330,7 @@ func (ctxt *Link) pclntab() {
setuintxx(ctxt, ftab, int64(off)+int64(SysArch.PtrSize)*int64(i), uint64(pcln.Funcdataoff[i]), int64(SysArch.PtrSize))
} else {
// TODO: Dedup.
funcdata_bytes += pcln.Funcdata[i].Size
funcdataBytes += pcln.Funcdata[i].Size
setaddrplus(ctxt, ftab, int64(off)+int64(SysArch.PtrSize)*int64(i), pcln.Funcdata[i], pcln.Funcdataoff[i])
}
......@@ -368,7 +368,7 @@ func (ctxt *Link) pclntab() {
ftab.Size = int64(len(ftab.P))
if ctxt.Debugvlog != 0 {
fmt.Fprintf(ctxt.Bso, "%5.2f pclntab=%d bytes, funcdata total %d bytes\n", obj.Cputime(), ftab.Size, funcdata_bytes)
fmt.Fprintf(ctxt.Bso, "%5.2f pclntab=%d bytes, funcdata total %d bytes\n", obj.Cputime(), ftab.Size, funcdataBytes)
}
}
......
......@@ -717,9 +717,9 @@ func addexports(ctxt *Link) {
dd[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress = uint32(va)
dd[IMAGE_DIRECTORY_ENTRY_EXPORT].Size = sect.VirtualSize
va_name := va + binary.Size(&e) + nexport*4
va_addr := va + binary.Size(&e)
va_na := va + binary.Size(&e) + nexport*8
vaName := va + binary.Size(&e) + nexport*4
vaAddr := va + binary.Size(&e)
vaNa := va + binary.Size(&e) + nexport*8
e.Characteristics = 0
e.MajorVersion = 0
......@@ -728,9 +728,9 @@ func addexports(ctxt *Link) {
e.NumberOfNames = uint32(nexport)
e.Name = uint32(va+binary.Size(&e)) + uint32(nexport)*10 // Program names.
e.Base = 1
e.AddressOfFunctions = uint32(va_addr)
e.AddressOfNames = uint32(va_name)
e.AddressOfNameOrdinals = uint32(va_na)
e.AddressOfFunctions = uint32(vaAddr)
e.AddressOfNames = uint32(vaName)
e.AddressOfNameOrdinals = uint32(vaNa)
// put IMAGE_EXPORT_DIRECTORY
binary.Write(&coutbuf, binary.LittleEndian, &e)
......
......@@ -576,7 +576,7 @@ func (ctxt *Link) symtab() {
// creating the moduledata from scratch and it does not have a
// compiler-provided size, so read it from the type data.
moduledatatype := Linkrlookup(ctxt, "type.runtime.moduledata", 0)
moduledata.Size = decodetype_size(ctxt.Arch, moduledatatype)
moduledata.Size = decodetypeSize(ctxt.Arch, moduledatatype)
Symgrow(ctxt, moduledata, moduledata.Size)
lastmoduledatap := Linklookup(ctxt, "runtime.lastmoduledatap", 0)
......
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