⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sections.html

📁 gcc手册
💻 HTML
字号:
<html lang="en">

<head>

<title>Untitled</title>

<meta http-equiv="Content-Type" content="text/html">

<meta name="description" content="Untitled">

<meta name="generator" content="makeinfo 4.3">

<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">

</head>

<body>

<div class="node">

<p>

Node:<a name="SECTIONS">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">SECTIONS command</h3>



   <p>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%20Point">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%20Section%20Description">Output Section Description</a>: 	Output section description

<li><a accesskey="2" href="Output-Section-Name.html#Output%20Section%20Name">Output Section Name</a>: 		Output section name

<li><a accesskey="3" href="Output-Section-Address.html#Output%20Section%20Address">Output Section Address</a>: 	Output section address

<li><a accesskey="4" href="Input-Section.html#Input%20Section">Input Section</a>: 		Input section description

<li><a accesskey="5" href="Output-Section-Data.html#Output%20Section%20Data">Output Section Data</a>: 		Output section data

<li><a accesskey="6" href="Output-Section-Keywords.html#Output%20Section%20Keywords">Output Section Keywords</a>: 	Output section keywords

<li><a accesskey="7" href="Output-Section-Discarding.html#Output%20Section%20Discarding">Output Section Discarding</a>: 	Output section discarding

<li><a accesskey="8" href="Output-Section-Attributes.html#Output%20Section%20Attributes">Output Section Attributes</a>: 	Output section attributes

<li><a accesskey="9" href="Overlay-Description.html#Overlay%20Description">Overlay Description</a>: 		Overlay description

</ul>



   </body></html>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -