<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Section will not fit if sections added in linker script are not increasingly ordered by vma or lma"
href="https://bugs.llvm.org/show_bug.cgi?id=47853">47853</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Section will not fit if sections added in linker script are not increasingly ordered by vma or lma
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>robert.dumitru@cyberthorstudios.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
</td>
</tr></table>
<p>
<div>
<pre>Hi,
The following happens:
error: section '.Section Name' will not fit in region 'Memory Region Name':
overflowed by <n> bytes
When using lld with a linker script where sections that have load or virtual
memory address specified and are not in ascending order of the load memory
address inside the linker script.
The RAM ends at 0xfff00 as specified in the memory region. When it checks if
the size of RAM is not exceeded, the current position will start at 0xFFEDC so,
0xFFEDC + 0xa +0x1e = 0xfff04 for the code bellow.
If section1 size is 0xa and size of section2 is 0x1e The error message will be
that RAM was overflowed by 4 bytes.
Example:
MEMORY
{
RAM : ORIGIN = 0xF3F00, LENGTH = 49152
}
SECTIONS
{
.stack 0xFFEDC (NOLOAD) : AT(0xFFEDC)
{
_stack = .;
} > RAM
.section1 0xffd00 : AT(0xffd00)
{
KEEP(*(.section1))
} >RAM
.section2 0xffd40 : AT(0xffd40)
{
KEEP(*(.section2))
} >RAM
}
While specifying the sections in increasing order by lma works fine.
This happens with lld 10.0.0.
Apologies if this is a duplicate or you do not consider it a bug, but I did not
find a reference to this.
Best regards,
Robert</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>