diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-26 01:29:21 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-26 01:29:21 +0000 |
commit | de2d1fb7d5aa219145df8699eb3c9d1902352afc (patch) | |
tree | 855d4e599adc29e51930b659de26cb3bd6af975b /gcc/varasm.c | |
parent | e6bdf9d70dcaf369c3618f79fcfcd85788d04fbe (diff) | |
download | ppe42-gcc-de2d1fb7d5aa219145df8699eb3c9d1902352afc.tar.gz ppe42-gcc-de2d1fb7d5aa219145df8699eb3c9d1902352afc.zip |
* c-pragma.c (add_weak); Delete. Moved into...
* varasm.c (add_weak): New external function.
(declare_weak): If HANDLE_PRAGMA_WEAK, then add the function to
the list of weak functions.
* c-pragma (add_weak): Declare.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25454 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index a247cd775af..a6ee794a3e4 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -4269,6 +4269,31 @@ output_constructor (exp, size) assemble_zeros (size - total_bytes); } +#ifdef HANDLE_PRAGMA_WEAK +/* Add function NAME to the weak symbols list. VALUE is a weak alias + associatd with NAME. */ + +int +add_weak (name, value) + char *name; + char *value; +{ + struct weak_syms *weak; + + weak = (struct weak_syms *) permalloc (sizeof (struct weak_syms)); + + if (weak == NULL) + return 0; + + weak->next = weak_decls; + weak->name = name; + weak->value = value; + weak_decls = weak; + + return 1; +} +#endif /* HANDLE_PRAGMA_WEAK */ + /* Declare DECL to be a weak symbol. */ void @@ -4281,6 +4306,9 @@ declare_weak (decl) error_with_decl (decl, "weak declaration of `%s' must precede definition"); else if (SUPPORTS_WEAK) DECL_WEAK (decl) = 1; +#ifdef HANDLE_PRAGMA_WEAK + add_weak (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), NULL); +#endif } /* Emit any pending weak declarations. */ |