[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-24 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

H.J. Lu  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #14 from H.J. Lu  ---
Fixed for 2.37 and 2.36/2.35 branches.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-24 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

--- Comment #13 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_35-branch branch has been updated by H.J. Lu
:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1ae65e19b214068e0fd3389f755d5a4aca83

commit 1ae65e19b214068e0fd3389f755d5a4aca83
Author: H.J. Lu 
Date:   Sun Jan 24 07:00:34 2021 -0800

DWARF-5: Ignore empty range in DWARF-5 line number tables

The DWARF5 spec does indeed explicitly say: "A bounded range entry whose
beginning and ending address offsets are equal (including zero) indicates
an empty range and may be ignored."

Since arange_add already ignores empty ranges, remove the whole check
which is equivalent to the check plus explicit continue.

PR binutils/27231
* dwarf2.c (read_rnglists): Ignore empty range when parsing line
number tables.

(cherry picked from commit 940d0202fd472b09d370fb483bf5a8ae99c9c830)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-24 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

--- Comment #12 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_36-branch branch has been updated by H.J. Lu
:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5876ea37dfab3441007011d9258a25a98cd55649

commit 5876ea37dfab3441007011d9258a25a98cd55649
Author: H.J. Lu 
Date:   Sun Jan 24 07:00:34 2021 -0800

DWARF-5: Ignore empty range in DWARF-5 line number tables

The DWARF5 spec does indeed explicitly say: "A bounded range entry whose
beginning and ending address offsets are equal (including zero) indicates
an empty range and may be ignored."

Since arange_add already ignores empty ranges, remove the whole check
which is equivalent to the check plus explicit continue.

PR binutils/27231
* dwarf2.c (read_rnglists): Ignore empty range when parsing line
number tables.

(cherry picked from commit 940d0202fd472b09d370fb483bf5a8ae99c9c830)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-24 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

--- Comment #11 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=940d0202fd472b09d370fb483bf5a8ae99c9c830

commit 940d0202fd472b09d370fb483bf5a8ae99c9c830
Author: H.J. Lu 
Date:   Sun Jan 24 07:00:34 2021 -0800

DWARF-5: Ignore empty range in DWARF-5 line number tables

The DWARF5 spec does indeed explicitly say: "A bounded range entry whose
beginning and ending address offsets are equal (including zero) indicates
an empty range and may be ignored."

Since arange_add already ignores empty ranges, remove the whole check
which is equivalent to the check plus explicit continue.

PR binutils/27231
* dwarf2.c (read_rnglists): Ignore empty range when parsing line
number tables.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-24 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

--- Comment #10 from Mark Wielaard  ---
(In reply to Jakub Jelinek from comment #9)
> (In reply to H.J. Lu from comment #6)
> > 
> >   if ((low_pc == 0 && high_pc == 0) || low_pc == high_pc)
> > return FALSE;
> > 
> > in read_rnglists().  Is this a GCC 11 bug?
> 
> No, binutils bug.
> There is nothing special about 0 low or high pc or low_pc == high_pc in
> .debug_rnglists.  The list termination is rather DW_RLE_end_of_list.

The DWARF5 spec does indeed explicitly say:
"A bounded range entry whose beginning and ending address offsets are equal
(including zero) indicates an empty range and may be ignored."
So your patch
https://sourceware.org/pipermail/binutils/2021-January/115073.html looks
correct.

Note that arange_add already ignores empty ranges, so just remove the whole
check should be equivalent to the check plus explicit continue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-24 Thread jakub at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

--- Comment #9 from Jakub Jelinek  ---
(In reply to H.J. Lu from comment #6)
> GCC 11 also generates:
> 
> 0176 2097 (base address)
> 017f 2097 20f8 
> 0182 213d 213d (start == end)
> 0187 233f 2346 
> 018c 
> 
> .LLRL171:
> .byte   0x5   
> .quad   .LBB2156
> .byte   0x4   
> .uleb128 .LBB2156-.LBB2156
> .uleb128 .LBE2156-.LBB2156
> .byte   0x4
> .uleb128 .LBB2157-.LBB2156
> .uleb128 .LBE2157-.LBB2156
> .byte   0x4
> .uleb128 .LBB2158-.LBB2156
> .uleb128 .LBE2158-.LBB2156
> .byte   0
> 
> This triggers:
> 
>   if ((low_pc == 0 && high_pc == 0) || low_pc == high_pc)
> return FALSE;
> 
> in read_rnglists().  Is this a GCC 11 bug?

No, binutils bug.
There is nothing special about 0 low or high pc or low_pc == high_pc in
.debug_rnglists.  The list termination is rather DW_RLE_end_of_list.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-23 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

H.J. Lu  changed:

   What|Removed |Added

 Resolution|FIXED   |---
 Status|RESOLVED|REOPENED

--- Comment #8 from H.J. Lu  ---
In gcc.o, GCC 11 generates 139:

0524 3750 3750 (start == end)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-23 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

--- Comment #7 from H.J. Lu  ---
There are

.LLRL174:
.byte   0x5 
.quad   .LBB2159
.byte   0x4 
.uleb128 .LBB2159-.LBB2159
.uleb128 .LBE2159-.LBB2159
.byte   0x4 
.uleb128 .LBB2163-.LBB2159
.uleb128 .LBE2163-.LBB2159
.byte   0x4 
.uleb128 .LBB2174-.LBB2159
.uleb128 .LBE2174-.LBB2159
.byte   0

for

.LBB2163:
.LBB2161:
.loc 1 7563 17 is_stmt 1 view .LVU1621
.loc 1 7573 3 view .LVU1622
.loc 1 7573 3 is_stmt 0 view .LVU1623
.LBE2161:
.LBE2163:
.loc 1 7787 3 is_stmt 1 view .LVU1624
.LBB2164:
.loc 1 7789 5 view .LVU1625
.loc 1 7790 5 view .LVU1626
.loc 1 7790 21 is_stmt 0 view .LVU1627
movq-312(%rbp), %rax
movq-336(%rbp), %r15
.LBB2165:

.LBB2163 and .LBE2163 have the same address.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-23 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

H.J. Lu  changed:

   What|Removed |Added

 CC||jakub at redhat dot com

--- Comment #6 from H.J. Lu  ---
GCC 11 also generates:

0176 2097 (base address)
017f 2097 20f8 
0182 213d 213d (start == end)
0187 233f 2346 
018c 

.LLRL171:
.byte   0x5   
.quad   .LBB2156
.byte   0x4   
.uleb128 .LBB2156-.LBB2156
.uleb128 .LBE2156-.LBB2156
.byte   0x4
.uleb128 .LBB2157-.LBB2156
.uleb128 .LBE2157-.LBB2156
.byte   0x4
.uleb128 .LBB2158-.LBB2156
.uleb128 .LBE2158-.LBB2156
.byte   0

This triggers:

  if ((low_pc == 0 && high_pc == 0) || low_pc == high_pc)
return FALSE;

in read_rnglists().  Is this a GCC 11 bug?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-23 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from H.J. Lu  ---
Fixed for 2.36 and binutils-2_35-branch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-23 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

--- Comment #4 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_35-branch branch has been updated by H.J. Lu
:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0da7136ac1a83080996247551286019066fbd0e3

commit 0da7136ac1a83080996247551286019066fbd0e3
Author: H.J. Lu 
Date:   Sat Jan 23 18:17:37 2021 -0800

DWARF-5: Fix parsing DWARF-5 line number tables

Advance rngs_ptr when parsing DW_RLE_offset_pair, which was missing in

commit c3757b583d2448a5996e83e374fb96ac7938da35
Author: Mark Wielaard 
Date:   Tue Aug 25 15:33:00 2020 +0100

Fix the linker's handling of DWARF-5 line number tables.

PR binutils/27231
* dwarf2.c (read_rnglists): Advance rngs_ptr after
_bfd_safe_read_leb128 when parsing DW_RLE_offset_pair.

(cherry picked from commit 18454c151f5824564130ba626bd90e9de30444ef)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-23 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_36-branch branch has been updated by H.J. Lu
:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=74c1e3df55c9e418e231a1ef36ff706688a3088b

commit 74c1e3df55c9e418e231a1ef36ff706688a3088b
Author: H.J. Lu 
Date:   Sat Jan 23 18:17:37 2021 -0800

DWARF-5: Fix parsing DWARF-5 line number tables

Advance rngs_ptr when parsing DW_RLE_offset_pair, which was missing in

commit c3757b583d2448a5996e83e374fb96ac7938da35
Author: Mark Wielaard 
Date:   Tue Aug 25 15:33:00 2020 +0100

Fix the linker's handling of DWARF-5 line number tables.

PR binutils/27231
* dwarf2.c (read_rnglists): Advance rngs_ptr after
_bfd_safe_read_leb128 when parsing DW_RLE_offset_pair.

(cherry picked from commit 18454c151f5824564130ba626bd90e9de30444ef)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-23 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

--- Comment #2 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=18454c151f5824564130ba626bd90e9de30444ef

commit 18454c151f5824564130ba626bd90e9de30444ef
Author: H.J. Lu 
Date:   Sat Jan 23 18:17:37 2021 -0800

DWARF-5: Fix parsing DWARF-5 line number tables

Advance rngs_ptr when parsing DW_RLE_offset_pair, which was missing in

commit c3757b583d2448a5996e83e374fb96ac7938da35
Author: Mark Wielaard 
Date:   Tue Aug 25 15:33:00 2020 +0100

Fix the linker's handling of DWARF-5 line number tables.

PR binutils/27231
* dwarf2.c (read_rnglists): Advance rngs_ptr after
_bfd_safe_read_leb128 when parsing DW_RLE_offset_pair.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/27231] objdump -S doesn't work on DWARF5 generated by GCC 11

2021-01-23 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27231

H.J. Lu  changed:

   What|Removed |Added

 CC||mark at klomp dot org
   Assignee|unassigned at sourceware dot org   |hjl.tools at gmail dot 
com
   Target Milestone|--- |2.36

--- Comment #1 from H.J. Lu  ---
A patch is posted at

https://sourceware.org/pipermail/binutils/2021-January/115065.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.