diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 671b794cf25fe2d3d0d11cf6318b95254b7c854b..bb2350b63d08b16dc9d15c94c1471062e7aabb04 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-07-25 Olivier Hainque <hainque@adacore.com> + + * config/mips/irix-crti.asm: .hide __gcc_init and __gcc_fini. + * config/mips/iris6.h (IRIX_SUBTARGET_LINK_SPEC, irix ld): Hide + __dso_handle explicitly here. + 2008-07-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 34389 diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h index 750eaa199fa4228a9f11a5b69b366fbb9e5f038f..ffd918e8aaa1ed84e61e16483c7af08b82a6a48c 100644 --- a/gcc/config/mips/iris6.h +++ b/gcc/config/mips/iris6.h @@ -49,8 +49,32 @@ along with GCC; see the file COPYING3. If not see #define IRIX_SUBTARGET_LINK_SPEC \ "%{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}" #else + /* Explicitly hide crt symbols that would normally be marked with + a "hidden" visibility attribute. + + We have traditionally disabled this attribute when using the + native linker because the native linker's visibility support is + not fully-compatible with the GNU linker's. In particular, the + native linker does not pull in archive objects purely to resolve + references to the object's hidden symbols, whereas the GNU + linker does. + + The gcc build system currently hides symbols in some static + libraries (typically libgcov.a or libgcc.a) whenever visibility + attributes are supported. On targets with GNU semantics, this + makes sure that uses of libx.so symbols in one dynamic object are + not resolved to libx.a symbols in another dynamic object. But + on targets with IRIX semantics, hiding the symbols prevents the + static archive from working at all. + + It would probably be better to enable visiblity attributes for + IRIX ld and disable the static archives versioning. It shouldn't + make anything worse, since libx.a symbols are global by default + anyway. However, no-one has volunteered to do this yet. */ + #define IRIX_SUBTARGET_LINK_SPEC \ "%{w} -_SYSTYPE_SVR4 -woff 131 \ + %{shared:-hidden_symbol __dso_handle} \ %{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}" #endif diff --git a/gcc/config/mips/irix-crti.asm b/gcc/config/mips/irix-crti.asm index d6888bbf014343e57729ee579bd4c0e169ff718f..992f8b695dce4ead75033f4b13c859522a758378 100644 --- a/gcc/config/mips/irix-crti.asm +++ b/gcc/config/mips/irix-crti.asm @@ -49,3 +49,10 @@ __gcc_fini: sd $31,0($sp) sd $28,8($sp) #endif + +/* This object will typically be included in the final link for both + shared libraries and executable, and we need to hide the symbols to + prevent possible symbol preemption warnings from the SGI linker. */ +.hidden __gcc_init +.hidden __gcc_fini +