Summary: | segmentation fault with -gdwarf-5 | ||
---|---|---|---|
Product: | binutils | Reporter: | Nick Desaulniers <ndesaulniers> |
Component: | gas | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | amodra, nickc |
Priority: | P2 | ||
Version: | 2.35 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | 2020-05-04 00:00:00 |
Description
Nick Desaulniers
2020-05-04 02:52:51 UTC
The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4706679daca21b5d637afaf5b55858b26f0f8c16 commit 4706679daca21b5d637afaf5b55858b26f0f8c16 Author: Nick Clifton <nickc@redhat.com> Date: Mon May 4 10:19:38 2020 +0100 Fix an illegal memory access in the assembler when generating a DWARF5 file/directory table with no entries. PR 25917 * dwarf2dbg.c (out_dir_and_file_list): Check for the directory table's existence before looking at its entries. * testsuite/gas/elf/pr25917.s: New test source file. * testsuite/gas/elf/pr25917.d: New test driver. * testsuite/gas/elf/elf.exp (run_elf_list_test): Run the new test. Hi Nick, Thanks for reporting this bug. It was a simple case of not checking to see if the directory table existed before trying to write it out... Cheers Nick readelf -wL on the testcase is interesting too. end of data encountered whilst reading LEB (In reply to Alan Modra from comment #3) > readelf -wL on the testcase is interesting too. > end of data encountered whilst reading LEB Oops - thanks for catching that Alan - the code is still generating a directory table entry even though there are no directories. I am testing a fix now. The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=070b775f03ebdab6d0d007787fe19b916af4439c commit 070b775f03ebdab6d0d007787fe19b916af4439c Author: Nick Clifton <nickc@redhat.com> Date: Mon May 4 13:50:05 2020 +0100 GAS: Do not create an entry for the default directory if the directory table is empty. Improve readelf's decoding of empty directory and file name tables. PR 25917 * dwarf.c (display_debug_lines_decoded): Warn if encountering a supicious number of entries for DWARF-5 format directory and file name tables. Do not display file name table header if the table is empty. Do not allocate space for empty tables. Right - this time it should be fixed for real. |