From owner-freebsd-bugs Wed Mar 18 07:00:25 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA23902 for freebsd-bugs-outgoing; Wed, 18 Mar 1998 07:00:25 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA23844; Wed, 18 Mar 1998 07:00:13 -0800 (PST) (envelope-from gnats) Received: from yandex.hq.cti.ru (yandex.hq.cti.ru [194.67.85.53]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA22985 for ; Wed, 18 Mar 1998 06:53:49 -0800 (PST) (envelope-from tejblum@arc.hq.cti.ru) Received: (from tejblum@localhost) by yandex.hq.cti.ru (8.8.8/8.8.7) id RAA11391; Wed, 18 Mar 1998 17:53:10 +0300 (MSK) (envelope-from tejblum) Message-Id: <199803181453.RAA11391@yandex.hq.cti.ru> Date: Wed, 18 Mar 1998 17:53:10 +0300 (MSK) From: Dmitrij Tejblum Reply-To: tejblum@arc.hq.cti.ru To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: gnu/6055: as(1) sometimes incorrectly handle EGCS output Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 6055 >Category: gnu >Synopsis: as(1) sometimes incorrectly handle EGCS output >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 18 07:00:06 PST 1998 >Last-Modified: >Originator: Dmitrij Tejblum >Organization: CompTek >Release: FreeBSD 2.2.5-STABLE i386 >Environment: FreeBSD 2.2.5-stable EGCS 1.0.2 configured with --with-gnu-as --with-gnu-ld >Description: When a C++ program contains a static variable with a constructor, GCC emit something like .stabs "___CTOR_LIST__",22,0,0,__GLOBAL_$I$whatever GCC 2.7.2.1 always emit it after __GLOBAL_$I$whatever was defined. EGCS sometimes (apparently, with -O3, as I see now) emit it before __GLOBAL_$I$whatever was defined. In this case, assembler silently convert that stab to "usual" text symbol. As a result, ld complains about multiply defined ___CTOR_LIST__. >How-To-Repeat: put something like .stabs "___CTOR_LIST__",22,0,0,_qq _qq: movl %eax, %eax to an .s file, assemble it, look at result with nm. >Fix: Not sure about correct fix. Here is my workaround, just FYI. (And so I have a chance to hear that all my object are hopelessly broken :). --- config/obj-aout.c Tue Mar 17 11:25:17 1998 +++ config/obj-aout.c Tue Mar 17 11:55:42 1998 @@ -469,7 +469,8 @@ /* JF deal with forward references first... */ for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) { if (symbolP->sy_forward && symbolP->sy_forward != symbolP) { - S_SET_SEGMENT(symbolP, + if ((symbolP->sy_symbol.n_type & 0xf0) == 0) + S_SET_SEGMENT(symbolP, S_GET_SEGMENT(symbolP->sy_forward)); S_SET_VALUE(symbolP, S_GET_VALUE(symbolP) + S_GET_VALUE(symbolP->sy_forward) >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message