1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >Linker Scripts</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="HAL Interfaces"
23 HREF="hal-interfaces.html"><LINK
26 HREF="hal-cache-control.html"><LINK
28 TITLE="Diagnostic Support"
29 HREF="hal-diagnostic-support.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="hal-cache-control.html"
65 >Chapter 9. HAL Interfaces</TD
71 HREF="hal-diagnostic-support.html"
85 NAME="HAL-LINKER-SCRIPTS">Linker Scripts</H1
87 >When an eCos application is linked it must be done under the control
88 of a linker script. This script defines the memory areas, addresses
89 and sized, into which the code and data are to be put, and allocates
90 the various sections generated by the compiler to these.</P
92 >The linker script actually used is in
96 > in the install directory. This is
97 actually manufactured out of two other files: a base linker script and
101 > file that was generated by the memory
104 >The base linker script is usually supplied either by the architecture
105 HAL or the variant HAL. It consists of a set of linker script
106 fragments, in the form of C preprocessor macros, that define the major
107 output sections to be generated by the link operation. The
115 by the base linker script, uses these macro definitions to assign the
116 output sections to the required memory areas and link addresses.</P
121 > file is supplied by the platform HAL, and
122 contains knowledge of the memory layout of the target platform. These
123 files generally conform to a standard naming convention, each file
124 being of the form:</P
128 >pkgconf/mlt_<architecture>_<variant>_<platform>_<startup>.ldi</TT
133 ><architecture></TT
141 ><platform></TT
142 > are the respective HAL package
146 > is the startup type which
147 is usually one of <TT
159 >In addition to the <TT
162 > file, there is also a
166 > file. This may be used by the
167 application to access information defined in the
171 > file. Specifically it contains the memory
172 layout defined there, together with any additional section names
173 defined by the user. Examples of the latter are heap areas or PCI bus
174 memory access windows.</P
179 > is manufactured by the <SPAN
187 configuration into a file named</P
191 >include/pkgconf/mlt_<architecture>_<variant>_<platform>_<startup>.mlt</TT
194 >in the platform HAL. This file is used by the
198 > to manufacture both the
205 > files. Users should
206 beware that direct edits the either of these files may be overwritten
210 > is run and regenerates them from the
216 >The names of the <TT
223 files are defined by macro definitions in
226 >pkgconf/system.h</TT
230 >CYGHWR_MEMORY_LAYOUT_LDI</TT
234 >CYGHWR_MEMORY_LAYOUT_H</TT
235 > respectively. While there
236 will be little need for the application to refer to the
240 > file directly, it may include the
244 > file as follows:</P
252 CLASS="PROGRAMLISTING"
253 >#include CYGHWR_MEMORY_LAYOUT_H</PRE
263 SUMMARY="Footer navigation table"
274 HREF="hal-cache-control.html"
292 HREF="hal-diagnostic-support.html"
308 HREF="hal-interfaces.html"
316 >Diagnostic Support</TD