Commit: Fix dir[0] in DWARF-5 line tables

Nick Clifton nickc@redhat.com
Mon Aug 9 16:23:00 GMT 2021


Hi Guys,

  It was recently reported that when GAS is generating DWARF-5 format
  directory tables the 0'th entry in the table can be a relative path,
  or in fact pretty much anything.  The DWARF standard however requires
  that the entry matches the DW_AT_comp_dir entry in the associated
  .debug_info for the CU.  (See the description of the directories field
  in section 6.2 of the DWARF-5 spec).

  So I am going to apply the patch below to fix the problem.  

Cheers
  Nick

gas/ChangeLog
2021-08-09  Nick Clifton  <nickc@redhat.com>

	* dwarf2dbg.c (get_directory_table_entry): Ensure that dir[0]
	contains current working directory.
	(out_dir_and_file_list): Likewise.
	* testsuite/gas/elf/dwarf-5-dir0.s: New test source file.
	* testsuite/gas/elf/dwarf-5-dir0.d: New test driver.
	* testsuite/gas/elf/elf.exp: Run the new test.
	* testsuite/gas/elf/dwarf-5-file0.d: Adjust expected output.
	* testsuite/gas/i386/dwarf5-line-1.d: Likewise.
	* testsuite/gas/i386/dwarf5-line-2.d: Likewise.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dwarf-5-dir0.patch
Type: text/x-patch
Size: 6382 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20210809/5835dfc5/attachment.bin>


More information about the Binutils mailing list