From bef2bb80a942a06bda2ff3aaedf46ff42d43aaf0 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Thu, 12 Dec 2024 20:47:30 -0500 Subject: cmd/compile,cmd/link: move to DWARF5-style location lists This patch updates the compiler to generate DWARF5-style location lists (e.g. entries that feed into .debug_loclists) as opposed to DWARF4-style location lists (which wind up in .debug_loc). The DWARF5 format is much more compact, and can make indirect references to text addresses via the .debug_addr section for further space savings. Updates #26379. Change-Id: If2e6fce1136d9cba5125ea51a71419596d1d1691 Reviewed-on: https://go-review.googlesource.com/c/go/+/635836 LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase Reviewed-by: Dmitri Shuralyov --- src/cmd/internal/dwarf/dwarf_defs.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/cmd/internal') diff --git a/src/cmd/internal/dwarf/dwarf_defs.go b/src/cmd/internal/dwarf/dwarf_defs.go index db4245e95d..b4675cb193 100644 --- a/src/cmd/internal/dwarf/dwarf_defs.go +++ b/src/cmd/internal/dwarf/dwarf_defs.go @@ -465,6 +465,20 @@ const ( DW_RLE_start_length = 0x7 ) +// Table 7.10 (DWARF version 5), containing the encodings for the +// .debug_loclists entry formats. +const ( + DW_LLE_end_of_list = 0x0 + DW_LLE_base_addressx = 0x1 + DW_LLE_startx_endx = 0x2 + DW_LLE_startx_length = 0x3 + DW_LLE_offset_pair = 0x4 + DW_LLE_default_location = 0x5 + DW_LLE_base_address = 0x6 + DW_LLE_start_end = 0x7 + DW_LLE_start_length = 0x8 +) + // Table 7.27 (DWARF version 5), containing the encodings for the // line number header entry formats. const ( -- cgit v1.3