Trevor Scroggins <trevor.scrogg...@gmail.com> writes:

> Hello, all. I'm attempting to port GCC 4.4.0 to a new m68k target. The
> target begins execution in the first byte of the first text section.
> Adding '#define CONSTANT_POOL_BEFORE_FUNCTION 0' in my target's tm.h
> seems like the simplest way to avoid execution of read-only data;
> however, defining the constant has no effect on compilation. (Note,
> custom or missing startup code is common, so I can't work around it
> there.)
>
> The only references to CONSTANT_POOL_BEFORE_FUNCTION are in varasm.c,
> and the only target current using the definition is pdp11--not exactly
> current. Is CONSTANT_POOL_BEFORE_FUNCTION still being used, or have I
> hit upon a section of dead code? Is there a simple way to relocate
> read-only data to the end of a function without writing a
> target-specific reorg routine? Jumping over the data in a prologue
> might be an easy, quick and dirty solution, but the target is a
> memory-constrained system, and that seems wasteful.

Setting CONSTANT_POOL_BEFORE_FUNCTION to 0 ought to work to emit the
constant pool after the function.  However, to be clear, it only affects
the constant pool which holds constants which are not
LEGITIMATE_CONSTANT_P.  This is normally things like 32-bit constants
which RISC architectures can not handle in a single instruction.  The
m68k is a flexible architecture and can handle 32-bit constants just
fine without using a constant pool.  You didn't really describe what you
are seeing; what makes you think that the constant pool is the problem?

Ian

Reply via email to