]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Index: gcc/ChangeLog
authorGeoffrey Keating <geoffk@apple.com>
Mon, 5 Dec 2005 21:38:27 +0000 (21:38 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Mon, 5 Dec 2005 21:38:27 +0000 (21:38 +0000)
2005-12-05  Geoffrey Keating  <geoffk@apple.com>

* config/darwin.c (machopic_select_section): It's not defined
as weak if it's only marked as weak_import.

Index: gcc/testsuite/ChangeLog
2005-12-05  Geoffrey Keating  <geoffk@apple.com>

* gcc.dg/darwin-weakimport-3.c: New.

From-SVN: r108076

gcc/ChangeLog
gcc/config/darwin.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/darwin-weakimport-3.c [new file with mode: 0644]

index 29a37f44afb03321f5fa5f5a1196b1b3348d6bac..253b37e7490e6c393fd3fa28a3d84ea5bd93f834 100644 (file)
@@ -1,5 +1,18 @@
 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.
index 49c4114c2d2bc3273da5035bc3cab439601b1adf..54edae4896e1d7e0fa57e4f7ec3c7fad4ad577e8 100644 (file)
@@ -1027,7 +1027,10 @@ machopic_select_section (tree exp, int reloc,
                         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 },
index 1fbd36c89f92feb007aa72dd4fad3100fd8fa668..490996b3c4326e3431d84759e42065a60c091adc 100644 (file)
@@ -1,5 +1,7 @@
 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.
diff --git a/gcc/testsuite/gcc.dg/darwin-weakimport-3.c b/gcc/testsuite/gcc.dg/darwin-weakimport-3.c
new file mode 100644 (file)
index 0000000..de6458c
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-require-weak "" } */
+
+/* { dg-final { scan-assembler-not "coalesced" } } */
+
+extern void foo(void) __attribute__((weak_import));
+
+void foo(void)
+{
+}