This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Fix FRV switch table generation in PIC mode
On Fri, Feb 23, 2007 at 03:56:06PM +0000, Nick Clifton wrote:
> I tried that - it did not work. You still end up with the jump table in
> the .rodata section. This then fails to assemble because the entries in
> the jump table are computed as the difference between the table's label
> (in .rodata) and the jump destination (in .text).
We want one of these things, in order of preference:
(1) Constant jump tables outside the text section. This mostly makes
for nice disassembly, but also can avoid code/data cache pollution,
depending on the cpu.
(2) Constant jump tables inside the text section. Constant tables are
much preferable to non-constant jump tables, no matter where we
have to put them.
I'm a bit confused that the assembler rejects the difference, since
that should in fact be a fixed displacement at link time. I poked
around the assembler, and there doesn't seem to be a way to generate
the GPREL32 relocation, which would be another good choice, though
it would require a slightly different insn sequence to use it.
So, failing all that, there *is* a good reason to use
JUMP_TABLES_IN_TEXT_SECTION, and that is that the assembler is lame.
So I think you should go back to that patch.
r~