You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmd/compile,cmd/link: move to DWARF5-style range lists
This patch updates the compiler to generate DWARF5-style range lists
(e.g. entries that feed into .debug_rnglists) as opposed to
DWARF4-style range lists (which wind up in .debug_ranges). The DWARF5
format is much more compact, and can make indirect references to text
address via the .debug_addr section for further space savings.
Updates #26379.
Change-Id: I273a6283484b7fe33d79d5412e31c5155b22a7c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/635345
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: David Chase <[email protected]>
// Walk the relocations of the subprogram DIE symbol to collect
2248
-
// relocations corresponding to indirect function references
2249
-
// via .debug_addr.
2250
-
drelocs:=d.ldr.Relocs(infosym)
2251
-
forri:=0; ri<drelocs.Count(); ri++ {
2252
-
r:=drelocs.At(ri)
2253
-
if!r.Type().IsDwTxtAddr() {
2254
-
continue
2255
-
}
2256
-
rsym:=r.Sym()
2257
-
rst:=d.ldr.SymType(rsym)
2258
-
// Do some consistency checks.
2259
-
if!rst.IsText() {
2260
-
// R_DWTXTADDR_* relocation should only refer to text
2261
-
// symbols, so something apparently went wrong here.
2262
-
log.Fatalf("internal error: R_DWTXTADDR_* relocation on dwinfosym for %s against non-function %s type:%s", d.ldr.SymName(fnSym), d.ldr.SymName(rsym), rst.String())
2263
-
}
2264
-
ifrunit:=d.ldr.SymUnit(rsym); runit!=unit {
2265
-
log.Fatalf("internal error: R_DWTXTADDR_* relocation target text sym unit mismatch (want %q got %q)", unit.Lib.Pkg, runit.Lib.Pkg)
// Walk the relocations of the various DWARF symbols to
2267
+
// collect relocations corresponding to indirect function
2268
+
// references via .debug_addr.
2269
+
dsyms=dsyms[:0]
2270
+
dsyms=append(dsyms, infosym)
2271
+
ifrangessym!=0 {
2272
+
dsyms=append(dsyms, rangessym)
2273
+
}
2274
+
for_, dsym:=rangedsyms {
2275
+
drelocs:=d.ldr.Relocs(dsym)
2276
+
forri:=0; ri<drelocs.Count(); ri++ {
2277
+
r:=drelocs.At(ri)
2278
+
if!r.Type().IsDwTxtAddr() {
2279
+
continue
2280
+
}
2281
+
rsym:=r.Sym()
2282
+
rst:=d.ldr.SymType(rsym)
2283
+
// Do some consistency checks.
2284
+
if!rst.IsText() {
2285
+
// R_DWTXTADDR_* relocation should only refer to
2286
+
// text symbols, so something apparently went
2287
+
// wrong here.
2288
+
log.Fatalf("internal error: R_DWTXTADDR_* relocation on dwinfosym for %s against non-function %s type:%s", d.ldr.SymName(fnSym), d.ldr.SymName(rsym), rst.String())
2289
+
}
2290
+
ifrunit:=d.ldr.SymUnit(rsym); runit!=unit {
2291
+
log.Fatalf("internal error: R_DWTXTADDR_* relocation target text sym unit mismatch (want %q got %q)", unit.Lib.Pkg, runit.Lib.Pkg)
0 commit comments