]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: don't generate .gosymtab section
authorIan Lance Taylor <iant@golang.org>
Sun, 2 Nov 2025 21:54:22 +0000 (13:54 -0800)
committerGopher Robot <gobot@golang.org>
Wed, 5 Nov 2025 00:38:05 +0000 (16:38 -0800)
Since Go 1.2 the section is always empty.

Also remove the code looking for .gosymtab in cmd/internal/objfile.

For #76038

Change-Id: Icd34c870ed0c6da8001e8d32305f79905ee2b066
Reviewed-on: https://go-review.googlesource.com/c/go/+/717200
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
15 files changed:
src/cmd/internal/objfile/elf.go
src/cmd/internal/objfile/goobj.go
src/cmd/internal/objfile/macho.go
src/cmd/internal/objfile/objfile.go
src/cmd/internal/objfile/pe.go
src/cmd/internal/objfile/plan9obj.go
src/cmd/internal/objfile/xcoff.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/elf.go
src/cmd/link/internal/ld/macho_test.go
src/cmd/link/internal/ld/symtab.go
src/cmd/link/internal/sym/symkind.go
src/cmd/link/internal/sym/symkind_string.go
src/cmd/link/internal/wasm/asm.go
src/debug/gosym/symtab.go

index 8923290cffefe81f6bf884bdc7377e47dc50a1fe..6988cea9362d19435ac48407440b1bda9bbb0049 100644 (file)
@@ -64,40 +64,26 @@ func (f *elfFile) symbols() ([]Sym, error) {
        return syms, nil
 }
 
