]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR driver/33772 (collect2 doesn't strip .sl version)
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Mon, 31 Dec 2007 16:04:26 +0000 (16:04 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Mon, 31 Dec 2007 16:04:26 +0000 (16:04 +0000)
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: r131236

gcc/ChangeLog
gcc/collect2.c
gcc/config/pa/som.h
gcc/doc/tm.texi

index 22f6994a1bd94b1eed9590c0317932094fe2730c..7fa4d9ef9d426fd54d15efa97ad2ce83b01257b8 100644 (file)
@@ -1,3 +1,11 @@
+2007-12-31  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       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-27  Gerald Pfeifer  <gerald@pfeifer.com>
 
        * config.gcc: Proactively add FreeBSD 10 and FreeBSD 11.
index e4c92857e0d1d76df3c5853a885ab72be10199bf..714f4d911cc36ac3bc13703702899245f96d3329 100644 (file)
@@ -129,6 +129,10 @@ along with GCC; see the file COPYING3.  If not see
 #define SCAN_LIBRARIES
 #endif
 
+#ifndef SHLIB_SUFFIX
+#define SHLIB_SUFFIX ".so"
+#endif
+
 #ifdef USE_COLLECT2
 int do_collecting = 1;
 #else
@@ -1790,9 +1794,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
index 22bda046912de23bc1d210d555df8d643a96843f..5d1c054a3eb7c51dd373b46c2445bbb86f4c5b42 100644 (file)
@@ -335,3 +335,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"
index 98fad45fccf8d4738a3ae186db0b28e38383e2b6..f00a154deb207c370e148d3885c16e18428a421c 100644 (file)
@@ -7629,6 +7629,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