diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-02-08 20:55:02 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-02-08 20:55:02 +0000 |
commit | a0e152078435fc22edd0b112103e57742bf97c4f (patch) | |
tree | 1cd187fbdb5eb26cf7724804c273ac0478ce04d1 /gcc | |
parent | 76eddcf660ac7d52811f28a7e0a5262142c0a2b9 (diff) | |
download | gcc-a0e152078435fc22edd0b112103e57742bf97c4f.zip gcc-a0e152078435fc22edd0b112103e57742bf97c4f.tar.gz gcc-a0e152078435fc22edd0b112103e57742bf97c4f.tar.bz2 |
re PR go/47378 (ld warning linking with libgo.so: relocation bound to a symbol with STV_PROTECTED visibility)
PR go/47378
Don't use protected visibility for type descriptors.
From-SVN: r169946
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/gogo-tree.cc | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/gcc/go/gofrontend/gogo-tree.cc b/gcc/go/gofrontend/gogo-tree.cc index ccd17c6..ec5f65a 100644 --- a/gcc/go/gofrontend/gogo-tree.cc +++ b/gcc/go/gofrontend/gogo-tree.cc @@ -2633,26 +2633,14 @@ Gogo::build_type_descriptor_decl(const Type* type, Expression* initializer, DECL_INITIAL(decl) = constructor; - if (type_descriptor_location == TYPE_DESCRIPTOR_COMMON) + if (type_descriptor_location == TYPE_DESCRIPTOR_DEFINED) + TREE_PUBLIC(decl) = 1; + else { + gcc_assert(type_descriptor_location == TYPE_DESCRIPTOR_COMMON); make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl)); resolve_unique_section(decl, 1, 0); } - else - { -#ifdef OBJECT_FORMAT_ELF - // Give the decl protected visibility. This avoids out-of-range - // references with shared libraries with the x86_64 small model - // when the type descriptor gets a COPY reloc into the main - // executable. There is no need to have unique pointers to type - // descriptors, as the runtime code compares reflection strings - // if necessary. - DECL_VISIBILITY(decl) = VISIBILITY_PROTECTED; - DECL_VISIBILITY_SPECIFIED(decl) = 1; -#endif - - TREE_PUBLIC(decl) = 1; - } rest_of_decl_compilation(decl, 1, 0); } @@ -2764,17 +2752,7 @@ Gogo::interface_method_table_for_type(const Interface_type* interface, // definition of the table. Otherwise it is a comdat table which // may be defined in multiple packages. if (has_hidden_methods) - { -#ifdef OBJECT_FORMAT_ELF - // Give the decl protected visibility. This avoids out-of-range - // references with shared libraries with the x86_64 small model - // when the table gets a COPY reloc into the main executable. - DECL_VISIBILITY(decl) = VISIBILITY_PROTECTED; - DECL_VISIBILITY_SPECIFIED(decl) = 1; -#endif - - TREE_PUBLIC(decl) = 1; - } + TREE_PUBLIC(decl) = 1; else { make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl)); |