diff options
author | John David Anglin <dave.anglin@nrc-cnrc.gc.ca> | 2007-12-31 15:02:59 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2007-12-31 15:02:59 +0000 |
commit | 881466d851f3c806692bda4569a4534d89848104 (patch) | |
tree | 85fdd38f176305106cbb90d88435a6728e14145d | |
parent | 64aba73899621ddfa72986f82753b3513a9e8462 (diff) | |
download | gcc-881466d851f3c806692bda4569a4534d89848104.zip gcc-881466d851f3c806692bda4569a4534d89848104.tar.gz gcc-881466d851f3c806692bda4569a4534d89848104.tar.bz2 |
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: r131235
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/collect2.c | 8 | ||||
-rw-r--r-- | gcc/config/pa/som.h | 4 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 8 |
4 files changed, 26 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2fef7a2..f951aa1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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-29 Uros Bizjak <ubizjak@gmail.com> * config/i386/sse.md ("*divv4sf3"): Rename to "sse_divv4sf3". diff --git a/gcc/collect2.c b/gcc/collect2.c index a673f25..bba108d 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -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 @@ -1868,9 +1872,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 22bda04..5d1c054 100644 --- a/gcc/config/pa/som.h +++ b/gcc/config/pa/som.h @@ -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" diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 0bf0b34..00dde97 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -7931,6 +7931,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 |