diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-26 03:38:37 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-26 03:38:37 +0000 |
commit | 9cca51ff2077391de6e64a174b543bad77447433 (patch) | |
tree | c8dc7fde9389dae3158d0518dd428fab00360346 /gcc/c-pragma.c | |
parent | 13c2f1da0b15269c6a858f34565af100f87e76ca (diff) | |
download | gcc-9cca51ff2077391de6e64a174b543bad77447433.tar.gz |
* c-pragma.c (apply_pragma_weak): Convert value identifier to
string for decl_attributes.
(handle_pragma_weak): Call assemble_alias if we're modifying
an existing decl.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53884 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pragma.c')
-rw-r--r-- | gcc/c-pragma.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c index 8801c697a8c..1a016b8b220 100644 --- a/gcc/c-pragma.c +++ b/gcc/c-pragma.c @@ -283,9 +283,14 @@ apply_pragma_weak (decl, value) tree decl, value; { if (value) - decl_attributes (&decl, build_tree_list (get_identifier ("alias"), - build_tree_list (NULL, value)), - 0); + { + value = build_string (IDENTIFIER_LENGTH (value), + IDENTIFIER_POINTER (value)); + decl_attributes (&decl, build_tree_list (get_identifier ("alias"), + build_tree_list (NULL, value)), + 0); + } + if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl) && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) warning_with_decl (decl, "applying #pragma weak `%s' after first use results in unspecified behavior"); @@ -342,7 +347,11 @@ handle_pragma_weak (dummy) decl = identifier_global_value (name); if (decl && TREE_CODE_CLASS (TREE_CODE (decl)) == 'd') - apply_pragma_weak (decl, value); + { + apply_pragma_weak (decl, value); + if (value) + assemble_alias (decl, value); + } else pending_weaks = tree_cons (name, value, pending_weaks); } |