This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: CONSTANT_POOL_BEFORE_FUNCTION has no effect in tm.h?
> I doubt that there is any documentation on this, but I'd be happy to be
> surprised. ?TARGET_MACHINE_DEPENDENT_REORG is pretty much free to
> rearrange things however it likes.
>
> If you write
>
> const int ai[] = { 1 };
> int main() { }
>
> then in some cases the global const variable will be put into the
> readonly section of the object file before the function.
Ah. Understood.
/* [static] */ const int ai[] = { 1 };
int main () { }
locates a .long 1 in .text before main() just as
int main ()
{
foo("bar");
}
locates an .ascii "bar\0" in .text before main().
So, I'd have to relocate read-only globals as well.
Trev