delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/07/12/10:52:47

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 12 Jul 2002 18:50:19 +0400
From: egor duda <deo AT logos-m DOT ru>
Reply-To: egor duda <cygwin AT cygwin DOT com>
Organization: deo
X-Priority: 3 (Normal)
Message-ID: <18286446082.20020712185019@logos-m.ru>
To: Wolfgang Hesseler <qv AT multimediaware DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: Bug: BSS segment in COFF files
In-Reply-To: <3D2EE7DB.471B@multimediaware.com>
References: <3D2EA2E2 DOT 2881 AT multimediaware DOT com>
<8772121004 DOT 20020712145134 AT logos-m DOT ru> <3D2EBFC2 DOT 6973 AT multimediaware DOT com>
<9975891676 DOT 20020712155424 AT logos-m DOT ru> <3D2EC616 DOT 19DA AT multimediaware DOT com>
<9382195250 DOT 20020712173928 AT logos-m DOT ru> <3D2EE0C2 DOT 78D6 AT multimediaware DOT com>
<17484095953 DOT 20020712181108 AT logos-m DOT ru> <3D2EE7DB DOT 471B AT multimediaware DOT com>
MIME-Version: 1.0

Hi!

Friday, 12 July, 2002 Wolfgang Hesseler qv AT multimediaware DOT 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 AT logos-m DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019