3.2.3 Linker Options

Next: 3.2.4 MCS51 Options Up: 3.2 Command Line Options Previous: 3.2.2 Preprocessor Options Contents Index

##
3.2.3 Linker Options

- [-L --lib-path <absolute] path to additional libraries> This option is passed to the linkage editor's additional libraries search path. The path name must be absolute. Additional library files may be specified in the command line. See section Compiling programs for more details.
- [--xram-loc <Value>] The start location of the external ram, default value is 0. The value entered can be in Hexadecimal or Decimal format, e.g.: --xram-loc 0x8000 or --xram-loc 32768.
- [--code-loc <Value>] The start location of the code segment, default value 0. Note when this option is used the interrupt vector table is also relocated to the given address. The value entered can be in Hexadecimal or Decimal format, e.g.: --code-loc 0x8000 or --code-loc 32768.
- [--stack-loc <Value>] By default the stack is placed after the data segment. Using this option the stack can be placed anywhere in the internal memory space of the 8051. The value entered can be in Hexadecimal or Decimal format, e.g. --stack-loc 0x20 or --stack-loc 32. Since the sp register is incremented before a push or call, the initial sp will be set to one byte prior the provided value. The provided value should not overlap any other memory areas such as used register banks or the data segment and with enough space for the current application. The --pack-iram option (which is now a default setting) will override this setting, so you should also specify the --no-pack-iram option if you need to manually place the stack.
- [--xstack-loc <Value>] By default the external stack is placed after the pdata segment. Using this option the xstack can be placed anywhere in the external memory space of the 8051. The value entered can be in Hexadecimal or Decimal format, e.g. --xstack-loc 0x8000 or --stack-loc 32768. The provided value should not overlap any other memory areas such as the pdata or xdata segment and with enough space for the current application.
- [--data-loc <Value>] The start location of the internal ram data segment. The value entered can be in Hexadecimal or Decimal format, eg. --data-loc 0x20 or --data-loc 32. (By default, the start location of the internal ram data segment is set as low as possible in memory, taking into account the used register banks and the bit segment at address 0x20. For example if register banks 0 and 1 are used without bit variables, the data segment will be set, if --data-loc is not used, to location 0x10.)
- [--idata-loc <Value>] The start location of the indirectly addressable internal ram of the 8051, default value is 0x80. The value entered can be in Hexadecimal or Decimal format, eg. --idata-loc 0x88 or --idata-loc 136.
- [--bit-loc <Value>] The start location of the bit addressable internal ram of the 8051. This is not implemented yet. Instead an option can be passed directly to the linker: -Wl -bBSEG=<Value>.
- [--out-fmt-ihx] The linker output (final object code) is in Intel Hex format. This is the default option. The format itself is documented in the documentation of srecord.
- [--out-fmt-s19] The linker output (final object code) is in Motorola S19 format. The format itself is documented in the documentation of srecord.
- [--out-fmt-elf] The linker output (final object code) is in ELF format. (Currently only supported for the HC08 processors)
- [-Wl linkOption[,linkOption]...] Pass the linkOption to the linker. If a bootloader is used an option like ''-Wl -bCSEG=0x1000'' would be typical to set the start of the code segment. Either use the double quotes around this option or use no space (e.g. -Wl-bCSEG=0x1000). See also #pragma constseg and #pragma codeseg in section 3.19 . File sdcc/as/doc/asxhtm.html has more on linker options.

Next: 3.2.4 MCS51 Options Up: 3.2 Command Line Options Previous: 3.2.2 Preprocessor Options Contents Index