From fd957ef3c15055cd633717380745d366640dfb2f Mon Sep 17 00:00:00 2001 From: rearnsha Date: Mon, 18 Mar 2002 11:26:24 +0000 Subject: * arm.md (tablejump): Make this a define_expand. For PIC add the offset to the base of the table. (thumb_tablejump): Matcher for Thumb tablejump insn. * config/arm/aout.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output thumb entries as the difference of two labels. * config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Likewise. * config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Only put ARM jump tables in the code. * config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Likewise. * arm.c (get_jump_table_size): If the table is not in the text section, return zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50960 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/arm/aof.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gcc/config/arm/aof.h') diff --git a/gcc/config/arm/aof.h b/gcc/config/arm/aof.h index 750bc08d123..f110ea215d1 100644 --- a/gcc/config/arm/aof.h +++ b/gcc/config/arm/aof.h @@ -120,6 +120,10 @@ do { \ (*ptr++) (); \ } while (0) +/* We really want to put Thumb tables in a read-only data section, but + switching to another section during function output is not + possible. We could however do what the SPARC does and defer the + whole table generation until the end of the function. */ #define JUMP_TABLES_IN_TEXT_SECTION 1 #ifndef ARM_OS_NAME @@ -322,8 +326,13 @@ do { \ /* Output of Dispatch Tables */ -#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM,BODY,VALUE,REL) \ - fprintf ((STREAM), "\tb\t|L..%d|\n", (VALUE)) +#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM,BODY,VALUE,REL) \ + do { \ + if (TARGET_ARM) \ + fprintf ((STREAM), "\tb\t|L..%d|\n", (VALUE)); \ + else \ + fprintf ((STREAM), "\tDCD\t|L..%d| - |L..%d|\n", (VALUE), (REL)); \ + } while (0) #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE) \ fprintf ((STREAM), "\tDCD\t|L..%d|\n", (VALUE)) -- cgit v1.2.1