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: How to set a memory size of a section with ld script


On Sat, Apr 28, 2007 at 11:01:42PM +0300, Yuriy Zhilovets wrote:
> I need to make some code with a large trailing of free space after it.
> So I guess that I need a section which image must be greater in memory 
> than in a file, that is a section which will map to a segment with 
> p_memsz > p_filesz

ld does this already for bss sections.

> How can I achieve this with ld script or by other means?

I suggest you create your own bss section (@nobits type) and use a
linker script to place it after your code section.  Keep the
attributes similar to your code section (in particular don't make your
bss section writable if the code section isn't writable) and the
linker should place it in the same segment.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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