summaryrefslogtreecommitdiff
path: root/gcc/config/bfin/elf.h
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-29 14:11:07 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-29 14:11:07 +0000
commit55be0e321ba0662cd1562ec1ca0c3aeb78bb5628 (patch)
tree732dd171b1791bdb175f887cfa846cd7546dc5a7 /gcc/config/bfin/elf.h
parentd470ecbdb45fd3daa00e5d7eddbd74c80eaf7dbe (diff)
downloadgcc-55be0e321ba0662cd1562ec1ca0c3aeb78bb5628.tar.gz
* config/bfin/bfin.opt (mfdpic): New option.
* config/bfin/t-bfin-elf (EXTRA_PARTS): Add crtbeginS.o and crtendS.o. (EXTRA_MULTILIB_PARTS): Likewise. (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS): Use -fpic. (MULTILIB_OPTIONS, MULTILIB_EXCEPTIONS): Build one extra -mfdpic multilib. * config/bfin/elf.h (STARTFILE_SPEC): Don't link in crt0.o if -shared. (CRT_CALL_STATIC_FUNCTION): New. * config/bfin/uclinux.h (STARTFILE_SPEC): Don't link in crt0.o if -shared. (CRT_CALL_STATIC_FUNCTION): New. * config/bfin/bfin.c (legitimize_pic_address): Now static. Handle FD-PIC moves. (n_pregs_to_save): PIC register doesn't need to be saved with FD-PIC. (print_operand): Handle UNSPEC_MOVE_FDPIC and UNSPEC_FUNCDESC_GOT17M4. (initialize_trampoline): Changed to handle FD-PIC code generation. (expand_move): If TARGET_FDPIC, use emit_pic_move as needed. (bfin_expand_call): Generate FD-PIC calls if TARGET_FDPIC. (override_options): Disallow -mid-shared-library -mfdpic combination. Can't do unaligned ops if FD-PIC. Turn off flag_pic if trying to generate non-id-shared-library non-fdpic code, since it's not supported. (bfin_assemble_integer): New function. (TARGET_ASM_INTEGER): Define. * config/bfin/crti.s (__init, __fini): Save P3 on the stack if __BFIN_FDPIC__. * config/bfin/crtn.s: Restore them. * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Define __BFIN_FDPIC__ if TARGET_FDPIC. (DRIVER_SELF_SPECS, SUBTARGET_DRIVER_SELF_SPECS, LINK_GCC_C_SEQUENCE_SPEC, ASM_SPEC, LINK_SPEC): New macros. (FDPIC_FPTR_REGNO, FDPIC_REGNO, OUR_FDPIC_REG): New macros. (TRAMPOLINE_SIZE, TRAMPOLINE_TEMPLATE): Adjust for FD-PIC. (CONDITIONAL_REGISTER_USAGE): If TARGET_FDPIC, FDPIC_REGNO is call-used. (enum reg_class, REG_CLASS_CONTENTS, REG_CLASS_NAMES): Add FDPIC_REGS and FDPIC_FPTR_REGS. (REG_CLASS_FROM_LETTER): Use 'Z' and 'Y' for them. * config/bfin/bfin.md (UNSPEC_MOVE_FDPIC, UNSPEC_FUNCDESC_GOT17M4, UNSPEC_VOLATILE_LOAD_FUNCDESC): New constants. (load_funcdescsi): New pattern. (call_symbol_fdpic, sibcall_symbol_fdpic, call_value_symbol_fdpic, sibcall_value_symbol_fdpic, call_insn_fdpic, sibcall_insn_fdpic, call_value_insn_fdpic, sibcall_value_insn_fdpic): New patterns. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114199 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/bfin/elf.h')
-rw-r--r--gcc/config/bfin/elf.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/config/bfin/elf.h b/gcc/config/bfin/elf.h
index 621b786c94d..39d06881dfb 100644
--- a/gcc/config/bfin/elf.h
+++ b/gcc/config/bfin/elf.h
@@ -7,7 +7,7 @@
sprintf (LABEL, "*%s%s$%d", LOCAL_LABEL_PREFIX, PREFIX, (int) NUM)
#undef STARTFILE_SPEC
-#define STARTFILE_SPEC "crt0%O%s crti%O%s crtbegin%O%s crtlibid%O%s"
+#define STARTFILE_SPEC "%{!shared: crt0%O%s} crti%O%s crtbegin%O%s crtlibid%O%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
@@ -15,4 +15,11 @@
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
+#ifdef __BFIN_FDPIC__
+#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
+asm (SECTION_OP); \
+asm ("P3 = [SP + 20];\n\tcall " USER_LABEL_PREFIX #FUNC ";"); \
+asm (TEXT_SECTION_ASM_OP);
+#endif
+
#define NO_IMPLICIT_EXTERN_C