Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Fri, 12 Jul 2002 18:50:19 +0400
From: egor duda <deo@logos-m.ru>
Reply-To: egor duda <cygwin@cygwin.com>
Organization: deo
X-Priority: 3 (Normal)
Message-ID: <18286446082.20020712185019@logos-m.ru>
To: Wolfgang Hesseler <qv@multimediaware.com>
CC: cygwin@cygwin.com
Subject: Re: Bug: BSS segment in COFF files
In-Reply-To: <3D2EE7DB.471B@multimediaware.com>
References: <3D2EA2E2.2881@multimediaware.com>
 <8772121004.20020712145134@logos-m.ru> <3D2EBFC2.6973@multimediaware.com>
 <9975891676.20020712155424@logos-m.ru> <3D2EC616.19DA@multimediaware.com>
 <9382195250.20020712173928@logos-m.ru> <3D2EE0C2.78D6@multimediaware.com>
 <17484095953.20020712181108@logos-m.ru> <3D2EE7DB.471B@multimediaware.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi!

Friday, 12 July, 2002 Wolfgang Hesseler qv@multimediaware.com wrote:

>> $ cat x.c
>> int a;
>> static int b[10000];
>> $ gcc -fno-common -save-temps -c x.c
>> $ cat x.s
>>         .file   "x.i"
>> .globl _a
>>         .bss
>>         .align 4
>> _a:
>>         .space 4
>> .lcomm _b,40000
>> $ objdump --section-headers x.o
>> Idx Name          Size      VMA       LMA       File off  Algn
>>   0 .text         00000000  00000000  00000000  00000000  2**2
>>                   ALLOC, LOAD, CODE
>>   1 .data         00000000  00000000  00000000  00000000  2**2
>>                   ALLOC, LOAD, DATA
>>   2 .bss          00009c48  00000000  00000000  00000000  2**2
>>                   ALLOC

WH> Right. But the whole Cygwin wouldn't work if its programs wouldn't recognize
WH> its own object code properly. My problem is that Cygwin produces
WH> some non-standard COFF object files. I will do some experiments with
WH> objcopy and see if that helps to solve the problem.

I suppose it's too early to call it non-standard without strong
evidence. For now, you have found that it's somehow incompatible with
ida and/or watcom linker, though i did test linking x.o with
watcom-compiled test.obj using wlink and everything worked fine.

$ cat x.mk
project : f:\test\x.exe .SYMBOLIC

!include f:\test\x.mk1
$ cat x.mk1
f:\test\test.obj : f:\test\test.c .AUTODEPEND
 @f:
 cd f:\test
 *wcc386 test.c -i=e:\w32app\prog\watc10\h;e:\w32app\prog\watc10\h\nt -w4 -e&
25 -zq -otexan -d2 -mf -5r -bt=nt

f:\test\x.exe : f:\test\test.obj f:\test\x.o .AUTODEPEND
 @f:
 cd f:\test
 @%write x.lk1 NAME x
 @%append x.lk1 FIL test.obj
 @%append x.lk1 FIL x.o
 @%append x.lk1 
 *wlink SYS nt op m d all op st=8192 op maxe=25 op q op symf @x.lk1

$ wmake -f x.mk
Watcom Make Version 11.0
Copyright by Sybase, Inc., and its subsidiaries, 1988, 1997.
All rights reserved.  Watcom is a trademark of Sybase, Inc.
        cd f:\test
        wcc386 test.c -i=e:\w32app\prog\watc10\h;e:\w32app\prog\watc10\h\nt -w4
-e25 -zq -otexan -d2 -mf -5r -bt=nt
test.c(5): Warning! W107: Missing return value for function 'main'
test.c(5): Warning! W301: No prototype found for 'printf'
        cd f:\test
        wlink SYS nt op m d all op st=8192 op maxe=25 op q op symf @x.lk1
$ ./x.exe
1

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

