diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-02-26 22:17:22 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2002-02-26 22:17:22 +0100 |
commit | 47bd70b56aa4ccc10fd0e90a7fae4c94d991bb30 (patch) | |
tree | bf177b7375ac3fceb1bd51f1f20b2ff845e3fbba /gcc/config | |
parent | 6d73371a68e805956981592bdc2a631acaab2a33 (diff) | |
download | gcc-47bd70b56aa4ccc10fd0e90a7fae4c94d991bb30.zip gcc-47bd70b56aa4ccc10fd0e90a7fae4c94d991bb30.tar.gz gcc-47bd70b56aa4ccc10fd0e90a7fae4c94d991bb30.tar.bz2 |
attribs.c (c_common_attribute_table): Add visibility.
* attribs.c (c_common_attribute_table): Add visibility.
(handle_visibility_attribute): New function.
* varasm.c (assemble_visibility): New function.
* output.h (assemble_visibility): Add prototype.
* tree.h (MODULE_LOCAL_P): Define.
* crtstuff.c (__dso_handle): Use visibility attribute.
* config/i386/i386.h (ENCODE_SECTION_INFO): Set SYMBOL_REF_FLAG
for MODULE_LOCAL_P symbols too.
* config/ia64/ia64.c (ia64_encode_section_info): Handle
MODULE_LOCAL_P symbols the same way as local symbols.
Add SDATA_NAME_FLAG_CHAR even if decl was explicitely forced
into .sdata/.sbss by the user.
* doc/extend.texi (Function Attributes): Document visibility
attribute.
* gcc.dg/ia64-visibility-1.c: New test.
From-SVN: r50061
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.h | 4 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.c | 24 |
2 files changed, 17 insertions, 11 deletions
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index ceacd6c..342105d 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2266,7 +2266,9 @@ do { \ \ SYMBOL_REF_FLAG (XEXP (rtl, 0)) \ = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ - || ! TREE_PUBLIC (DECL)); \ + || ! TREE_PUBLIC (DECL) \ + || (TREE_CODE (DECL) == VAR_DECL \ + && MODULE_LOCAL_P (DECL))); \ } \ } \ } while (0) diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 7ca060b..2bdc16c 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -6897,13 +6897,14 @@ ia64_encode_section_info (decl) statically allocated, but the space is allocated somewhere else. Such decls can not be own data. */ if (! TARGET_NO_SDATA - && TREE_STATIC (decl) && ! DECL_EXTERNAL (decl) - && ! (DECL_ONE_ONLY (decl) || DECL_WEAK (decl)) - && ! (TREE_PUBLIC (decl) - && (flag_pic - || (DECL_COMMON (decl) - && (DECL_INITIAL (decl) == 0 - || DECL_INITIAL (decl) == error_mark_node)))) + && ((TREE_STATIC (decl) && ! DECL_EXTERNAL (decl) + && ! (DECL_ONE_ONLY (decl) || DECL_WEAK (decl)) + && ! (TREE_PUBLIC (decl) + && (flag_pic + || (DECL_COMMON (decl) + && (DECL_INITIAL (decl) == 0 + || DECL_INITIAL (decl) == error_mark_node))))) + || MODULE_LOCAL_P (decl)) /* Either the variable must be declared without a section attribute, or the section must be sdata or sbss. */ && (DECL_SECTION_NAME (decl) == 0 @@ -6923,9 +6924,12 @@ ia64_encode_section_info (decl) ; /* If this is an incomplete type with size 0, then we can't put it in - sdata because it might be too big when completed. */ - else if (size > 0 - && size <= (HOST_WIDE_INT) ia64_section_threshold + sdata because it might be too big when completed. + Objects bigger than threshold should have SDATA_NAME_FLAG_CHAR + added if they are in .sdata or .sbss explicitely. */ + else if (((size > 0 + && size <= (HOST_WIDE_INT) ia64_section_threshold) + || DECL_SECTION_NAME (decl)) && symbol_str[0] != SDATA_NAME_FLAG_CHAR) { size_t len = strlen (symbol_str); |