This is the mail archive of the gcc-patches@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]

fix keyed symbol names on tru64


Keying symbols to global symbols works great with static linking, since
you wind up with multiply defined symbol errors.  With shared libraries,
however, you find that the _GLOBAL__* symbol can get overridden by the
main executable.  Which results in all sorts of confusion.

Fortunately, the Tru64 linker has a command-line switch to not export
symbols by pattern name.  This fixes a half-dozen check-g++ failures.



r~


        * config/alpha/osf.h (LINK_SPEC): Hide _GLOBAL_* symbols.

Index: osf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/osf.h,v
retrieving revision 1.15.4.2
diff -c -p -d -r1.15.4.2 osf.h
*** osf.h	2001/06/07 17:02:42	1.15.4.2
--- osf.h	2001/06/11 16:07:24
*************** Boston, MA 02111-1307, USA.  */
*** 57,67 ****
  
  /* Pass "-G 8" to ld because Alpha's CC does.  Pass -O3 if we are
     optimizing, -O1 if we are not.  Pass -shared, -non_shared or
!    -call_shared as appropriate.  Also pass -pg.  */
  #define LINK_SPEC  \
    "-G 8 %{O*:-O3} %{!O*:-O1} %{static:-non_shared} \
!    %{!static:%{shared:-shared} %{!shared:-call_shared}} %{pg} %{taso} \
!    %{rpath*}"
  
  #define STARTFILE_SPEC  \
    "%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"
--- 57,69 ----
  
  /* Pass "-G 8" to ld because Alpha's CC does.  Pass -O3 if we are
     optimizing, -O1 if we are not.  Pass -shared, -non_shared or
!    -call_shared as appropriate.  Pass -hidden_symbol so that our
!    constructor and call-frame data structures are not accidentally
!    overridden.  */
  #define LINK_SPEC  \
    "-G 8 %{O*:-O3} %{!O*:-O1} %{static:-non_shared} \
!    %{!static:%{shared:-shared -hidden_symbol _GLOBAL_*} \
!    %{!shared:-call_shared}} %{pg} %{taso} %{rpath*}"
  
  #define STARTFILE_SPEC  \
    "%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"


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