public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* problems relocating code and rodata sections (gcc 3.2 / arm)
@ 2003-02-25 13:53 Andy Parker
  2003-02-26  2:38 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Parker @ 2003-02-25 13:53 UTC (permalink / raw)
  To: gcc

Hi there,
I wonder if anyone could advise me on a particular problem I'm having.

I'm compiling code using gcc 3.2 for an arm-elf target. I have a 
requirement to locate some functions of my code to execute from a modest 
sized region of ram. However, the problem is that I cannot get the 
compiler to redirect the contents of some internal .rodata sections.

I have attached section attributes to the respective function prototypes:

void ram_fn(void) __attribute__(__section__(".ramcode"));

Some of my functions contain switch contructs:

void ram_rn(void)
{
    switch(some_integer_i)
    {
       case 0:
         do_case0();
         break;
       case 1:
         do_case1();
         break;
       /* etc etc */
       default:
         break;
    }
}

I notice that the compiled code places my executable code into the 
.ramcode section. However, the switch table of jump vectors is contained 
in a homogenous .rodata section. This gives me a problem, as I would 
really like to isolate the entire contents of code which executes from 
ram from the rest of the code base.

I suspect that I could modify my linker script to specify the location 
of the .rodata section from a particular compilation unit into a 
particular region, but this will cause problems in my build environment.


Is there a way to persuade the compiler to generate separate .rodata 
sections on a per-compilation unit basis, in the same manner that gcc 
does for .text, .data, and .bss sections when --ffunction-sections and 
--fdata-sections are specified ?


Thanks,
Andy


-- 
Andy Parker                       Oxford Semiconductor Ltd
Tel: +44 (0) 1235 824 944         25 Milton Park, Abingdon,
Fax: +44 (0) 1235 821 141         Oxfordshire. OX14 4SH
andy.parker@oxsemi.com            http://www.oxsemi.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: problems relocating code and rodata sections (gcc 3.2 / arm)
  2003-02-25 13:53 problems relocating code and rodata sections (gcc 3.2 / arm) Andy Parker
@ 2003-02-26  2:38 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2003-02-26  2:38 UTC (permalink / raw)
  To: Andy Parker; +Cc: gcc

On Tue, Feb 25, 2003 at 01:10:42PM +0000, Andy Parker wrote:
> Is there a way to persuade the compiler to generate separate .rodata 
> sections on a per-compilation unit basis, in the same manner that gcc 
> does for .text, .data, and .bss sections when --ffunction-sections and 
> --fdata-sections are specified ?

Nope.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-26  0:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-25 13:53 problems relocating code and rodata sections (gcc 3.2 / arm) Andy Parker
2003-02-26  2:38 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).