From: John David Anglin Date: Mon, 31 Dec 2007 17:10:42 +0000 (+0000) Subject: re PR driver/33772 (collect2 doesn't strip .sl version) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a14e9dc1a0bde12b6e40ff4f5bc13f484aaeb0b;p=thirdparty%2Fgcc.git re PR driver/33772 (collect2 doesn't strip .sl version) PR driver/33772 * collect2.c (SHLIB_SUFFIX): Define if not defined. (write_c_file_stat): Use SHLIB_SUFFIX. * som.h (SHLIB_SUFFIX): Define. * doc/tm.texi (SHLIB_SUFFIX): Document. From-SVN: r131237 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0ac206a36823..8ae029b6c10e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2007-12-31 John David Anglin + + PR driver/33772 + * collect2.c (SHLIB_SUFFIX): Define if not defined. + (write_c_file_stat): Use SHLIB_SUFFIX. + * som.h (SHLIB_SUFFIX): Define. + * doc/tm.texi (SHLIB_SUFFIX): Document. + 2007-12-20 Jakub Jelinek PR bootstrap/34003 diff --git a/gcc/collect2.c b/gcc/collect2.c index f4cc46aad504..b39e61eb961a 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -130,6 +130,10 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #define SCAN_LIBRARIES #endif +#ifndef SHLIB_SUFFIX +#define SHLIB_SUFFIX ".so" +#endif + #ifdef USE_COLLECT2 int do_collecting = 1; #else @@ -1791,9 +1795,9 @@ write_c_file_stat (FILE *stream, const char *name ATTRIBUTE_UNUSED) } else { - if (strncmp (q, ".so", 3) == 0) + if (strncmp (q, SHLIB_SUFFIX, strlen (SHLIB_SUFFIX)) == 0) { - q += 3; + q += strlen (SHLIB_SUFFIX); break; } else diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h index e397b9dfd8ef..9754490d3d8c 100644 --- a/gcc/config/pa/som.h +++ b/gcc/config/pa/som.h @@ -360,3 +360,7 @@ do { \ /* We can't handle weak aliases, and therefore can't support pragma weak. Suppress the use of pragma weak in gthr-dce.h and gthr-posix.h. */ #define GTHREAD_USE_WEAK 0 + +/* Shared library suffix. Collect2 strips the version string after + this suffix when generating constructor/destructor names. */ +#define SHLIB_SUFFIX ".sl" diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 07c3ce1ff881..c5a3d240c644 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -7314,6 +7314,14 @@ code must advance @var{ptr} to the beginning of the filename on that line. Otherwise, it must set @var{ptr} to @code{NULL}. @end defmac +@defmac SHLIB_SUFFIX +Define this macro to a C string constant containing the default shared +library extension of the target (e.g., @samp{".so"}). @command{collect2} +strips version information after this suffix when generating global +constructor and destructor names. This define is only needed on targets +that use @command{collect2} to process constructors and destructors. +@end defmac + @node Instruction Output @subsection Output of Assembler Instructions