diff options
author | Alan Modra <amodra@gmail.com> | 2022-12-30 11:41:16 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-12-30 21:31:19 +1030 |
commit | a984f112b015b7d33c3c91230eb4c35695926539 (patch) | |
tree | e281f75aef778bb92811dd00359ed86a60ee99b5 /gas | |
parent | fb4646cf1ae4efb70714c323797707e8e09055a0 (diff) | |
download | fsf-binutils-gdb-a984f112b015b7d33c3c91230eb4c35695926539.zip fsf-binutils-gdb-a984f112b015b7d33c3c91230eb4c35695926539.tar.gz fsf-binutils-gdb-a984f112b015b7d33c3c91230eb4c35695926539.tar.bz2 |
PR29948, heap-buffer-overflow in display_debug_lines_decoded
This fixes a couple of places in display_debug_lines_decoded that were
off by one in checking DWARF5 .debug_line directory indices. It also
displays the DWARF5 entry 0 for the program current directory rather
than "." as is done for pre-DWARF5. I decided against displaying
DW_AT_comp_dir for pre-DWARF5 since I figure it is better for readelf
to minimally interpret debug info.
binutils/
PR 29948
* dwarf.c (display_debug_lines_decoded): Display the given
directory entry 0 for DWARF5. Properly check directory index
against number of entries in the table. Revert to using
unsigned int for n_directories and associated variables.
Correct warning messages.
gas/
* testsuite/gas/elf/dwarf-5-loc0.d: Update.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/gas/elf/dwarf-5-loc0.d | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/testsuite/gas/elf/dwarf-5-loc0.d b/gas/testsuite/gas/elf/dwarf-5-loc0.d index 7e8473a..9439d10 100644 --- a/gas/testsuite/gas/elf/dwarf-5-loc0.d +++ b/gas/testsuite/gas/elf/dwarf-5-loc0.d @@ -7,10 +7,10 @@ Contents of the \.debug_line section: -CU: \./foo\.c: +CU: .*/gas/testsuite/foo\.c: File name +Line number +Starting address +View +Stmt -\./foo.c:\[\+\+\] +.*/gas/testsuite/foo.c: foo\.c +1 +0x8 +x foo\.c +2 +0x10 +x foo\.c +- +0x10 |