M68K MRI Mode "Bug" with Local Labels?

Project Revolution projectrevotpp@hotmail.com
Sun Oct 31 07:09:59 GMT 2021


Gentlemen,

I've been trying to figure out how to declare local labels similar to "@loop:" and the like, like what ASM68K supports, however, --mri mode didnt seem to support that syntax. However, while exploring alternatives, I ran into this peculiar test code:

MyGlobalLabel1:
1:
    dbf %d6,1b
    dbf %d6,MyGlobalLabel1

MyGlobalLabel2:
1:
    dbf %d6,1b
    dbf %d6,MyGlobalLabel2

If assembled with "m68k-linux-gnu-as test.asm -o test.o" it generates the expected offsets (hint: both dbf instructions need to reference the same label). However, if you add --mri, it no longer generates sensible offsets for those local label instructions, in fact it has pretty nonsense offsets (6 and E for some reason). What's going on here? Is there a function scope way to do local labels like what ASM68K supported out of the box? Is this a bug? We need --mri for what we are doing: removing this flag is not an option.

I have asked around including in the GCC IRC and they all basically referred me here; I am unsure if I am looking at assembler bug or not since the docs for M68K assembler are so sparce and thin.



More information about the Binutils mailing list