5.7.10.2 Fill Option
The
-fill option is used for filling unused (unspecified)
memory locations in the output with a known value. The usage of this option
is:--fill=[wwidth:]fill_expr@address:end_addresswhere the arguments have the following meaning:
wwidth- signifies the decimal width of each constant in the
fill_exprand can range from 1 thru 9. If this width is not specified, the default value is two bytes. For example,--fill=w1:0x55@0:0xFwith fill every unused byte between address 0 and 0xF with the byte value 0x55, whereas--fill=w2:0x55@0:0xFwith fill every unused byte between the same addresses with the value 0x0055. fill_expr- defines the values to fill and consists of
const, which is a base value to place in the first memory location and optionally withincrement, which indicates how this base value should change after each use. If the base value specifies more than one byte, these are stored in little-endian byte order. These following show the possible fill expressions:constfill memory with a repeating constant; i.e.,--fill=0xBEEF@0-0x1FFfills unused locations starting at address 0 with the values 0xBEEF, 0xBEEF, 0xBEEF, 0xBEEF, etc.const+=incrementfill memory with an incrementing constant; i.e.,--fill=0xBEEF+=1@0:0x1FFattempts to fills with the values 0xBEEF, 0xBEF0, 0xBEF1, 0xBEF2, etc. Note thatconstincrements with each location scanned, regardless of whether that location is populated or unused.const-=incrementfill memory with a decrementing constant; i.e.,--fill=0xBEEF-=0x10@0:0x1FFattempts to fills with the values 0xBEEF, 0xBEDF, 0xBECF, 0xBEBF, etc. Note thatconstdecrements with each location scanned, regardless of whether that location is populated or unused.const,const,...,constfill memory with a list of repeating constants; i.e.,--fill=0xDEAD,0xBEEF@0:0x1FFfills with 0xDEAD, 0xBEEF, 0xDEAD, 0xBEEF, etc.
@address:end_address- fills a specific address range with
fill_expr; for example,--fill=0xBEEF@0x1000:0x1001puts the byte value 0xEF at addresses 0x1000; and--fill=0xBEEF@0xF0:0xFFputs 0xBEEF in unused addresses between 0 and 0xFF, inclusive.
