[llvm-bugs] [Bug 35708] New: llvm-objcopy adds incorrect padding between sections

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 20 11:49:02 PST 2017


            Bug ID: 35708
           Summary: llvm-objcopy adds incorrect padding between sections
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm at owenpshaw.net
                CC: llvm-bugs at lists.llvm.org

Created attachment 19582
  --> https://bugs.llvm.org/attachment.cgi?id=19582&action=edit
Align segment using physical instead of virtual address

On a bare metal ARM project, llvm-objcopy creates a binary file that has a lot
of extra zero padding before the .data section.  GNU objcopy does not add this

It appears to be related to the LayoutSegments function and its use of
alignToAddr.  The alignment is based off the segment's virtual address, which
in my .data case is different from its physical address.

Changing LayoutSegments to align using the physical address works like a charm
(see attached patch).

Does anyone agree/disagree that using the physical address correct?  It doesn't
break any tests, but none of the tests used different virtual and physical

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/20171220/6b71074e/attachment.html>

More information about the llvm-bugs mailing list