This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Re: How to inform the linker not to produce any data for a.bsssection?


Hi, Jacobowitz

Can you tell me how to modify the link script to prevent .bss taking up space in file?
I didn't grap your meanings and have no idea what to do.


 
On Tue, Dec 11, 2007 at 09:19:12AM +0800, PRC wrote:
> mips-elf-objdump -h a.out 
> -------------------------------------------------------------------
>   3 .bss          00010620  81413898  81413898  00003898  2**3
>                   ALLOC
>   4 .reginfo      00000018  00000000  00000000  00013eb8  2**2
>                   CONTENTS, READONLY, LINK_ONCE_SAME_SIZE
> ------------------------------------------------------------------
> The difference between sections ".bss" and ".reginfo" is almost 64K,
> which is just the size of the buffer `cmd_buffer`. And I check the
> output file, and find there are lots of zero starting from the offset
> 0x3898. It seems the linker puts 64K zeros in the section ".bss".

This is necessary alignment.  If you don't want .bss to take up space
in the file, do not put allocated sections after it.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]