]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: remove obsolete duffzero/duffcopy code
authorKeith Randall <khr@golang.org>
Fri, 30 Jan 2026 22:12:25 +0000 (14:12 -0800)
committerGopher Robot <gobot@golang.org>
Wed, 4 Feb 2026 20:16:14 +0000 (12:16 -0800)
Change-Id: Icf94808a6c137c3c114a0be1f8da85ee5f68d58e
Reviewed-on: https://go-review.googlesource.com/c/go/+/740740
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/cmd/link/internal/arm64/asm.go

index 7c4546fb179663c555b72c828c2bc51e59542b3e..e615bf52d00e9eaae506bc40220b06a7cbb52773 100644 (file)
@@ -1267,9 +1267,6 @@ func gensymlate(ctxt *ld.Link, ldr *loader.Loader) {
        // addend. For large symbols, we generate "label" symbols in the middle, so
        // that relocations can target them with smaller addends.
        // On Windows, we only get 21 bits, again (presumably) signed.
-       // Also, on Windows (always) and Darwin (for very large binaries), the external
-       // linker doesn't support CALL relocations with addend, so we generate "label"
-       // symbols for functions of which we can target the middle (Duff's devices).
        if !ctxt.IsDarwin() && !ctxt.IsWindows() || !ctxt.IsExternal() {
                return
        }
@@ -1298,14 +1295,6 @@ func gensymlate(ctxt *ld.Link, ldr *loader.Loader) {
                }
        }
 
-       // Generate symbol names for every offset we need in duffcopy/duffzero (only 64 each).
-       if s := ldr.Lookup("runtime.duffcopy", sym.SymVerABIInternal); s != 0 && ldr.AttrReachable(s) {
-               addLabelSyms(s, 8, 8*64)
-       }
-       if s := ldr.Lookup("runtime.duffzero", sym.SymVerABIInternal); s != 0 && ldr.AttrReachable(s) {
-               addLabelSyms(s, 4, 4*64)
-       }
-
        if ctxt.IsDarwin() {
                big := false
                for _, seg := range ld.Segments {
@@ -1325,8 +1314,7 @@ func gensymlate(ctxt *ld.Link, ldr *loader.Loader) {
                }
                t := ldr.SymType(s)
                if t.IsText() {
-                       // Except for Duff's devices (handled above), we don't
-                       // target the middle of a function.
+                       // We don't target the middle of a function.
                        continue
                }
                if t >= sym.SDWARFSECT {