PR target/26427
PR target/33120
PR testsuite/35710
gcc:
* config/i386/darwin.h (ASM_OUTPUT_COMMON): Remove
(ASM_OUTPUT_LOCAL): Likewise.
* config/darwin-protos.h (darwin_asm_declare_object_name): New.
(darwin_output_aligned_bss): Likewise.
(darwin_asm_output_aligned_decl_local): Likewise.
(darwin_asm_output_aligned_decl_common): Likewise.
(darwin_use_anchors_for_symbol_p): Likewise.
* config/rs6000/darwin.h (ASM_OUTPUT_COMMON): Remove.
(TARGET_ASM_OUTPUT_ANCHOR): Define.
(TARGET_USE_ANCHORS_FOR_SYMBOL_P): Define.
(DARWIN_SECTION_ANCHORS): Set to 1.
* config/darwin.c (emit_aligned_common): New var.
(darwin_init_sections): Check that the Darwin private zero-size section
marker is in range.
(darwin_text_section): Check for zero-sized objects.
(darwin_mergeable_string_section): Likewise.
(darwin_mergeable_constant_section): Likewise.
(machopic_select_section): Adjust to check for zero-sized objects.
Assert that OBJC meta data are non-zero sized.
(darwin_asm_declare_object_name): New.
(darwin_asm_declare_constant_name): Adjust for zero-sized
object sections.
(BYTES_ZFILL): Define.
(darwin_emit_weak_or_comdat): New.
(darwin_emit_local_bss): New.
(darwin_emit_common): New.
(darwin_output_aligned_bss): New.
(darwin_asm_output_aligned_decl_common): New.
(darwin_asm_output_aligned_decl_local): New.
(darwin_file_end): Disable subsections_via_symbols when section
anchoring is active.
(darwin_asm_output_anchor): Re-enable.
(darwin_use_anchors_for_symbol_p): New.
(darwin_override_options): Check for versions that can emit
aligned common. Update usage of flags to current.
* config/darwin-sections.def: Update comments and flags for
non-anchor sections. zobj_const_section, zobj_data_section,
zobj_bss_section, zobj_const_data_section: New.
* config/darwin.h (ASM_DECLARE_OBJECT_NAME): Redefine.
(ASM_OUTPUT_ALIGN): Make whitespace output consistent.
(L2_MAX_OFILE_ALIGNMENT): Define.
(ASM_OUTPUT_ALIGNED_BSS): Define.
(ASM_OUTPUT_ALIGNED_DECL_LOCAL): Define.
(ASM_OUTPUT_ALIGNED_DECL_COMMON): Define.
(SECTION_NO_ANCHOR): Define.
(TARGET_ASM_OUTPUT_ANCHOR) Define with a default of NULL.
(DARWIN_SECTION_ANCHORS): Define with a default of 0.
boehm-gc:
* dyn_load.c (GC_register_dynamic_libraries/DARWIN): Add new writable
data section names.
(GC_dyld_name_for_hdr): Adjust layout.
(GC_dyld_image_add): Adjust layout, add new Darwin sections, adjust
debug to name the sections.
(GC_dyld_image_remove): Adjust layout, remove new Darwin sections,
adjust debug to name the sections.
(GC_register_dynamic_libraries): Adjust layout.
(GC_init_dyld): Likewise.
(GC_register_main_static_data): Likewise.
gcc/testsuite:
* gcc.target/powerpc/darwin-abi-12.c: Adjust for new allocators.
* gcc.dg/pr26427.c: Remove redundant warning for powerpc.
* gcc.dg/darwin-comm.c: Adjust for new allocators.
* gcc.dg/darwin-sections.c: New test.
* g++.dg/ext/instantiate2.C: Adjust for new allocators.
Co-Authored-By: Mike Stump <mrs@gcc.gnu.org>
From-SVN: r167242
PR target/42811 (prerequisite)
* include/private/gc_priv.h (struct roots) [CYGWIN32]: Don't
declare r_next member on Cygwin as on other windows hosts.
(LOG_RT_SIZE) [CYGWIN32]: Don't define likewise.
(RT_SIZE) [CYGWIN32]: Likewise.
(struct _GC_arrays) [CYGWIN32]: Do declare _heap_bases[] member
likewise.
(GC_heap_bases) [CYGWIN32]: Do define likewise.
(struct _SYSTEM_INFO) [CYGWIN32]: Do forward-declare likewise.
(GC_sysinfo) [CYGWIN32]: Do declare extern likewise.
(GC_n_heap_bases) [CYGWIN32]: Likewise.
(GC_is_tmp_root) [CYGWIN32]: Do prototype likewise.
* include/private/gcconfig.h (GC_win32_get_mem) [CYGWIN32]: Likewise.
(GET_MEM) [CYGWIN32]: Do define likewise.
* boehm-gc/ptr_chck.c (GC_is_visible) [CYGWIN32]: Do handle dynamic
registration likewise.
* boehm-gc/os_dep.c (GC_setpagesize) [CYGWIN32]: Do define likewise.
(GC_no_win32_dlls) [CYGWIN32]: Define as constant false, unlike
other windows hosts.
(GC_sysinfo) [CYGWIN32]: Define as on other windows hosts.
(GC_n_heap_bases) [CYGWIN32]: Likewise.
(GLOBAL_ALLOC_TEST) [CYGWIN32]: Likewise.
(GC_win32_get_mem) [CYGWIN32]: Likewise, but wrapping GC_unix_get_mem
rather than GlobalAlloc/VirtualAlloc.
(GC_win32_free_heap) [CYGWIN32]: Likewise, but wrapping free instead
of GlobalFree (even though the function body is optimised away).
* boehm-gc/mark_rts.c (add_roots_to_index) [CYGWIN32]: Define as on
other windows hosts.
(GC_add_roots_inner) [CYGWIN32]: Avoid overlapping or adjacent
intervals likewise.
(GC_clear_roots) [CYGWIN32]: Clear GC_root_index[] likewise.
(GC_rebuild_root_index) [CYGWIN32]: Define as on other windows hosts.
(GC_remove_tmp_roots) [CYGWIN32]: Call it likewise.
(GC_remove_roots) [CYGWIN32]: Don't define, as on other windows hosts.
(GC_is_tmp_root) [CYGWIN32]: Define, as on other windows hosts.
(GC_cond_register_dynamic_libraries) [CYGWIN32]: Handle temporary
roots and dynamic registration likewise.
* boehm-gc/dyn_load.c (GC_has_static_roots) [CYGWIN32]: Define as on
other windows hosts.
(GC_register_has_static_roots_callback) [CYGWIN32]: Likewise.
(GC_cond_add_roots) [CYGWIN32]: Likewise.
(GC_register_main_static_data) [CYGWIN32]: Define to always return
false, as on MSWINCE
(HAVE_REGISTER_MAIN_STATIC_DATA) [CYGWIN32]: Define as on other
windows hosts.
(GC_warn_fb) [CYGWIN32]: Likewise.
(GC_disallow_ignore_fb) [CYGWIN32]: Likewise.
(GC_ignore_fb_mb) [CYGWIN32]: Likewise.
(GC_ignore_fb) [CYGWIN32]: Likewise.
(is_frame_buffer) [CYGWIN32]: Likewise.
(GC_dump_meminfo) [CYGWIN32]: Likewise.
(GC_wnt) [CYGWIN32]: Define to constant true.
(GC_register_dynamic_libraries) [CYGWIN32]: Define as on other
windows hosts.
From-SVN: r157604
2007-02-19 Andreas Tobler <a.tobler@schweiz.org>
* dyn_load.c (GC_dyld_image_add): Remove ifdef clause and use the macro
GC_GETSECTBYNAME instead.
* include/private/gc_priv.h: Define GC_GETSECTBYNAME according to the
architecture (Darwin).
From-SVN: r132452
2007-01-11 Andreas Tobler <a.tobler@schweiz.org>
* configure.ac: Replaced HAS_I386_THREAD_STATE_* with
HAS_X86_THREAD_STATE32_* and HAS_X86_THREAD_STATE64_* respectively.
* configure: Regenerated.
* include/private/gcconfig.h (DARWIN): Added X86_64 define for Darwin.
Added base definitions for the X86_64 Darwin port.
* include/private/gc_priv.h: Added definitions for Darwin MACH thread
operations. Moved existing THREAD_STATE info from darwin_stop_world.c.
* darwin_stop_world.c: Removed THREAD_STATE info. Added
HAS_X86_THREAD_STATE64___RAX. And replaced HAS_I386_THREAD_STATE___EAX
with HAS_X86_THREAD_STATE32___EAX.
(GC_push_all_stacks): Use GC_MACH_THREAD_STATE_COUNT. Add code for
X86_64 Darwin.
* dyn_load.c (GC_dyld_name_for_hdr): Use GC_MACH_HEADER.
(GC_dyld_image_add): Use GC_MACH_HEADER and GC_MACH_SECTION.
Distinguish between getsectbynamefromheader_64 and
getsectbynamefromheader.
(GC_dyld_image_remove): Likewise.
* os_dep.c (GC_dirty_init): Use GC_MACH_THREAD_STATE.
(catch_exception_raise): Introduce exception information for I386 and
X86_64 Darwin. Add X86_64 for exc_state.faultvaddr.
From-SVN: r120684
* os_dep.c (GC_wnt): Define.
(GC_init_win32): Set GC_wnt.
* dyn_load.c (GC_register_dynamic_libraries): Consider MEM_PRIVATE
sections also on Windows 9x/ME.
From-SVN: r114818
* allchblk.c (GC_allochblk_nth): Dont overlook available space if
GC disabled, correctly convert GC_finalizer_mem_freed to byte,
total_size to words.
* dyn_load.c (win32 GC_register_dynamic_libraries): Consider only
MEM_IMAGE regions.
* mach_dep.c (GC_with_callee_saves_pushed): separate into new function,
and indent appropriately.
* mark_rts.c (GC_approx_sp): Access stack.
* pthread_stop_world.c: (GC_suspend_handler): Explicitly push
callee-saves registers when appropriate.
(GC_stop_world): Handle EINTR from sem_wait (sync with Mono GC).
From-SVN: r94776
2003-03-04 Hans Boehm <Hans.Boehm@hp.com>
* include/private/gcconfig.h (GC_data_start): declare when needed.
* include/private/gc_priv.h: Include gcconfig.h after ptr_t
declaration.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr,
GC_register_dynlib_callback): Register main data for static
executable if dl_iterate_phdr() didn't.
* misc.c (GC_init_inner): Call GC_init_linux_data_start() even
if we don't expect to register main static data.
From-SVN: r63809
2002-03-12 Adam Megacz <adam@xwt.org>
* dyn_load.c: Renamed GC_win32s to GC_no_win32_dlls.
* misc.c: Renamed GC_is_win32s() to GC_no_win32_dlls
* os_dep.c: Renamed GC_win32s to GC_no_win32_dlls and
statically initialized it to TRUE if compiling with GCC.
* win32_threads.c (thread_start): We no longer use SEH if
compiling with GCC.
* mark.c (GC_mark_some): We no longer use SEH if
compiling with GCC.
From-SVN: r50671
* dyn_load.c: Define ElfW (if needed) for all targets,
not just GNU/Linux.
(GC_FirstDLOpenedLinkMap): Use it.
(GC_register_dynamic_libraries_dl): Use it.
* include/private/gcconfig.h: Define CPP_WORDSZ, ELF_CLASS
for sparcv9.
From-SVN: r48086