From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17373 invoked by alias); 24 Sep 2002 16:36:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17354 invoked by uid 71); 24 Sep 2002 16:36:02 -0000 Resent-Date: 24 Sep 2002 16:36:02 -0000 Resent-Message-ID: <20020924163602.17353.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, hyc@symas.com Received: (qmail 13261 invoked by uid 61); 24 Sep 2002 16:27:52 -0000 Message-Id: <20020924162752.13260.qmail@sources.redhat.com> Date: Tue, 24 Sep 2002 09:36:00 -0000 From: hyc@symas.com Reply-To: hyc@symas.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/8022: gcc 3.2 Solaris 64 bit shared libraries X-SW-Source: 2002-09/txt/msg00652.txt.bz2 List-Id: >Number: 8022 >Category: c >Synopsis: gcc 3.2 Solaris 64 bit shared libraries >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: change-request >Submitter-Id: net >Arrival-Date: Tue Sep 24 09:36:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: hyc@symas.com >Release: gcc-3.2, binutils 2.11.2 >Organization: >Environment: Solaris 2.8 Ultrasparc >Description: 64 bit binaries produced by gcc 3.x "-m64" option and compiled by gas are unusable for shared libraries, by default. The gas --help says "-TSO" is the default but it actually defaults to "-RMO". /usr/ccs/bin/ld will link the object files without any complaint, but the runtime linker barfs. This issue was first reported on http://gcc.gnu.org/ml/gcc-help/2002-06/msg00005.html Adding "-TSO" to the specs file for the appropriate -m64 clauses fixes the problem. >How-To-Repeat: $ gcc -m64 -c foo.c (any valid C code will do) $ /usr/ccs/bin/ld -G -o foo.so foo.o $ gcc -m64 -o main main.c ./foo.so $ ./main ld.so.1: ./main: fatal: ./foo.so: bad ELF flags value: 2 >Fix: lute:/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2# diff -c specs{.O,} *** specs.O Tue Sep 24 04:46:03 2002 --- specs Tue Sep 24 09:08:17 2002 *************** *** 120,129 **** %{pthreads:-D_REENTRANT -D_PTHREADS} %{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude} *asm_cpu: ! %{mcpu=ultrasparc:%{!m64:-xarch=v8plusa}%{m64:-xarch=v9a}} %{mcpu=v9:%{!m64:-xarch=v8plus}%{m64:-xarch=v9}} %{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:%{!m64:-xarch=v8}%{m64:-xarch=v9}}}} %{!mcpu*:%(asm_cpu_default)} *asm_cpu_default: ! %{m64:-xarch=v9} %{!m64:} *asm_arch32: --- 120,129 ---- %{pthreads:-D_REENTRANT -D_PTHREADS} %{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude} *asm_cpu: ! %{mcpu=ultrasparc:%{!m64:-xarch=v8plusa}%{m64:-xarch=v9a -TSO}} %{mcpu=v9:%{!m64:-xarch=v8plus}%{m64:-xarch=v9 -TSO}} %{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:%{!m64:-xarch=v8}%{m64:-xarch=v9 -TSO}}}} %{!mcpu*:%(asm_cpu_default)} *asm_cpu_default: ! %{m64:-xarch=v9 -TSO} %{!m64:} *asm_arch32: >Release-Note: >Audit-Trail: >Unformatted: