irix-crti.asm: .hide __gcc_init and __gcc_fini.

* 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.

From-SVN: r138297
This commit is contained in:
Olivier Hainque 2008-07-30 10:13:46 +00:00 committed by Olivier Hainque
parent 6715192c06
commit c67a93384d
3 changed files with 37 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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