X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg) Newsgroups: comp.os.msdos.djgpp Subject: Re: /DISCARD/ in linker script Date: 14 May 2002 09:48:19 GMT Organization: Ericsson Erisoft AB, Sweden Lines: 56 Message-ID: References: <1021312249 DOT 448613 AT queeg DOT ludd DOT luth DOT se> NNTP-Posting-Host: lws256.lu.erisoft.se X-Newsreader: TIN [version 1.2 PL2] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Boris Vrbaniæ (boris DOT vrbanic AT hi DOT hinet DOT hr) wrote: : "Martin Str|mberg" wrote in message : news:1021312249 DOT 448613 AT queeg DOT ludd DOT luth DOT se... : > : > Can anyone show me an example of a link script that uses the : > "/DISCARD/" section? : > : > 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); : > } : > } : > : > ld says "Illegal use of `/DISCARD/' section" : > : > : > Right, : > : > MartinS : /DISCARD/ section is used like any other section, example Yes. That's why I think my script is correct. : /DISCARD/ { : *(.eh_frame) : } : this tells linker to discard section "eh_frame" from object file Yes. And why doesn't my example work? Right, MartinS