[llvm-bugs] [Bug 47853] New: Section will not fit if sections added in linker script are not increasingly ordered by vma or lma

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 15 02:38:35 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47853

            Bug ID: 47853
           Summary: Section will not fit if sections added in linker
                    script are not increasingly ordered by vma or lma
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: robert.dumitru at cyberthorstudios.com
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201015/5161f3d4/attachment.html>


More information about the llvm-bugs mailing list