[llvm-bugs] [Bug 44937] New: PHDRS command causes wrong section header off set and file size

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 17 04:45:24 PST 2020


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

            Bug ID: 44937
           Summary: PHDRS command causes wrong section header off set and
                    file size
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: lgamma at 163.com
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com

When lld use this linker script, the size of the output file and the section
headers are affected by the ``ORIGIN`` attribute from ``RAM`` .

simple linker script:
PHDRS {Foo PT_LOAD;}
MEMORY
{
  FLASH (rx)  : ORIGIN = 0x00000000, LENGTH = 2
  RAM   (rwx) : ORIGIN = 0x10000000, LENGTH = 2 /*output file is 256MB*/
}
SECTIONS
{
  .text :{} > FLASH
  .data :{} > RAM :Foo
}

simple asm source:
.global _start

-- 
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/20200217/e2228ca0/attachment.html>


More information about the llvm-bugs mailing list