Bug 3433 - Incorrect line numbers with certain branches
Summary: Incorrect line numbers with certain branches
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-30 14:55 UTC by Andrew Stubbs
Modified: 2006-10-30 14:55 UTC (History)
1 user (show)

See Also:
Host:
Target: sh-*-*
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Stubbs 2006-10-30 14:55:39 UTC
Given the following example:

--------------------------------
        .file 1 "test.c"
        .text
        .loc 1 2
        nop
        .loc 1 1000
        bt 0f
        nop

        .align 9, 0
0:
--------------------------------

The SH assembler produces an object file with the wrong line numbers in the
debug info.

In this case the offset is too large for the 'bt' instruction so it is converted
to two branches. In examples where this is not the case the line numbering is fine.

$ ./gas/as-new -o test2.o test2.s
test2.s: Assembler messages:
test2.s:6: Warning: overflow in branch to L1; converted into longer instruction
sequence
$ ./binutils/objdump -dl test2.o

test2.o:     file format elf32-sh

Disassembly of section .text:

00000000 <.text>:
blah/test.c:2
   0:   00 09           nop
   2:   8b 01           bf      0x8
   4:   a0 fc           bra     0x200
blah/test.c:1000
   6:   00 09           nop
   8:   00 09           nop
        ...

Note that line 1000 is supposed to start two instructions earlier; before the 'bf'.