2005-12-05 Geoffrey Keating <geoffk@apple.com>
+ * config/arm/arm.c (arm_cxx_determine_class_data_visibility): Preserve
+ previous behaviour.
+ * config/darwin.h (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Define to
+ hook_bool_void_false.
+ (TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Define.
+ * config/darwin.c (darwin_cxx_determine_class_data_visibility): New.
+
+ * config/darwin.c (machopic_select_section): It's not defined
+ as weak if it's only marked as weak_import.
+
+ * config/darwin-protos.h (darwin_cxx_determine_class_data_visibility):
+ Prototype.
+
* varasm.c (default_binds_local_p_1): Weakrefs don't bind locally.
A hidden weak object does bind locally. Strong linkonce data
counts like any other strong symbol for binding.
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
void (*base_function)(void);
- bool weak_p = DECL_P (exp) && DECL_WEAK (exp);
+ bool weak_p = (DECL_P (exp) && DECL_WEAK (exp)
+ && (lookup_attribute ("weak", DECL_ATTRIBUTES (exp))
+ || ! lookup_attribute ("weak_import",
+ DECL_ATTRIBUTES (exp))));
static void (* const base_funs[][2])(void) = {
{ text_section, text_coal_section },
{ unlikely_text_section, text_unlikely_coal_section },
2005-12-05 Geoffrey Keating <geoffk@apple.com>
+ * gcc.dg/darwin-weakimport-3.c: New.
+
* g++.old-deja/g++.abi/vtable2.C: Make weakrefs static.
* gcc.dg/attr-weakref-1.c: Modify to not try to test public weakrefs,
and to work on Darwin.
--- /dev/null
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-require-weak "" } */
+
+/* { dg-final { scan-assembler-not "coalesced" } } */
+
+extern void foo(void) __attribute__((weak_import));
+
+void foo(void)
+{
+}