[v2,3/4] gdb/dwarf: don't store segment_collector_size (sic)

Message ID 20260921173951.688121-4-simon.marchi@efficios.com
State New
Headers
Series Fix reading DW_FORM_addrx with address size of 2 |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed

Commit Message

Simon Marchi Sept. 21, 2026, 5:39 p.m. UTC
  I noticed that structure loclists_rnglists_header stored the segment
selector size (which seems to be misspelled as "collector").  Nothing
uses that, and it has even been removed from the DWARF 6 draft (it stays
as a "reserved" field).  Remove the structure field and simply skip it.

There are other functions (read_addrmap_from_aranges and
dwarf_decode_line_header) that do read it, only to validate that it's 0,
but it didn't seem useful to me to add such a check here (we could even
remove these other ones).

Change-Id: If73f510398bef2cb1215ce7ec2e4e083d5a50697
---
 gdb/dwarf2/read.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
  

Patch

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index c1454a664bef..2f38dfdaf970 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -238,10 +238,6 @@  struct loclists_rnglists_header
      the target system.  */
   unsigned char addr_size;
 
-  /* A 1-byte unsigned integer containing the size in bytes of a segment selector
-     on the target system.  */
-  unsigned char segment_collector_size;
-
   /* A 4-byte count of the number of offsets that follow the header.  */
   unsigned int offset_entry_count;
 };
@@ -14098,7 +14094,7 @@  read_loclists_rnglists_header (struct loclists_rnglists_header *header,
 	   section->get_name (), header->addr_size,
 	   section->get_file_name ());
 
-  header->segment_collector_size = read_1_byte (abfd, info_ptr);
+  /* Skip segment_selector_size.  */
   info_ptr += 1;
 
   header->offset_entry_count = read_4_bytes (abfd, info_ptr);