avr-gcc-list
[Top][All Lists]
Advanced

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

[avr-gcc-list] Position independent code with position dependent data ?


From: Renaud
Subject: [avr-gcc-list] Position independent code with position dependent data ?
Date: Thu, 1 Jul 2010 10:17:50 +0200

Hi there, and thanks for reading.

Here's the story :

My CPU has no MMU (AVR32UC3B), very little RAM (16KB), and is running
a modified FreeRTOS. I'd like to have the ability to "load" and run
some "standalone" code from RS232 or SDCARD to FLASH as a RTOS task.
>From now, this is working, but for convenience, a fully position
independent code would be easier to maintain in future. Using the -
fPIC or -fpic option, looking at the assembler, the code seems OK : a
dynamically computed offset (using PC relative instructions) is
applied to every operations.

BUT, looking deeply, both DATA and CODE are applied the same base
offset ! While this is the expected behavior for CODE (running
anywhere in FLASH), loading my CODE 16KB farther into FLASH, doesn't
mean moving my RAM from 16KB ! This make only sense when executing CODE
+DATA from RAM.

I'm looking for a solution to generate position independent *code*,
but with position dependent *data* using GCC/LD...

Any hints ?
reply via email to

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