diff options
author | iains <iains@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-02 14:40:03 +0000 |
---|---|---|
committer | iains <iains@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-02 14:40:03 +0000 |
commit | 90ff10b3d8a329ba3b765c9e64c885316eb7041f (patch) | |
tree | b5b577010dc10df43ec2cfd162565ca05edc0eb5 /gcc/config/i386/darwin.h | |
parent | c9de603982077546ddeec49cb729f58719c1e25d (diff) | |
download | gcc-90ff10b3d8a329ba3b765c9e64c885316eb7041f.tar.gz |
update darwin x86 output.
gcc:
Merge from FSF "apple/trunk" branch.
* config/rs6000/darwin.opt (mdynamic-no-pic): move from here ...
* config/darwin.opt: .. to here.
(matt-stubs): New option.
* config/i386/darwin.opt: Delete.
* config/i386/i386.h (MACHOPIC_ATT_STUB): New.
(MACHO_DYNAMIC_NO_PIC_P): New.
(MACHOPIC_INDIRECT): New.
(MACHOPIC_PURE): New.
* config/i386/darwin.h (DARWIN_X86) Define to 1.
(MACHOPIC_ATT_STUB): New.
(CC1_SPEC): Do not remove mdynamic-no-pic.
Move HOT_TEXT_SECTION_NAME: move to config/darwin.h
UNLIKELY_EXECUTED_TEXT_SECTION_NAME: Likewise.
(FUNCTION_PROFILER): Correct over-length line.
(SUBTARGET_OVERRIDE_OPTIONS): New.
(MACHOPIC_NL_SYMBOL_PTR_SECTION): New.
* config/i386/i386.c (config/i386/i386.c): Darwin has no PLT.
(legitimate_constant_p): Handle mdynamic-no-pic.
(ix86_legitimate_address_p): Likewise.
(ix86_legitimize_address): Likewise.
(ix86_expand_move): Likewise.
(machopic_output_stub): Update for ATT-style stubs and
mdynamic-no-pic.
* config/darwin-protos.h (machopic_symbol_defined_p): New.
* config/rs6000/darwin.h (DARWIN_PPC): Define to 1.
TARGET_DYNAMIC_NO_PIC: Remove.
Move HOT_TEXT_SECTION_NAME: move to config/darwin.h
UNLIKELY_EXECUTED_TEXT_SECTION_NAME: Likewise.
* config/rs6000/rs6000.c (darwin_rs6000_override_options):
Remove handling of mdynamic-no-pic.
* config/darwin.c (HAVE_lo_sum, gen_macho_high, gen_macho_low):
Define if required.
(machopic_symbol_defined_p): Do not try to use current_function_decl
when generating _get_pc thunks within stubs.
(machopic_indirect_data_reference): Rework for direct conditionals
rather than #ifdefs, add x86 mdynamic-no-pic
(machopic_legitimize_pic_address): Update to use HAVE_lo_sum with a
defined value.
(darwin_override_options): Handle mdynamic-no-pic here.
* config/darwin-sections.def (machopic_lazy_symbol_ptr2_section): New.
(machopic_lazy_symbol_ptr3_section): New.
(machopic_picsymbol_stub2_section): New.
(machopic_picsymbol_stub3_section): New.
* config/darwin.h (DARWIN_X86, DARWIN_PPC): Define to 0.
(MACHOPIC_NL_SYMBOL_PTR_SECTION): New.
(HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME):
Moved common definition from x86 and rs6000.
(MACHO_DYNAMIC_NO_PIC_P): Override value.
(MACHOPIC_INDIRECT): Likewise.
(MACHOPIC_PURE): Likewise.
* config.gcc (x86-darwin-*): Remove darwin.opt.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166184 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/darwin.h')
-rw-r--r-- | gcc/config/i386/darwin.h | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h index 6f0b23ec815..7c4ed633b18 100644 --- a/gcc/config/i386/darwin.h +++ b/gcc/config/i386/darwin.h @@ -23,6 +23,9 @@ along with GCC; see the file COPYING3. If not see #undef TARGET_MACHO #define TARGET_MACHO 1 +#undef DARWIN_X86 +#define DARWIN_X86 1 + #define TARGET_VERSION fprintf (stderr, " (i686 Darwin)"); #undef TARGET_64BIT @@ -66,6 +69,11 @@ extern int darwin_emit_branch_islands; #undef TARGET_MACHO_BRANCH_ISLANDS #define TARGET_MACHO_BRANCH_ISLANDS darwin_emit_branch_islands +/* For compatibility with OSX system tools, use the new style of pic stub + if this is set. */ +#undef MACHOPIC_ATT_STUB +#define MACHOPIC_ATT_STUB (darwin_macho_att_stub) + #undef MAX_BITS_PER_WORD #define MAX_BITS_PER_WORD 64 @@ -100,7 +108,6 @@ extern int darwin_emit_branch_islands; #undef CC1_SPEC #define CC1_SPEC "%(cc1_cpu) \ - %<mdynamic-no-pic " /* For now, we just ignore this flag */ " \ %{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}} \ %{!mmacosx-version-min=*:-mmacosx-version-min=%(darwin_minversion)} \ %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }}" @@ -182,11 +189,6 @@ extern int darwin_emit_branch_islands; #undef TARGET_SUBTARGET64_ISA_DEFAULT #define TARGET_SUBTARGET64_ISA_DEFAULT TARGET_SUBTARGET32_ISA_DEFAULT -/* For now, disable dynamic-no-pic. We'll need to go through i386.c - with a fine-tooth comb looking for refs to flag_pic! */ -#define MASK_MACHO_DYNAMIC_NO_PIC 0 -#define TARGET_DYNAMIC_NO_PIC (target_flags & MASK_MACHO_DYNAMIC_NO_PIC) - #undef GOT_SYMBOL_NAME #define GOT_SYMBOL_NAME MACHOPIC_FUNCTION_BASE_NAME @@ -194,11 +196,6 @@ extern int darwin_emit_branch_islands; #define LPREFIX "L" -/* These are used by -fbranch-probabilities */ -#define HOT_TEXT_SECTION_NAME "__TEXT,__text,regular,pure_instructions" -#define UNLIKELY_EXECUTED_TEXT_SECTION_NAME \ - "__TEXT,__unlikely,regular,pure_instructions" - /* Assembler pseudos to introduce constants of various size. */ #define ASM_BYTE "\t.byte\t" @@ -239,7 +236,8 @@ extern int darwin_emit_branch_islands; #undef FUNCTION_PROFILER #define FUNCTION_PROFILER(FILE, LABELNO) \ do { \ - if (TARGET_MACHO_BRANCH_ISLANDS && MACHOPIC_INDIRECT && !TARGET_64BIT) \ + if (TARGET_MACHO_BRANCH_ISLANDS \ + && MACHOPIC_INDIRECT && !TARGET_64BIT) \ { \ const char *name = machopic_mcount_stub_name (); \ fprintf (FILE, "\tcall %s\n", name+1); /* skip '&' */ \ @@ -253,6 +251,13 @@ extern int darwin_emit_branch_islands; SUBTARGET_C_COMMON_OVERRIDE_OPTIONS; \ } while (0) +#undef SUBTARGET_OVERRIDE_OPTIONS +#define SUBTARGET_OVERRIDE_OPTIONS \ +do { \ + if (TARGET_64BIT && MACHO_DYNAMIC_NO_PIC_P) \ + target_flags &= ~MASK_MACHO_DYNAMIC_NO_PIC; \ +} while (0) + /* Darwin on x86_64 uses dwarf-2 by default. Pre-darwin9 32-bit compiles default to stabs+. darwin9+ defaults to dwarf-2. */ #ifndef DARWIN_PREFER_DWARF @@ -313,6 +318,10 @@ extern int darwin_emit_branch_islands; #undef MACHO_SYMBOL_FLAG_VARIABLE #define MACHO_SYMBOL_FLAG_VARIABLE ((SYMBOL_FLAG_MACH_DEP) << 3) +#undef MACHOPIC_NL_SYMBOL_PTR_SECTION +#define MACHOPIC_NL_SYMBOL_PTR_SECTION \ + ".section __IMPORT,__pointers,non_lazy_symbol_pointers" + #define SUBTARGET32_DEFAULT_CPU "i686" #undef SUBTARGET_INIT_BUILTINS |