From: Martin Str|mberg Subject: Re: /DISCARD/ in linker script Newsgroups: comp.os.msdos.djgpp References: <1021312249 DOT 448613 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: <1024239824.675986@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: 16 Jun 2002 15:03:44 GMT Lines: 34 NNTP-Posting-Date: 16 Jun 2002 15:03:44 GMT NNTP-Posting-Host: queeg.ludd.luth.se X-Trace: 1024239824 news.luth.se 288 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 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); : } : } 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. Right, MartinS