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]

Dynamically relocatable .rodata section


Hi there

I am looking for a way that a register could be reserved
that is exclusively used to point to the base of the .data
section for architectures with a flat address space.

I would like to modify the compiler to generate assembly
that adds this base address to any reference within
the .data section.

In this way, the entire .data section is relocatable merely
by adjusting this register to point to a different offset
in memory. There is of course some overhead in the additional
ADD instruction whenever getting pointer offsets. There
is also the overhead of having one less register.

The point of such a feature is for embedded systems with
no MMU that wish to elegently support fork().

This effectively amounts to soft support for what the i?86
calls segment registers.

Currently uCLinux does some wierd hacks to support multiple
processors on machines with no MMU:

 http://mail-index.netbsd.org/netbsd-ports/2001/06/06/0002.html

Although this feature is not specifically for ucLinux,
embedded operating systems could benefit if GCC did
support this.

Does anyone have any thoughts?

Thanks

-paul

Paul Sheer Consulting IT Services . . Tel . . . +27 (0)21 6869634
Email . . . psheer@icon.co.za . . . . Work  . . +27 (0)21 6503467
Linux  development,  cryptography,  embedded,  support,  training
http://www.icon.co.za/~psheer . . . . . . http://rute.2038bug.com
L I N U X . . . . . . . . . . . .  The Choice of a GNU Generation


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