summaryrefslogtreecommitdiff
path: root/gcc/config/darwin.c
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-27 23:02:39 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-27 23:02:39 +0000
commit975d636c1fc5cb9329165f36746f24aab5bf0c38 (patch)
treecfb4cd621b8390f148fe008b597f52830668a28b /gcc/config/darwin.c
parentc160ce689a3be11376ee979a6a1f8cfbe2842af4 (diff)
downloadgcc-975d636c1fc5cb9329165f36746f24aab5bf0c38.tar.gz
Index: fixincludes/ChangeLog
2004-10-27 Geoffrey Keating <geoffk@apple.com> * inclhack.def (darwin_gcc4_breakage): New. * fixincl.x: Regenerate. Index: gcc/ChangeLog 2004-10-27 Geoffrey Keating <geoffk@apple.com> * config/rs6000/rs6000.c (rs6000_attribute_table): Add SUBTARGET_ATTRIBUTE_TABLE. * config/darwin.h (ASM_WEAKEN_DECL): Handle weak_import. (SUBTARGET_ATTRIBUTE_TABLE): Define. * config/darwin.c (darwin_handle_weak_import_attribute): New. (HAVE_DEAD_STRIP): Delete. (no_dead_strip): Don't test HAVE_DEAD_STRIP. * config/darwin-protos.h (darwin_handle_weak_import_attribute): Prototype. Index: gcc/testsuite/ChangeLog 2004-10-27 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-weakimport-1.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89716 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/darwin.c')
-rw-r--r--gcc/config/darwin.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 0c39fd80c65..73581f7346a 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1209,13 +1209,30 @@ darwin_unique_section (tree decl ATTRIBUTE_UNUSED, int reloc ATTRIBUTE_UNUSED)
/* Darwin does not use unique sections. */
}
-#define HAVE_DEAD_STRIP 0
+/* Handle a "weak_import" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+tree
+darwin_handle_weak_import_attribute (tree *node, tree name,
+ tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags),
+ bool * no_add_attrs)
+{
+ if (TREE_CODE (*node) != FUNCTION_DECL)
+ {
+ warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+ else
+ declare_weak (*node);
+
+ return NULL_TREE;
+}
static void
no_dead_strip (FILE *file, const char *lab)
{
- if (HAVE_DEAD_STRIP)
- fprintf (file, ".no_dead_strip %s\n", lab);
+ fprintf (file, ".no_dead_strip %s\n", lab);
}
/* Emit a label for an FDE, making it global and/or weak if appropriate.