[Bug debug/98776] DW_AT_low_pc is inconsistent with function entry address, when enabling -fpatchable-function-entry
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jun 30 08:06:37 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98776
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #5)
> (In reply to Richard Biener from comment #4)
> > Martin, can you bisect what fixed it?
>
> Sure. Please help me how to verify what is a correct output? Isn't that
> related to DWARF 5 change done in GCC 11?
It's consistent with -gdwarf-2 -gstrict-dwarf as well, so no.
A broken executable will output a short disassembly from gdb:
> gcc-10 t.c -g -O -fpatchable-function-entry=16
> gdb -ex 'disassemble foo' -batch ./a.out | wc -l
3
actual output is
Dump of assembler code for function foo:
0x00000000004004a6 <+0>: ret
End of assembler dump.
where a correctly working one is
> gdb -ex 'disassemble foo' -batch ./a.out | wc -l
19
with output
Dump of assembler code for function foo:
0x0000000000400476 <+0>: nop
0x0000000000400477 <+1>: nop
0x0000000000400478 <+2>: nop
0x0000000000400479 <+3>: nop
0x000000000040047a <+4>: nop
0x000000000040047b <+5>: nop
0x000000000040047c <+6>: nop
0x000000000040047d <+7>: nop
0x000000000040047e <+8>: nop
0x000000000040047f <+9>: nop
0x0000000000400480 <+10>: nop
0x0000000000400481 <+11>: nop
0x0000000000400482 <+12>: nop
0x0000000000400483 <+13>: nop
0x0000000000400484 <+14>: nop
0x0000000000400485 <+15>: nop
0x0000000000400486 <+16>: ret
End of assembler dump.
More information about the Gcc-bugs
mailing list