www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/26/06:37:10

Date: Thu, 26 Dec 1996 13:11:41 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Kuang-Chun Cheng <kccheng AT hep2 DOT phys DOT sinica DOT edu DOT tw>
cc: djgpp AT delorie DOT com
Subject: Re: linker script ?
In-Reply-To: <59t42d$k31@gate.sinica.edu.tw>
Message-ID: <Pine.SUN.3.91.961226130352.6744B-100000@is>
MIME-Version: 1.0

On 26 Dec 1996, Kuang-Chun Cheng wrote:

>          ld -Tc:/djgpp/lib/djgpp.lnk -o test1 test.o
>          ld -o test2 test.o
> 
> test1 is smaller than test2.  Could someone explain this?

How much smaller?  Is it smaller by 2048 bytes?  If so, that's because 
the default target for ld is to create a .exe-style executable (you 
should see the characters `M' and `Z' as the first two bytes of test2).  
OTOH, test1 is an unstabbed COFF file, which doesn't include the 2KB-long 
stub.

I think the default alignment is also different from what the linker 
script says, which might explain additional differences.

Btw, it is only natural that you get different results with and without 
the script, otherwise it would be superflous, right?

> Btw, what does .bss (in asm code) stand for? 

Uninitialized data gets into that section.

- Raw text -


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