PowerPC relocatable data

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

 



I've been trying to get gcc/binutils to create an executable that
supports relocatable data for a powerpc 7450 "embedded system".
I'm able to get it done with the -mrelocatable option, but
I'm required to relocate the .text segment along with the global offset table (from Flash to somewhere in RAM). After that, I able to modify the pointers in the GOT to point to wherever I put the non-automatic/non-heap data. My problem is that I don't want to move the .text segment to RAM because I need to conserve RAM space.

I'm required to move the .text segment along with the GOT because of the way the C function prologue is implemented. The prologue code calculates the address of the GOT based on the current location of the instructions for the function.

Is there a way to make the tool chain generate code that doesn't require moving the .text segment along with the GOT? Are there options that can make it assume that the GOT pointer is already setup in r2 (for example). I tried the -mtoc option but it didn't change the code that was generated (maybe because it's just for the AIX ABI?). I have tried configuring the gcc/binutils build for the powerpc-7450-eabi and the powerpc-7450-elf targets, but they both generated the same type of code. I've been using gcc 4.0.2 and binutils 2.16.1. I've tried all sorts of various compiler/linker options with no luck.

Tate Bachmeier

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux