You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
4.6 KiB
HTML
99 lines
4.6 KiB
HTML
15 years ago
|
<html lang="en">
|
||
|
<head>
|
||
|
<title>SECTIONS - Untitled</title>
|
||
|
<meta http-equiv="Content-Type" content="text/html">
|
||
|
<meta name="description" content="Untitled">
|
||
|
<meta name="generator" content="makeinfo 4.7">
|
||
|
<link title="Top" rel="start" href="index.html#Top">
|
||
|
<link rel="up" href="Scripts.html#Scripts" title="Scripts">
|
||
|
<link rel="prev" href="Assignments.html#Assignments" title="Assignments">
|
||
|
<link rel="next" href="MEMORY.html#MEMORY" title="MEMORY">
|
||
|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||
|
<!--
|
||
|
This file documents the GNU linker LD
|
||
|
(GNU Binutils)
|
||
|
version 2.19.
|
||
|
|
||
|
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000,
|
||
|
2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||
|
|
||
|
Permission is granted to copy, distribute and/or modify this document
|
||
|
under the terms of the GNU Free Documentation License, Version 1.1
|
||
|
or any later version published by the Free Software Foundation;
|
||
|
with no Invariant Sections, with no Front-Cover Texts, and with no
|
||
|
Back-Cover Texts. A copy of the license is included in the
|
||
|
section entitled ``GNU Free Documentation License''.-->
|
||
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||
|
<style type="text/css"><!--
|
||
|
pre.display { font-family:inherit }
|
||
|
pre.format { font-family:inherit }
|
||
|
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||
|
pre.smallformat { font-family:inherit; font-size:smaller }
|
||
|
pre.smallexample { font-size:smaller }
|
||
|
pre.smalllisp { font-size:smaller }
|
||
|
span.sc { font-variant:small-caps }
|
||
|
span.roman { font-family: serif; font-weight: normal; }
|
||
|
--></style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="node">
|
||
|
<p>
|
||
|
<a name="SECTIONS"></a>Next: <a rel="next" accesskey="n" href="MEMORY.html#MEMORY">MEMORY</a>,
|
||
|
Previous: <a rel="previous" accesskey="p" href="Assignments.html#Assignments">Assignments</a>,
|
||
|
Up: <a rel="up" accesskey="u" href="Scripts.html#Scripts">Scripts</a>
|
||
|
<hr><br>
|
||
|
</div>
|
||
|
|
||
|
<h3 class="section">3.6 SECTIONS Command</h3>
|
||
|
|
||
|
<p><a name="index-SECTIONS-361"></a>The <code>SECTIONS</code> command tells the linker how to map input sections
|
||
|
into output sections, and how to place the output sections in memory.
|
||
|
|
||
|
<p>The format of the <code>SECTIONS</code> command is:
|
||
|
<pre class="smallexample"> SECTIONS
|
||
|
{
|
||
|
<var>sections-command</var>
|
||
|
<var>sections-command</var>
|
||
|
...
|
||
|
}
|
||
|
</pre>
|
||
|
<p>Each <var>sections-command</var> may of be one of the following:
|
||
|
|
||
|
<ul>
|
||
|
<li>an <code>ENTRY</code> command (see <a href="Entry-Point.html#Entry-Point">Entry command</a>)
|
||
|
<li>a symbol assignment (see <a href="Assignments.html#Assignments">Assignments</a>)
|
||
|
<li>an output section description
|
||
|
<li>an overlay description
|
||
|
</ul>
|
||
|
|
||
|
<p>The <code>ENTRY</code> command and symbol assignments are permitted inside the
|
||
|
<code>SECTIONS</code> command for convenience in using the location counter in
|
||
|
those commands. This can also make the linker script easier to
|
||
|
understand because you can use those commands at meaningful points in
|
||
|
the layout of the output file.
|
||
|
|
||
|
<p>Output section descriptions and overlay descriptions are described
|
||
|
below.
|
||
|
|
||
|
<p>If you do not use a <code>SECTIONS</code> command in your linker script, the
|
||
|
linker will place each input section into an identically named output
|
||
|
section in the order that the sections are first encountered in the
|
||
|
input files. If all input sections are present in the first file, for
|
||
|
example, the order of sections in the output file will match the order
|
||
|
in the first input file. The first section will be at address zero.
|
||
|
|
||
|
<ul class="menu">
|
||
|
<li><a accesskey="1" href="Output-Section-Description.html#Output-Section-Description">Output Section Description</a>: Output section description
|
||
|
<li><a accesskey="2" href="Output-Section-Name.html#Output-Section-Name">Output Section Name</a>: Output section name
|
||
|
<li><a accesskey="3" href="Output-Section-Address.html#Output-Section-Address">Output Section Address</a>: Output section address
|
||
|
<li><a accesskey="4" href="Input-Section.html#Input-Section">Input Section</a>: Input section description
|
||
|
<li><a accesskey="5" href="Output-Section-Data.html#Output-Section-Data">Output Section Data</a>: Output section data
|
||
|
<li><a accesskey="6" href="Output-Section-Keywords.html#Output-Section-Keywords">Output Section Keywords</a>: Output section keywords
|
||
|
<li><a accesskey="7" href="Output-Section-Discarding.html#Output-Section-Discarding">Output Section Discarding</a>: Output section discarding
|
||
|
<li><a accesskey="8" href="Output-Section-Attributes.html#Output-Section-Attributes">Output Section Attributes</a>: Output section attributes
|
||
|
<li><a accesskey="9" href="Overlay-Description.html#Overlay-Description">Overlay Description</a>: Overlay description
|
||
|
</ul>
|
||
|
|
||
|
</body></html>
|
||
|
|