How to limit the size of a program?

Nick Clifton nickc@redhat.com
Tue Oct 14 10:32:00 GMT 2008


Hi Pan,

> I want to limit the size of runtime code and data
> (including .text, .data, .bss, .sbss sections) when linking a program.
> I want LD to report an error if the size is larger than some specified
> value (i.e. 0x4000). I guess this may be related to the linker script.
> What should I do?

Set up MEMORY regions in the linker script to describe the restrictions 
and then assign the relevant sections to these regions.  See the linker 
documentation for descriptions of MEMORY regions and how to assign them 
to sections.

Cheers
   Nick




More information about the Binutils mailing list