www.delorie.com/gnu/docs/binutils/ld_36.html   search  
Buy GNU books!

Untitled Document

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ] Output section fill

You can set the fill pattern for an entire section by using `=fillexp'. fillexp is an expression (see section 3.10 Expressions in Linker Scripts). Any otherwise unspecified regions of memory within the output section (for example, gaps left due to the required alignment of input sections) will be filled with the value, repeated as necessary. If the fill expression is a simple hex number, ie. a string of hex digit starting with `0x' and without a trailing `k' or `M', then an arbitrarily long sequence of hex digits can be used to specify the fill pattern; Leading zeros become part of the pattern too. For all other cases, including extra parentheses or a unary +, the fill pattern is the four least significant bytes of the value of the expression. In all cases, the number is big-endian.

You can also change the fill value with a FILL command in the output section commands; (see section 3.6.5 Output section data).

Here is a simple example:
SECTIONS { .text : { *(.text) } =0x90909090 }

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003