06.02.2013 Views

AVR32795: Using the GNU Linker Scripts on AVR UC3 ... - Atmel

AVR32795: Using the GNU Linker Scripts on AVR UC3 ... - Atmel

AVR32795: Using the GNU Linker Scripts on AVR UC3 ... - Atmel

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4 Default versus specific linker script<br />

32158A-<strong>AVR</strong>-01/11<br />

<str<strong>on</strong>g><strong>AVR</strong>32795</str<strong>on</strong>g><br />

The linker always uses a linker script. If n<strong>on</strong>e is explicitly supplied, <str<strong>on</strong>g>the</str<strong>on</strong>g> linker will use a<br />

default script that is compiled into <str<strong>on</strong>g>the</str<strong>on</strong>g> linker executable. The <strong>AVR</strong> <str<strong>on</strong>g>GNU</str<strong>on</strong>g> toolchain<br />

default linker scripts are under <str<strong>on</strong>g>the</str<strong>on</strong>g> directory:<br />

C:/Program Files/<strong>Atmel</strong>/<strong>AVR</strong> Tools/<strong>AVR</strong>(32) Toolchain/avr32/lib/ldscripts/<br />

O<str<strong>on</strong>g>the</str<strong>on</strong>g>r linker scripts can be supplied by using <str<strong>on</strong>g>the</str<strong>on</strong>g> –T command line opti<strong>on</strong> (or <str<strong>on</strong>g>the</str<strong>on</strong>g> l<strong>on</strong>g<br />

form: –script=). When this is d<strong>on</strong>e, <str<strong>on</strong>g>the</str<strong>on</strong>g> linker script specified will replace <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

default linker script.<br />

Extensi<strong>on</strong>s of <str<strong>on</strong>g>the</str<strong>on</strong>g> <str<strong>on</strong>g>GNU</str<strong>on</strong>g> toolchain linker scripts and <str<strong>on</strong>g>the</str<strong>on</strong>g>ir meanings:<br />

.x: default linker script, for “regular” executables.<br />

.xbn: default linker script used when <str<strong>on</strong>g>the</str<strong>on</strong>g> –N opti<strong>on</strong> is specified; mix text and data <strong>on</strong><br />

<str<strong>on</strong>g>the</str<strong>on</strong>g> same page; d<strong>on</strong>'t align data.<br />

.xn: default linker script used when <str<strong>on</strong>g>the</str<strong>on</strong>g> –n opti<strong>on</strong> is specified; mix text and data <strong>on</strong><br />

<str<strong>on</strong>g>the</str<strong>on</strong>g> same page.<br />

.xr: default linker script used when <str<strong>on</strong>g>the</str<strong>on</strong>g> –r opti<strong>on</strong> is specified; link without<br />

relocati<strong>on</strong>.<br />

.xu: default linker script used when <str<strong>on</strong>g>the</str<strong>on</strong>g> –Ur opti<strong>on</strong> is specified; link without<br />

relocati<strong>on</strong>, create c<strong>on</strong>structors.<br />

.xw: linker script to use for writable .rodata secti<strong>on</strong>.<br />

5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!