aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal
diff options
context:
space:
mode:
authorqiulaidongfeng <2645477756@qq.com>2025-07-26 16:46:22 +0800
committerAlan Donovan <adonovan@google.com>2025-08-05 10:31:25 -0700
commit4ee0df8c466861bcd258ec55b58283f276d3b3d5 (patch)
tree9f8b467a6eff9720f5033477d21777e373848d2e /src/cmd/link/internal
parenta2c45f0eb1f281ed39c5111dd0fe4b2728f11cf3 (diff)
downloadgo-4ee0df8c466861bcd258ec55b58283f276d3b3d5.tar.xz
cmd: remove dead code
Fixes #74076 Change-Id: Icc67b3d4e342f329584433bd1250c56ae8f5a73d Reviewed-on: https://go-review.googlesource.com/c/go/+/690635 Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Alan Donovan <adonovan@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'src/cmd/link/internal')
-rw-r--r--src/cmd/link/internal/amd64/asm.go4
-rw-r--r--src/cmd/link/internal/ld/decodesym.go29
2 files changed, 0 insertions, 33 deletions
diff --git a/src/cmd/link/internal/amd64/asm.go b/src/cmd/link/internal/amd64/asm.go
index 7754cf9bfa..b8127a2538 100644
--- a/src/cmd/link/internal/amd64/asm.go
+++ b/src/cmd/link/internal/amd64/asm.go
@@ -40,10 +40,6 @@ import (
"log"
)
-func PADDR(x uint32) uint32 {
- return x &^ 0x80000000
-}
-
func gentext(ctxt *ld.Link, ldr *loader.Loader) {
initfunc, addmoduledata := ld.PrepareAddmoduledata(ctxt)
if initfunc == nil {
diff --git a/src/cmd/link/internal/ld/decodesym.go b/src/cmd/link/internal/ld/decodesym.go
index 8c9fa8efab..949ea55905 100644
--- a/src/cmd/link/internal/ld/decodesym.go
+++ b/src/cmd/link/internal/ld/decodesym.go
@@ -244,35 +244,6 @@ func decodetypeGcmask(ctxt *Link, s loader.Sym) []byte {
return ctxt.loader.Data(mask)
}
-// Type.commonType.gc
-func decodetypeGcprog(ctxt *Link, s loader.Sym) []byte {
- if ctxt.loader.SymType(s) == sym.SDYNIMPORT {
- symData := ctxt.loader.Data(s)
- addr := decodetypeGcprogShlib(ctxt, symData)
- sect := findShlibSection(ctxt, ctxt.loader.SymPkg(s), addr)
- if sect != nil {
- // A gcprog is a 4-byte uint32 indicating length, followed by
- // the actual program.
- progsize := make([]byte, 4)
- _, err := sect.ReadAt(progsize, int64(addr-sect.Addr))
- if err != nil {
- log.Fatal(err)
- }
- progbytes := make([]byte, ctxt.Arch.ByteOrder.Uint32(progsize))
- _, err = sect.ReadAt(progbytes, int64(addr-sect.Addr+4))
- if err != nil {
- log.Fatal(err)
- }
- return append(progsize, progbytes...)
- }
- Exitf("cannot find gcprog for %s", ctxt.loader.SymName(s))
- return nil
- }
- relocs := ctxt.loader.Relocs(s)
- rs := decodeRelocSym(ctxt.loader, s, &relocs, 2*int32(ctxt.Arch.PtrSize)+8+1*int32(ctxt.Arch.PtrSize))
- return ctxt.loader.Data(rs)
-}
-
// Find the elf.Section of a given shared library that contains a given address.
func findShlibSection(ctxt *Link, path string, addr uint64) *elf.Section {
for _, shlib := range ctxt.Shlibs {