This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

About GCC-ARM assembler


Hello!  I have a question.
I don't understand this.

I want to use this instruction , ldr __a1, |dummy.0| 
, instead of these instructions 
  ldr     __a4, |L..7|
  ldr     __a1, [__a4, #0]    

This code, ldr __a1, |dummy.0| work well in SDT simulator. 

Why GCC access this variable indirectly?
-------------------------------------------------------------
        IMPORT  |__main|
        AREA |C$$data1|, DATA
        ALIGN
|dummy.0|
        KEEP |dummy.0|
        DCD     0

        AREA |C$$code2|, CODE, READONLY
        ALIGN
        EXPORT  |main|
|main|
        ....

        ldr     __a4, |L..7|
       ldr     __a1, [__a4, #0]       (why?)
        
        ....

        ldmea   __fp, {__fp, __sp, __pc}^
|L..8|
        ALIGN
|L..7|
        DCD     |dummy.0|
        IMPORT __main
        DCD __main
        END
--------------------------------------------------------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]