This is the mail archive of the gcc@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]

PIC and access to constant variables.


Hi,

I have again some questions about the ARM PIC option
(Gcc 3.1 + options : -mthumb -mthumb-interwork -fpic)
In my source file, I define a const string:
    char const *s="coucou";

and I call a function (with the TPCS standard) by:
      sDisplayPuts(1,s);

By looking the assembler generated, I have found a problem.
To access to the constant string (located a the ReadOnly Section), the 
file access to the GOT section where an address in DATA section is 
loaded. After, He access to this address (in data - Read Write) where 
the address in Read/Only section for the Constant string is present.
My problem is that for my use, I did'nt load the RAM and I would like 
that to access to this constant, the address in the GOT section is the 
address of the constant string (so the RO address).
I think also that for the relocation, if I change and recreate the GOT 
section, It isn't enough: I must go to the data address to change the 
store address of the constant string ... strange ...
I have noticed that this problem is present for all the pointers of 
constant variables (int const *i ...)
Does it exist an option to specify that the access to constant are made 
directly (or pc-relatively) ?

Thanks and regards
Thierry


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