// 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
}
}
}
- // 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 {
}
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 {