]> 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 17:10:42 +0000 (17:10 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Mon, 31 Dec 2007 17:10:42 +0000 (17:10 +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: r131237

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

index 0ac206a368232220267b96580692732efc316714..8ae029b6c10eddb9bc016be3cd52bc8e2acdeba0 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-20  Jakub Jelinek  <jakub@redhat.com>
 
        PR bootstrap/34003
index f4cc46aad504958e98365574f1d9b913ee0ff24a..b39e61eb961a17313ee6fdad6a16d5c928df51af 100644 (file)
@@ -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
index e397b9dfd8ef3d6267803f376f7a935e53847723..9754490d3d8c650d569de9829f5fec7ab524c385 100644 (file)
@@ -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"
index 07c3ce1ff8818ae6197e26b5fb5925fbbb36db72..c5a3d240c644345525b82f753705259a8a0b9714 100644 (file)
@@ -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