-func (f *elfFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) {
+func (f *elfFile) pcln() (textStart uint64, pclntab []byte, err error) {
        if sect := f.elf.Section(".text"); sect != nil {
                textStart = sect.Addr
        }
 
-       sect := f.elf.Section(".gosymtab")
-       if sect == nil {
-               // try .data.rel.ro.gosymtab, for PIE binaries
-               sect = f.elf.Section(".data.rel.ro.gosymtab")
-       }
-       if sect != nil {
-               if symtab, err = sect.Data(); err != nil {
-                       return 0, nil, nil, err
-               }
-       } else {
-               // if both sections failed, try the symbol
-               symtab = f.symbolData("runtime.symtab", "runtime.esymtab")
-       }
-
-       sect = f.elf.Section(".gopclntab")
+       sect := f.elf.Section(".gopclntab")
        if sect == nil {
                // try .data.rel.ro.gopclntab, for PIE binaries
                sect = f.elf.Section(".data.rel.ro.gopclntab")
        }
        if sect != nil {
                if pclntab, err = sect.Data(); err != nil {
-                       return 0, nil, nil, err
+                       return 0, nil, err
                }
        } else {
                // if both sections failed, try the symbol
                pclntab = f.symbolData("runtime.pclntab", "runtime.epclntab")
        }
 
-       return textStart, symtab, pclntab, nil
+       return textStart, pclntab, nil
 }
 
 func (f *elfFile) text() (textStart uint64, text []byte, err error) {
index 7d564a2661d9515801be4f3f690701e6fb6c1a74..ec852d0669fac91510fad2b4d405760560f22fb2 100644 (file)
@@ -221,10 +221,10 @@ func (f *goobjFile) symbols() ([]Sym, error) {
        return syms, nil
 }
 
-func (f *goobjFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) {
+func (f *goobjFile) pcln() (textStart uint64, pclntab []byte, err error) {
        // Should never be called. We implement Liner below, callers
        // should use that instead.
-       return 0, nil, nil, fmt.Errorf("pcln not available in go object file")
+       return 0, nil, fmt.Errorf("pcln not available in go object file")
 }
 
 // PCToLine returns the file name, line, and function data for the given pc.
index 8258145f26f3424720d8caf40ee4bad64df2d948..eaf665faee91e801ebebf1e2345a52499800f4f9 100644 (file)
@@ -79,21 +79,16 @@ func (f *machoFile) symbols() ([]Sym, error) {
        return syms, nil
 }
 
-func (f *machoFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) {
+func (f *machoFile) pcln() (textStart uint64, pclntab []byte, err error) {
        if sect := f.macho.Section("__text"); sect != nil {
                textStart = sect.Addr
        }
-       if sect := f.macho.Section("__gosymtab"); sect != nil {
-               if symtab, err = sect.Data(); err != nil {
-                       return 0, nil, nil, err
-               }
-       }
        if sect := f.macho.Section("__gopclntab"); sect != nil {
                if pclntab, err = sect.Data(); err != nil {
-                       return 0, nil, nil, err
+                       return 0, nil, err
                }
        }
-       return textStart, symtab, pclntab, nil
+       return textStart, pclntab, nil
 }
 
 func (f *machoFile) text() (textStart uint64, text []byte, err error) {
index ed9aae280e55795bd78a1215675d79bfde74df0e..32e06dfd99142030aefcfd11eaad7735b3e38b71 100644 (file)
@@ -18,7 +18,7 @@ import (
 
 type rawFile interface {
        symbols() (syms []Sym, err error)
-       pcln() (textStart uint64, symtab, pclntab []byte, err error)
+       pcln() (textStart uint64, pclntab []byte, err error)
        text() (textStart uint64, text []byte, err error)
        goarch() string
        loadAddress() (uint64, error)
@@ -141,7 +141,7 @@ func (e *Entry) PCLineTable() (Liner, error) {
                return pcln, nil
        }
        // Otherwise, read the pcln tables and build a Liner out of that.
-       textStart, symtab, pclntab, err := e.raw.pcln()
+       textStart, pclntab, err := e.raw.pcln()
        if err != nil {
                return nil, err
        }
@@ -154,7 +154,7 @@ func (e *Entry) PCLineTable() (Liner, error) {
                        }
                }
        }
-       return gosym.NewTable(symtab, gosym.NewLineTable(pclntab, textStart))
+       return gosym.NewTable(nil, gosym.NewLineTable(pclntab, textStart))
 }
 
 func (e *Entry) Text() (uint64, []byte, error) {
index c5c08264a9cdb0b742aa73635100c6bd0df02e90..e94821298f1ba744e2b7ad179df2b130dbad239d 100644 (file)
@@ -90,10 +90,10 @@ func (f *peFile) symbols() ([]Sym, error) {
        return syms, nil
 }
 
-func (f *peFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) {
+func (f *peFile) pcln() (textStart uint64, pclntab []byte, err error) {
        imageBase, err := f.imageBase()
        if err != nil {
-               return 0, nil, nil, err
+               return 0, nil, err
        }
 
        if sect := f.pe.Section(".text"); sect != nil {
@@ -104,17 +104,10 @@ func (f *peFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) {
                // TODO: Remove code looking for the old symbols when we no longer care about 1.3.
                var err2 error
                if pclntab, err2 = loadPETable(f.pe, "pclntab", "epclntab"); err2 != nil {
-                       return 0, nil, nil, err
-               }
-       }
-       if symtab, err = loadPETable(f.pe, "runtime.symtab", "runtime.esymtab"); err != nil {
-               // Same as above.
-               var err2 error
-               if symtab, err2 = loadPETable(f.pe, "symtab", "esymtab"); err2 != nil {
-                       return 0, nil, nil, err
+                       return 0, nil, err
                }
        }
-       return textStart, symtab, pclntab, nil
+       return textStart, pclntab, nil
 }
 
 func (f *peFile) text() (textStart uint64, text []byte, err error) {
index c91970762c79ee2543cb29868da783cb4caffea6..edd40230cec0c24e5eac1fc5656f3d3fbbc2a9c8 100644 (file)
@@ -71,24 +71,17 @@ func (f *plan9File) symbols() ([]Sym, error) {
        return syms, nil
 }
 
-func (f *plan9File) pcln() (textStart uint64, symtab, pclntab []byte, err error) {
+func (f *plan9File) pcln() (textStart uint64, pclntab []byte, err error) {
        textStart = f.plan9.LoadAddress + f.plan9.HdrSize
        if pclntab, err = loadPlan9Table(f.plan9, "runtime.pclntab", "runtime.epclntab"); err != nil {
                // We didn't find the symbols, so look for the names used in 1.3 and earlier.
                // TODO: Remove code looking for the old symbols when we no longer care about 1.3.
                var err2 error
                if pclntab, err2 = loadPlan9Table(f.plan9, "pclntab", "epclntab"); err2 != nil {
-                       return 0, nil, nil, err
+                       return 0, nil, err
                }
        }
-       if symtab, err = loadPlan9Table(f.plan9, "runtime.symtab", "runtime.esymtab"); err != nil {
-               // Same as above.
-               var err2 error
-               if symtab, err2 = loadPlan9Table(f.plan9, "symtab", "esymtab"); err2 != nil {
-                       return 0, nil, nil, err
-               }
-       }
-       return textStart, symtab, pclntab, nil
+       return textStart, pclntab, nil
 }
 
 func (f *plan9File) text() (textStart uint64, text []byte, err error) {
index 24f42760c9dd601cb69c4e447a7099d288be6a46..85928621f1837cdc90fa7766481eed95c4a84a7f 100644 (file)
@@ -87,15 +87,14 @@ func (f *xcoffFile) symbols() ([]Sym, error) {
        return syms, nil
 }
 
-func (f *xcoffFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) {
+func (f *xcoffFile) pcln() (textStart uint64, pclntab []byte, err error) {
        if sect := f.xcoff.Section(".text"); sect != nil {
                textStart = sect.VirtualAddress
        }
        if pclntab, err = loadXCOFFTable(f.xcoff, "runtime.pclntab", "runtime.epclntab"); err != nil {
-               return 0, nil, nil, err
+               return 0, nil, err
        }
-       symtab, _ = loadXCOFFTable(f.xcoff, "runtime.symtab", "runtime.esymtab") // ignore error, this symbol is not useful anyway
-       return textStart, symtab, pclntab, nil
+       return textStart, pclntab, nil
 }
 
 func (f *xcoffFile) text() (textStart uint64, text []byte, err error) {
index 7f5a7e65adcbf755a7fd19ee89bc55a151af053f..fcc327276079569a90ff7468d57678bfcd7acad9 100644 (file)
@@ -2238,11 +2238,6 @@ func (state *dodataState) allocateDataSections(ctxt *Link) {
        state.checkdatsize(sym.SITABLINK)
        sect.Length = uint64(state.datsize) - sect.Vaddr
 
-       /* gosymtab */
-       sect = state.allocateNamedSectionAndAssignSyms(seg, genrelrosecname(".gosymtab"), sym.SSYMTAB, sym.SRODATA, relroSecPerm)
-       ldr.SetSymSect(ldr.LookupOrCreateSym("runtime.symtab", 0), sect)
-       ldr.SetSymSect(ldr.LookupOrCreateSym("runtime.esymtab", 0), sect)
-
        /* gopclntab */
        sect = state.allocateNamedSectionAndAssignSyms(seg, genrelrosecname(".gopclntab"), sym.SPCLNTAB, sym.SRODATA, relroSecPerm)
        ldr.SetSymSect(ldr.LookupOrCreateSym("runtime.pclntab", 0), sect)
@@ -2985,7 +2980,6 @@ func (ctxt *Link) address() []*sym.Segment {
        ldr := ctxt.loader
        var (
                rodata  = ldr.SymSect(ldr.LookupOrCreateSym("runtime.rodata", 0))
-               symtab  = ldr.SymSect(ldr.LookupOrCreateSym("runtime.symtab", 0))
                pclntab = ldr.SymSect(ldr.LookupOrCreateSym("runtime.pclntab", 0))
                types   = ldr.SymSect(ldr.LookupOrCreateSym("runtime.types", 0))
        )
@@ -3065,8 +3059,6 @@ func (ctxt *Link) address() []*sym.Segment {
        ctxt.xdefine("runtime.egcbss", sym.SRODATA, ldr.SymAddr(s)+ldr.SymSize(s))
        ldr.SetSymSect(ldr.LookupOrCreateSym("runtime.egcbss", 0), ldr.SymSect(s))
 
-       ctxt.xdefine("runtime.symtab", sym.SRODATA, int64(symtab.Vaddr))
-       ctxt.xdefine("runtime.esymtab", sym.SRODATA, int64(symtab.Vaddr+symtab.Length))
        ctxt.xdefine("runtime.pclntab", sym.SRODATA, int64(pclntab.Vaddr))
        ctxt.defineInternal("runtime.pcheader", sym.SRODATA)
        ctxt.defineInternal("runtime.funcnametab", sym.SRODATA)
index ed215d7fe50128a5384c7a6b1868e5b583e391a6..8981f1c3f02272c63c2a18eaa0cb3ba34fda854d 100644 (file)
@@ -1477,7 +1477,6 @@ func (ctxt *Link) doelf() {
        }
        shstrtabAddstring(relro_prefix + ".typelink")
        shstrtabAddstring(relro_prefix + ".itablink")
-       shstrtabAddstring(relro_prefix + ".gosymtab")
        shstrtabAddstring(relro_prefix + ".gopclntab")
 
        if ctxt.IsExternal() {
@@ -1487,7 +1486,6 @@ func (ctxt *Link) doelf() {
                shstrtabAddstring(elfRelType + ".rodata")
                shstrtabAddstring(elfRelType + relro_prefix + ".typelink")
                shstrtabAddstring(elfRelType + relro_prefix + ".itablink")
-               shstrtabAddstring(elfRelType + relro_prefix + ".gosymtab")
                shstrtabAddstring(elfRelType + relro_prefix + ".gopclntab")
                shstrtabAddstring(elfRelType + ".noptrdata")
                shstrtabAddstring(elfRelType + ".data")
index 29adc0b78b11652be00d1a1935e9175775cdd15d..adf159ab6d2ce8eb8bc475d419f723a643adfbc9 100644 (file)
@@ -37,7 +37,7 @@ func TestMachoSectionsReadOnly(t *testing.T) {
                        args:             []string{"-ldflags", "-linkmode=internal"},
                        prog:             prog,
                        mustInternalLink: true,
-                       wantSecsRO:       []string{"__got", "__rodata", "__itablink", "__typelink", "__gosymtab", "__gopclntab"},
+                       wantSecsRO:       []string{"__got", "__rodata", "__itablink", "__typelink", "__gopclntab"},
                },
                {
                        name:        "linkmode-external",
index f18bb3599ad0c9aabe8169a6ebd5213c5ce519db..a0345ca1c7b7b7e91dbac3eeb4229342f60f5102 100644 (file)
@@ -446,7 +446,6 @@ func (ctxt *Link) symtab(pcln *pclntab) []sym.SymKind {
        ctxt.xdefine("runtime.ecovctrs", sym.SNOPTRBSS, 0)
        ctxt.xdefine("runtime.end", sym.SBSS, 0)
        ctxt.xdefine("runtime.epclntab", sym.SRODATA, 0)
-       ctxt.xdefine("runtime.esymtab", sym.SRODATA, 0)
 
        // garbage collection symbols
        s := ldr.CreateSymForUpdate("runtime.gcdata", 0)
@@ -506,11 +505,6 @@ func (ctxt *Link) symtab(pcln *pclntab) []sym.SymKind {
                symgofuncrel = groupSym("go:funcrel.*", sym.SGOFUNCRELRO)
        }
 
-       symt := ldr.CreateSymForUpdate("runtime.symtab", 0)
-       symt.SetType(sym.SSYMTAB)
-       symt.SetSize(0)
-       symt.SetLocal(true)
-
        // assign specific types so that they sort together.
        // within a type they sort by size, so the .* symbols
        // just defined above will be first.
index 19de4ad2108692989188e4efae37d641b51fd314..9f62e809e14ca32e070395b523717ee06326d042 100644 (file)
@@ -91,7 +91,6 @@ const (
 
        STYPELINK // Type links.
        SITABLINK // Itab links.
-       SSYMTAB   // Used for runtime.symtab, which is always empty.
        SPCLNTAB  // Pclntab data.
 
        // Allocated writable segment.
index 509318403ab071d4e790492d36b6a8598ff253d2..4e3a0a3431ae0b26bdba6ddf1b5c4aad90b516d6 100644 (file)
@@ -39,61 +39,60 @@ func _() {
        _ = x[SMACHORELROSECT-28]
        _ = x[STYPELINK-29]
        _ = x[SITABLINK-30]
-       _ = x[SSYMTAB-31]
-       _ = x[SPCLNTAB-32]
-       _ = x[SFirstWritable-33]
-       _ = x[SBUILDINFO-34]
-       _ = x[SFIPSINFO-35]
-       _ = x[SELFSECT-36]
-       _ = x[SMACHO-37]
-       _ = x[SMACHOGOT-38]
-       _ = x[SWINDOWS-39]
-       _ = x[SELFGOT-40]
-       _ = x[SNOPTRDATA-41]
-       _ = x[SNOPTRDATAFIPSSTART-42]
-       _ = x[SNOPTRDATAFIPS-43]
-       _ = x[SNOPTRDATAFIPSEND-44]
-       _ = x[SNOPTRDATAEND-45]
-       _ = x[SINITARR-46]
-       _ = x[SDATA-47]
-       _ = x[SDATAFIPSSTART-48]
-       _ = x[SDATAFIPS-49]
-       _ = x[SDATAFIPSEND-50]
-       _ = x[SDATAEND-51]
-       _ = x[SXCOFFTOC-52]
-       _ = x[SBSS-53]
-       _ = x[SNOPTRBSS-54]
-       _ = x[SLIBFUZZER_8BIT_COUNTER-55]
-       _ = x[SCOVERAGE_COUNTER-56]
-       _ = x[SCOVERAGE_AUXVAR-57]
-       _ = x[STLSBSS-58]
-       _ = x[SFirstUnallocated-59]
-       _ = x[SXREF-60]
-       _ = x[SMACHOSYMSTR-61]
-       _ = x[SMACHOSYMTAB-62]
-       _ = x[SMACHOINDIRECTPLT-63]
-       _ = x[SMACHOINDIRECTGOT-64]
-       _ = x[SDYNIMPORT-65]
-       _ = x[SHOSTOBJ-66]
-       _ = x[SUNDEFEXT-67]
-       _ = x[SDWARFSECT-68]
-       _ = x[SDWARFCUINFO-69]
-       _ = x[SDWARFCONST-70]
-       _ = x[SDWARFFCN-71]
-       _ = x[SDWARFABSFCN-72]
-       _ = x[SDWARFTYPE-73]
-       _ = x[SDWARFVAR-74]
-       _ = x[SDWARFRANGE-75]
-       _ = x[SDWARFLOC-76]
-       _ = x[SDWARFLINES-77]
-       _ = x[SDWARFADDR-78]
-       _ = x[SSEHUNWINDINFO-79]
-       _ = x[SSEHSECT-80]
+       _ = x[SPCLNTAB-31]
+       _ = x[SFirstWritable-32]
+       _ = x[SBUILDINFO-33]
+       _ = x[SFIPSINFO-34]
+       _ = x[SELFSECT-35]
+       _ = x[SMACHO-36]
+       _ = x[SMACHOGOT-37]
+       _ = x[SWINDOWS-38]
+       _ = x[SELFGOT-39]
+       _ = x[SNOPTRDATA-40]
+       _ = x[SNOPTRDATAFIPSSTART-41]
+       _ = x[SNOPTRDATAFIPS-42]
+       _ = x[SNOPTRDATAFIPSEND-43]
+       _ = x[SNOPTRDATAEND-44]
+       _ = x[SINITARR-45]
+       _ = x[SDATA-46]
+       _ = x[SDATAFIPSSTART-47]
+       _ = x[SDATAFIPS-48]
+       _ = x[SDATAFIPSEND-49]
+       _ = x[SDATAEND-50]
+       _ = x[SXCOFFTOC-51]
+       _ = x[SBSS-52]
+       _ = x[SNOPTRBSS-53]
+       _ = x[SLIBFUZZER_8BIT_COUNTER-54]
+       _ = x[SCOVERAGE_COUNTER-55]
+       _ = x[SCOVERAGE_AUXVAR-56]
+       _ = x[STLSBSS-57]
+       _ = x[SFirstUnallocated-58]
+       _ = x[SXREF-59]
+       _ = x[SMACHOSYMSTR-60]
+       _ = x[SMACHOSYMTAB-61]
+       _ = x[SMACHOINDIRECTPLT-62]
+       _ = x[SMACHOINDIRECTGOT-63]
+       _ = x[SDYNIMPORT-64]
+       _ = x[SHOSTOBJ-65]
+       _ = x[SUNDEFEXT-66]
+       _ = x[SDWARFSECT-67]
+       _ = x[SDWARFCUINFO-68]
+       _ = x[SDWARFCONST-69]
+       _ = x[SDWARFFCN-70]
+       _ = x[SDWARFABSFCN-71]
+       _ = x[SDWARFTYPE-72]
+       _ = x[SDWARFVAR-73]
+       _ = x[SDWARFRANGE-74]
+       _ = x[SDWARFLOC-75]
+       _ = x[SDWARFLINES-76]
+       _ = x[SDWARFADDR-77]
+       _ = x[SSEHUNWINDINFO-78]
+       _ = x[SSEHSECT-79]
 }
 
-const _SymKind_name = "SxxxSTEXTSTEXTFIPSSTARTSTEXTFIPSSTEXTFIPSENDSTEXTENDSELFRXSECTSMACHOPLTSTYPESSTRINGSGOSTRINGSGOFUNCSGCBITSSRODATASRODATAFIPSSTARTSRODATAFIPSSRODATAFIPSENDSRODATAENDSFUNCTABSELFROSECTSTYPERELROSSTRINGRELROSGOSTRINGRELROSGOFUNCRELROSGCBITSRELROSRODATARELROSFUNCTABRELROSELFRELROSECTSMACHORELROSECTSTYPELINKSITABLINKSSYMTABSPCLNTABSFirstWritableSBUILDINFOSFIPSINFOSELFSECTSMACHOSMACHOGOTSWINDOWSSELFGOTSNOPTRDATASNOPTRDATAFIPSSTARTSNOPTRDATAFIPSSNOPTRDATAFIPSENDSNOPTRDATAENDSINITARRSDATASDATAFIPSSTARTSDATAFIPSSDATAFIPSENDSDATAENDSXCOFFTOCSBSSSNOPTRBSSSLIBFUZZER_8BIT_COUNTERSCOVERAGE_COUNTERSCOVERAGE_AUXVARSTLSBSSSFirstUnallocatedSXREFSMACHOSYMSTRSMACHOSYMTABSMACHOINDIRECTPLTSMACHOINDIRECTGOTSDYNIMPORTSHOSTOBJSUNDEFEXTSDWARFSECTSDWARFCUINFOSDWARFCONSTSDWARFFCNSDWARFABSFCNSDWARFTYPESDWARFVARSDWARFRANGESDWARFLOCSDWARFLINESSDWARFADDRSSEHUNWINDINFOSSEHSECT"
+const _SymKind_name = "SxxxSTEXTSTEXTFIPSSTARTSTEXTFIPSSTEXTFIPSENDSTEXTENDSELFRXSECTSMACHOPLTSTYPESSTRINGSGOSTRINGSGOFUNCSGCBITSSRODATASRODATAFIPSSTARTSRODATAFIPSSRODATAFIPSENDSRODATAENDSFUNCTABSELFROSECTSTYPERELROSSTRINGRELROSGOSTRINGRELROSGOFUNCRELROSGCBITSRELROSRODATARELROSFUNCTABRELROSELFRELROSECTSMACHORELROSECTSTYPELINKSITABLINKSPCLNTABSFirstWritableSBUILDINFOSFIPSINFOSELFSECTSMACHOSMACHOGOTSWINDOWSSELFGOTSNOPTRDATASNOPTRDATAFIPSSTARTSNOPTRDATAFIPSSNOPTRDATAFIPSENDSNOPTRDATAENDSINITARRSDATASDATAFIPSSTARTSDATAFIPSSDATAFIPSENDSDATAENDSXCOFFTOCSBSSSNOPTRBSSSLIBFUZZER_8BIT_COUNTERSCOVERAGE_COUNTERSCOVERAGE_AUXVARSTLSBSSSFirstUnallocatedSXREFSMACHOSYMSTRSMACHOSYMTABSMACHOINDIRECTPLTSMACHOINDIRECTGOTSDYNIMPORTSHOSTOBJSUNDEFEXTSDWARFSECTSDWARFCUINFOSDWARFCONSTSDWARFFCNSDWARFABSFCNSDWARFTYPESDWARFVARSDWARFRANGESDWARFLOCSDWARFLINESSDWARFADDRSSEHUNWINDINFOSSEHSECT"
 
-var _SymKind_index = [...]uint16{0, 4, 9, 23, 32, 44, 52, 62, 71, 76, 83, 92, 99, 106, 113, 129, 140, 154, 164, 172, 182, 192, 204, 218, 230, 242, 254, 267, 280, 295, 304, 313, 320, 328, 342, 352, 361, 369, 375, 384, 392, 399, 409, 428, 442, 459, 472, 480, 485, 499, 508, 520, 528, 537, 541, 550, 573, 590, 606, 613, 630, 635, 647, 659, 676, 693, 703, 711, 720, 730, 742, 753, 762, 774, 784, 793, 804, 813, 824, 834, 848, 856}
+var _SymKind_index = [...]uint16{0, 4, 9, 23, 32, 44, 52, 62, 71, 76, 83, 92, 99, 106, 113, 129, 140, 154, 164, 172, 182, 192, 204, 218, 230, 242, 254, 267, 280, 295, 304, 313, 321, 335, 345, 354, 362, 368, 377, 385, 392, 402, 421, 435, 452, 465, 473, 478, 492, 501, 513, 521, 530, 534, 543, 566, 583, 599, 606, 623, 628, 640, 652, 669, 686, 696, 704, 713, 723, 735, 746, 755, 767, 777, 786, 797, 806, 817, 827, 841, 849}
 
 func (i SymKind) String() string {
        if i >= SymKind(len(_SymKind_index)-1) {
index 2ddf5b33ba273a12f838038e2b8a40ac13f3e153..65f79c80120e068f0b74698c63c5996bdff6b232 100644 (file)
@@ -127,7 +127,6 @@ func asmb(ctxt *ld.Link, ldr *loader.Loader) {
                ldr.SymSect(ldr.Lookup("runtime.rodata", 0)),
                ldr.SymSect(ldr.Lookup("runtime.typelink", 0)),
                ldr.SymSect(ldr.Lookup("runtime.itablink", 0)),
-               ldr.SymSect(ldr.Lookup("runtime.symtab", 0)),
                ldr.SymSect(ldr.Lookup("runtime.pclntab", 0)),
                ldr.SymSect(ldr.Lookup("runtime.noptrdata", 0)),
                ldr.SymSect(ldr.Lookup("runtime.data", 0)),
index bf38927254f1d0d176006ef6afa756d4261b97af..08d46684bf32c4fcc7cfac0062ef57339d272477 100644 (file)
@@ -332,7 +332,8 @@ func walksymtab(data []byte, fn func(sym) error) error {
 
 // NewTable decodes the Go symbol table (the ".gosymtab" section in ELF),
 // returning an in-memory representation.
-// Starting with Go 1.3, the Go symbol table no longer includes symbol data.
+// Starting with Go 1.3, the Go symbol table no longer includes symbol data;
+// callers should pass nil for the symtab parameter.
 func NewTable(symtab []byte, pcln *LineTable) (*Table, error) {
        var n int
        err := walksymtab(symtab, func(s sym) error {