[llvm-bugs] [Bug 32537] New: Linker Script: sections with no inputs should not be SHT_NOBITS

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 5 09:19:03 PDT 2017


http://bugs.llvm.org/show_bug.cgi?id=32537

            Bug ID: 32537
           Summary: Linker Script: sections with no inputs should not be
                    SHT_NOBITS
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: jh7370.2008 at my.bristol.ac.uk
                CC: llvm-bugs at lists.llvm.org

If a linker script defines a section which uses the BYTE() or similar command,
or assigns to ".", LLD assigns it a type of SHT_NOBITS. This is incorrect,
because the section actually contains data, and takes up space in the file.

Example script:
SECTIONS {
    .section : { FILL(0x22222222); . += 4; BYTE(0x11); . += 4; }
}

The section contents are written to disk as:
222222221122222222

but llvm-objdump skips the section because of its type and I would expect the
loader to ignore the contents when loading the file.

The type should probably be SHT_PROGBITS by default.

-- 
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/20170405/1c09bc57/attachment.html>


More information about the llvm-bugs mailing list