This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug driver/15288] New: can't use MIPS linker option -exports_file


The MIPS linker has an option -exports_file <filename> which controls the set of
symbols exported from a shared library.  However, if this argument is given,
then the default action is to hide symbols unless so specified, and -- here's
the annoying part -- it rejects the -hidden_symbol argument as "conflicting". 
And guess what?  When given "-shared" and using the native linker, gcc
unconditionally passes "-hidden_symbol
__do_global_ctors,__do_global_ctors_1,__do_global_dtors", and the link fails.

The basic workaround is easy: Don't use an exports list; that can lead to
namespace pollution, symbol name conflicts, etc.  Or, hack the specs file to
punt the hidden_symbol option; that's just ugly.

Near as I can tell, "-Wl,-foo" and "-Xlinker -foo" options can't be checked with
%{!foo:...} patterns in the specs file, so there's no easy way to see if the
option is being given to the linker.  A fix might be to give gcc on IRIX a new
command-line option which takes a filename parameter, and can be checked in the
specs file.  (Actually, maybe two options; I think the exported_symbol variant
might also tweak the default and conflict with hidden_symbol.)

Export lists are a fairly common feature of linkers these days.  Perhaps such
options should be added to the gcc command line where they'll be common to the
platforms that support them?  Then -exports_file can be passed to the MIPS
linker, something else to the Tru64 linker, something else to the GNU linker, etc.

-- 
           Summary: can't use MIPS linker option -exports_file
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: driver
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: raeburn at MIT dot EDU
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: mips-sgi-irix6.5
  GCC host triplet: mips-sgi-irix6.5
GCC target triplet: mips-sgi-irix6.5


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15288


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]