bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Two minor gas bugs on ARM, one bug fix.


From: Frank Yellin
Subject: Two minor gas bugs on ARM, one bug fix.
Date: Tue, 19 Jun 2001 13:55:02 -0700 (PDT)

I'm running "GNU assembler 2.10.1"

Two minor bugs.

============================================================

The conditional form of "adrl" is supposed to be "adrCCl", eg "adreql".
gas incorrectly wants "adrlCC".  The ARM manuals are clear that the condition
codes come >>before<< other suffixes.

To fix this bug, I modified the table entry for "adr" to be
    {"adr",   0x028f0000, NULL,   cplong_flag, ARM_ANY,      do_adr},

I then changed do_adr() so that it started with:
     if (flags & 0x00400000) { 
         /* This routine was called instead of do_adrl because the
          * code contained an opcode like adreql, which looks like "adr"
          * rather than "adrl" to the parser.
          */
         do_adrl(str, flags & ~0x00400000);
         return;
    }

Yes, using cplong_flag is a hack, but it happened to already contain the
single flag I was looking for.  

Using this code, the assembler accepts both adrleq and adreql.


============================================================

The literal pool seems to not be careful about duplicates symbols.
For example, when I assemble
        ldr         r0,=Test
        ldr         r0,=Test
        ldr         r0,=Test
and then look at the disassembled code, each instruction is referencing a
different element of the literal pool.

However, the code does do the right thing for constants:
        ldr         r0,=1234
        ldr         r0,=1234
        ldr         r0,=1234
All three instructions reference the same element of the constant pool.

The code add_to_lit_pool() seems to look for duplicated constants, but
doesn't look for duplicated symbols.  I don't know enough about the symbol
table mechanism to try and fix this.


== Frank Yellin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]