06.02.2013 Views

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

9.9 Example GNU ld script for linking ld --ldpartial object<br />

9.9.1 See also<br />

GNU ld script support in armlink<br />

The general form of ld --ldpartial is to assign each output section to 0x0. The linker is not<br />

always be able to honor <strong>the</strong> instructions in <strong>the</strong> SECTIONS command. Input sections that are<br />

merged into one output section cannot be removed in subsequent links. If <strong>the</strong> linker detects that<br />

it might have to remove a section in a subsequent link it does not merge <strong>the</strong> section. Sections<br />

that cannot be merged are passed through into <strong>the</strong> output object unchanged.<br />

SECTIONS<br />

{<br />

.init 0 : { *(.init) }<br />

.text 0 : { *(.text) }<br />

.fini 0 : { *(.fini) }<br />

.rodata 0 : { *(.rodata) }<br />

.data 0 : { *(.data) }<br />

.bss 0 : { *(.bss) }<br />

}<br />

Use <strong>the</strong> armlink --linker_script command-line option to specify an ld script file.<br />

Concepts<br />

• About GNU ld script support and restrictions on page 9-2.<br />

Reference<br />

<strong>Linker</strong> Reference:<br />

• --ldpartial on page 2-94<br />

• --linker_script=ld_script on page 2-100.<br />

<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 9-16<br />

ID080411 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!