public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/3982: Incorrect Initialization in shared objects on Solaris (Regression to 2.95.3)
@ 2001-08-10 5:36 Martin Kahlert
0 siblings, 0 replies; only message in thread
From: Martin Kahlert @ 2001-08-10 5:36 UTC (permalink / raw)
To: gcc-gnats; +Cc: jwl
>Number: 3982
>Category: c
>Synopsis: Incorrect Initialization in shared objects on Solaris 2.7
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Fri Aug 10 05:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:
>Release: 3.0.1 20010807 (prerelease)
>Organization:
>Environment:
System: SunOS rumba 5.7 Generic_106541-08 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4
host: sparc-sun-solaris2.7
build: sparc-sun-solaris2.7
target: sparc-sun-solaris2.7
configured with: ../gcc/configure --prefix=/home/kahlert/GCC --enable-languages=c++,f77,java --enable-threads=posix --with-gnu-as --with-gnu-ld
>Description:
The problem was reported by Jim Liu in the newsgroup gnu.gcc.help.
I verified it using the latest snapshots:
- The program works on Linux with 3.0.1 prerelease.
- It works on Solaris 2.7 using gcc-2.95.3.
- It fails on Solaris 2.7 using gcc-3.0.1 prerelease
- According to Jim Liu it fails with gcc-3.0 on Solaris-2.7
and works with 3.0 for Solaris 2.8.
I could not check gcc-3.0.1 on Solaris 2.8, because i do not have access
to such a machine.
>How-To-Repeat:
cat myso.c
#include <string.h>
#include <stdio.h>
char *p = "Test Message";
int GlobalLength()
{
return(strlen(p));
}
cat main.c
#include <stdio.h>
extern int GlobalLength();
int main()
{
printf("global length==%d\n", GlobalLength());
}
gcc -fPIC -shared -o libmyso.so myso.c
gcc -o main main.c -L. -lmyso
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:.
./main
Segmentation fault
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-08-10 5:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-10 5:36 c/3982: Incorrect Initialization in shared objects on Solaris (Regression to 2.95.3) Martin Kahlert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).