delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/07/06/08:38:43

From: Martin Str|mberg <ams AT speedy DOT ludd DOT luth DOT se>
Subject: Re: /DISCARD/ in linker script
Newsgroups: comp.os.msdos.djgpp
References: <1021312249 DOT 448613 AT queeg DOT ludd DOT luth DOT se> <1024239824 DOT 675986 AT queeg DOT ludd DOT luth DOT se>
User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (NetBSD/1.5_BETA (alpha))
Message-ID: <1025956231.97399@queeg.ludd.luth.se>
Cache-Post-Path: queeg.ludd.luth.se!unknown AT speedy DOT ludd DOT luth DOT se
X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/)
Date: 06 Jul 2002 11:50:31 GMT
Lines: 58
NNTP-Posting-Date: 06 Jul 2002 11:50:31 GMT
NNTP-Posting-Host: queeg.ludd.luth.se
X-Trace: 1025956231 news.luth.se 466 130.240.16.109
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Martin Str|mberg <ams AT speedy DOT ludd DOT luth DOT se> wrote:
: Martin Str|mberg <ams AT speedy DOT ludd DOT luth DOT se> wrote:
: : I want to make the .bss not to be included in output file. I use the
: : binary format ("ld --oformat binary").

: : Right now I have:
: : ENTRY(start)
: : SECTIONS
: : {
: : 	.text 0 : {
: : 		*(.text)
: : 		etext = . ; _etext = .;
: : 		. = ALIGN(0x100);
: : 	}
: : 	.data ALIGN(0x100) : {
: : 		*(.data)
: : 		edata = . ; _edata = .;
: : 		. = ALIGN(0x100);
: : 	}
: : 	/DISCARD/ SIZEOF(.data) + ADDR(.data) : {
: : 		*(.bss)
: : 		*(COMMON)
: : 		end = . ; _end = .;
: : 		. = ALIGN(0x100);
: : 	}
: : }

Further experiments gives that while

  /DISCARD/ : 
  {
    *(*)
  }

works

  /DISCARD/ : 
  {
    . = ALIGN(0x1000)
    *(*)
  }

does not.

: Uhum... It looks like the .bss isn't included in the output. It's
: automatically DISCARDed. Is this some sort of general knowledge or
: something. Because I read all of "info ld" and didn't learn this.

Sigh! Now with ld 2.11.2 it look like the .bss is included in the
image!

That makes me wonder if not all DJGPP binaries that is compiled with
ld 2.11.2 do include the .bss!


Right,

						MartinS

- Raw text -


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