aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/darwin-sections.def
diff options
context:
space:
mode:
authorIain Sandoe <iain@codesourcery.com>2016-11-27 14:34:54 +0000
committerIain Sandoe <iains@gcc.gnu.org>2016-11-27 14:34:54 +0000
commit794fa8a6ab0a9fa4541e9528d7c6595299385e5f (patch)
treea16565000a66d13d5da62d9140f1f324951ecbb7 /gcc/config/darwin-sections.def
parenteb89c82f46a10585c98e2019d775d920cf2fdea0 (diff)
downloadgcc-794fa8a6ab0a9fa4541e9528d7c6595299385e5f.zip
gcc-794fa8a6ab0a9fa4541e9528d7c6595299385e5f.tar.gz
gcc-794fa8a6ab0a9fa4541e9528d7c6595299385e5f.tar.bz2
[Darwin] Fix PR71767 - adjust the sections used where necessary.
(much) Older Darwin linkers needed separate sections marked "coalesce" to allow for weak symbol coalescing. This has not been needed for some time and is now deprecated, newer assemblers warn if the old coalesced sections are used. gcc/ 2016-11-27 Iain Sandoe <iain@codesourcery.com> PR target/71767 * config/darwin-sections.def (picbase_thunk_section): New. * config/darwin.c (darwin_init_sections): Set up picbase thunk section. (darwin_rodata_section, darwin_objc2_section, machopic_select_section, darwin_asm_declare_constant_name, darwin_emit_weak_or_comdat, darwin_function_section): Don’t use coalesced with newer linkers. (darwin_override_options): Decide on usage of coalesed sections on the basis of the target linker version. * config/darwin.h (MIN_LD64_NO_COAL_SECTS): New. * config/darwin.opt (mtarget-linker): New. * config/i386/i386.c (ix86_code_end): Do not force the thunks into a coalesced section, instead use a thunks section. From-SVN: r242895
Diffstat (limited to 'gcc/config/darwin-sections.def')
-rw-r--r--gcc/config/darwin-sections.def5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/config/darwin-sections.def b/gcc/config/darwin-sections.def
index cbf3e41..8a7e985 100644
--- a/gcc/config/darwin-sections.def
+++ b/gcc/config/darwin-sections.def
@@ -31,6 +31,11 @@ along with GCC; see the file COPYING3. If not see
DEF_SECTION (text_coal_section, SECTION_CODE|SECTION_NO_ANCHOR,
".section __TEXT,__textcoal_nt,coalesced,pure_instructions", 0)
+/* We define a picbase thunks section separately, so that we can override the
+ def to be '.text' for versions of ld64 that handle coalescing. */
+DEF_SECTION (picbase_thunk_section, SECTION_CODE|SECTION_NO_ANCHOR,
+ ".section __TEXT,__textcoal_nt,coalesced,pure_instructions", 0)
+
DEF_SECTION (text_hot_section, SECTION_CODE,
".section __TEXT,__text_hot,regular,pure_instructions", 0)
DEF_SECTION (text_cold_section, SECTION_CODE,