[PR24444] speed up locview resolution wiht relaxable frags
Alexandre Oliva
oliva@gnu.org
Sat May 4 00:56:00 GMT 2019
On May 2, 2019, Alan Modra <amodra@gmail.com> wrote:
> On Tue, Apr 30, 2019 at 02:49:38AM -0300, Alexandre Oliva wrote:
>> AFAICT fixing this will require introducing artificial undefined symbols
>> to be used as previous view label and previous view number for each
>> subsection, and then, when ordering subsections and sections, defining
>> the initial previous symbols of each subsection as equal to the final
>> previous symbols of the previous subsection in the same section.
> Don't you already keep struct line_entry on per-subseg lists?
Yeah, sorry. I had indeed started out worried about that, but I failed
to remove some traces of that suspicion from my message even after I
narrowed the problem down to the boundaries.
This testcase demonstrates the problem: the generated line number
program has nonzero views at subsection boundaries, but the view numbers
computed and assigned by the view expressions do not match those implied
by the line number program, because we assume a view reset when first
entering a subsection.
This would only be appropriate (and even then somewhat problematic) if
we generated a separate line number program, or forced a view reset in
the line number program at subsection boundaries.
/* Test view numbering continuity at subsection borders.
Copyright (C) 2017-2019 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
.file "dwarf2-19.c"
.text 0
.balign 4
.globl _start
_start:
.file 1 "dwarf2-19.c"
.loc 1 1 view 0
.section .rodata
.uleb128 .L1
.uleb128 .L3
.uleb128 .L4
.uleb128 .L2
.text 1
.loc 1 2 view .L1 /* same address as view 0 above -> view 1 */
.text 2
.loc 1 3 view .L2 /* same address as .L4 below -> view 2 */
.text 1
.dc.l 0
.loc 1 4 view .L3 /* bumped address from .L1's, view 0 */
.loc 1 5 view .L4 /* same address, view 1 */
#as:
#readelf: -x.rodata -wL
#name: DWARF2 19
# The am33 avr cr16 crx ft32 mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time.
# The riscv targets do not support the subtraction of symbols.
# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions.
#notarget: am3*-* avr-* cr16-* crx-* ft32*-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-*
Hex dump of section '\.rodata':
0x00000000 01000102 *.*
Contents of the \.debug_line section:
CU: dwarf2-19\.c:
File name *Line number *Starting address *View +Stmt
dwarf2-19\.c *1 *0 +x
dwarf2-19\.c *2 *0 *1 +x
dwarf2-19\.c *4 *0x4 +x
dwarf2-19\.c *5 *0x4 *1 +x
dwarf2-19\.c *3 *0x4 *2 +x
--
Alexandre Oliva, freedom fighter he/him https://FSFLA.org/blogs/lxo
Be the change, be Free! FSF Latin America board member
GNU Toolchain Engineer Free Software Evangelist
Hay que enGNUrecerse, pero sin perder la terGNUra jamás - Che GNUevara
More information about the Binutils
mailing list