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]

problems relocating code and rodata sections (gcc 3.2 / arm)


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 dot parker at oxsemi dot com http://www.oxsemi.com




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