bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/18173] New: Output Section LMA Alignment


From: sven.koehler at gmail dot com
Subject: [Bug ld/18173] New: Output Section LMA Alignment
Date: Sat, 28 Mar 2015 13:30:29 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=18173

            Bug ID: 18173
           Summary: Output Section LMA Alignment
           Product: binutils
           Version: 2.25
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: sven.koehler at gmail dot com

With a linker script, it is currently not possible to specify the alignment of
the LMA of an output section. Consider the following example:

.data : ALIGN(8) {
  ...
} >RAM AT>ROM

That will align the VMA of the section on a 8byte boundary, regardless of
alignment of the input sections (which could be less) but not the LMA.

Then we have ALIGN_WITH_INPUT, which cannot be combined with ALIGN(x). It will
align the VMA to the alignment of the input section (which may be less than 8)
and will increase the LMA by the same amount that the VMA was increased to
achieve the alignment. There are two problem:
(1) If the misalignment of VMA and LMA was different, we still end up with an
unaligned LMA.
(2) Even if VMA and LMA are equally misaligned, then there is no way to have a
minimum alignment of, as there is no way to combine ALIGN_WITH_INPUT with
ALIGN(8)

On some platforms however, such as ARM, it is somewhat important to have both
VMA and LMA aligned to a certain boundary to efficiently copy the section from
LMA to VMA. As shown above, ALIGN(x) and ALIGN_WITH_INPUT don't help.

What would help:
(1) If the misalignment of VMA and LMA could be assumed to be equal, then
ALIGN(x) in combination with ALIGN_WITH_INPUT would help.
But I have to say that the name of ALIGN_WITH_INPUT is a bit misleading, as
it's actually about keeping padding between VMA and LMA equal. Also, unlike
ALIGN(x), ALIGN_WITH_INPUT is actually about the LMA, not the VMA.

(2) Add something like ALIGNLMA(x) in addition to ALIGN(x), where the former is
about LMA alignment and the latter is about VMA alignment.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]