Bug 6956 - When in MRI mode, local labels don't work correctly
Summary: When in MRI mode, local labels don't work correctly
Status: RESOLVED INVALID
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: 2008-10-09 21:42 UTC by Miro Kropacek
Modified: 2008-10-11 14:40 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miro Kropacek 2008-10-09 21:42:27 UTC
Take this example code (m68k, MRI mode)

xxxglob:
        dc.w    -1

1:      nop
        bra.b     1f

ffxxx:
        dc.w    -2

1:      nop
        bra.b   1b

it assembles into this:

ff ff (-1)
4e 71 (nop)
60 02 (bra.b +2 bytes)
ff fe (-2)
4e 71 (nop)
60 f5 (bra -11 bytes, wtf?! it should be bra -2 bytes here!)
ab cd (0xabcd)

I tested it even on old gas 2.13 and this bug is here... strange nobody noticed
it. It happens only when in MRI mode.
Comment 1 Andreas Schwab 2008-10-11 14:40:39 UTC
In MRI mode, 1b is a number in base 2.  MRI mode is only for compatibility with 
existing MRI assembler code, don't use it.