Kevin Lawton wrote:
>
> Essentially, I want to ensure that a handful of functions are
> placed in their own group of (4k) pages, apart from the other
> code/data pages.
>
> Is there a ld/as/gcc way to tag this group of functions to be
> loaded in a contiguous 4k page aligned section, and make sure
> there is no overlap with other code/data? I need to know the
> length of this section of code too.
Seems I can do all of this if I'm careful with the 'ld' line.
I made a module with:
asm (
".section r3h,\"ax\",@progbits \n\t"
".p2align 12 \n\t"
".globl r3hSectionStart \n\t"
"r3hSectionStart: \n\t"
);
and a similar one with an r3hSectionEnd label. Then tag
the few functions to go in this section, but in various modules like:
extern int xyz(int) __attribute__ ((section ("r3h")));
This will put the desired group of code in one contiguous region. To get the
size
of the region, load the files in a particular order:
gcc -o all.o mod1.o mod2.o r3hStart.o r3h1.o r3h2.o r3hEnd.o mod3.o
...
Seems to give me the desired alignment, exclusivity from other code pages,
and capability to calculate the size ( r3hSectionEnd - r3hSectionStart ).
There may be some other ways too. I'd be happy to hear about them.
-Kevin
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Kevin Lawton [EMAIL PROTECTED]
MandrakeSoft, Inc. Plex86 developer
http://www.linux-mandrake.com/ http://www.plex86.org/