On Linux/x86, assembler generates bogus line debug info with gas/i386/dw2-compress-1.s:
[...@gnu-6 compresss-1]$ make dw2-compress-1a.o ./as -o dw2-compress-1a.o dw2-compress-1.s [...@gnu-6 compresss-1]$ ./readelf -wl dw2-compress-1a.o Raw dump of debug contents of section .debug_line: Offset: 0x0 Length: 62 DWARF Version: 2 Prologue Length: 35 Minimum Instruction Length: 1 Initial value of 'is_stmt': 1 Line Base: 1 Line Range: 1 Opcode Base: 16 Opcodes: Opcode 1 has 0 args Opcode 2 has 1 args Opcode 3 has 1 args Opcode 4 has 1 args Opcode 5 has 1 args Opcode 6 has 0 args Opcode 7 has 0 args Opcode 8 has 0 args Opcode 9 has 1 args Opcode 10 has 0 args Opcode 11 has 0 args Opcode 12 has 1 args Opcode 13 has 0 args Opcode 14 has 0 args Opcode 15 has 0 args The Directory Table is empty. The File Name Table: Entry Dir Time Size Name 1 0 0 0 file1.txt Line Number Statements: Extended opcode 2: set Address to 0x0 Advance Line by 3 to 4 Copy Copy Extended opcode 2: set Address to 0x4 Extended opcode 1: End of Sequence Offset: 0x42 Length: 25 DWARF Version: 2 Prologue Length: 19 Minimum Instruction Length: 1 Initial value of 'is_stmt': 1 Line Base: -5 Line Range: 14 Opcode Base: 13 Opcodes: Opcode 1 has 0 args Opcode 2 has 1 args Opcode 3 has 1 args Opcode 4 has 1 args Opcode 5 has 1 args Opcode 6 has 0 args Opcode 7 has 0 args Opcode 8 has 0 args Opcode 9 has 1 args Opcode 10 has 0 args Opcode 11 has 0 args Opcode 12 has 1 args The Directory Table is empty. The File Name Table is empty. Line Number Statements: [...@gnu-6 compresss-1]$ But --- Offset: 0x42 Length: 25 DWARF Version: 2 Prologue Length: 19 Minimum Instruction Length: 1 Initial value of 'is_stmt': 1 Line Base: -5 Line Range: 14 Opcode Base: 13 Opcodes: Opcode 1 has 0 args Opcode 2 has 1 args Opcode 3 has 1 args Opcode 4 has 1 args Opcode 5 has 1 args Opcode 6 has 0 args Opcode 7 has 0 args Opcode 8 has 0 args Opcode 9 has 1 args Opcode 10 has 0 args Opcode 11 has 0 args Opcode 12 has 1 args The Directory Table is empty. The File Name Table is empty. Line Number Statements: ---- aren't in assembly input. They are generated by dwarf2_finish, which puts bogus line debug info into .debug_line section even when it isn't empty. This bug can be fixed by the same patch for PR 10531. -- Summary: Bogus line debug info Product: binutils Version: 2.21 (HEAD) Status: NEW Severity: normal Priority: P2 Component: gas AssignedTo: unassigned at sources dot redhat dot com ReportedBy: hjl dot tools at gmail dot com CC: bug-binutils at gnu dot org http://sourceware.org/bugzilla/show_bug.cgi?id=11789 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils