<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Load address range overlap reported when ALIGN is used with LMA and VMA regions"
   href="https://bugs.llvm.org/show_bug.cgi?id=52510">52510</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Load address range overlap reported when ALIGN is used with LMA and VMA regions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>ELF
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>konstantin.schwarz@hightec-rt.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In the example shown below, the following error is reported:

ld.lld: error: section .data3 load address range overlaps with .data
<span class="quote">>>> .data3 range is [0x8000005, 0x800000C]
>>> .data range is [0x8000008, 0x800000B]</span >


linkerscript:
```
MEMORY
{
    CODE (rx) : ORIGIN = 0x08000000, LENGTH = 512K
    DATA (rw) : ORIGIN = 0x20000400, LENGTH = 95K
}

SECTIONS
{
    .text :
    {
        *(.text)
    } > CODE

    .data : ALIGN(8)
    {
        . += 4;
    } > DATA AT> CODE

    /* This section is needed to get a new program header created for .data3 */
    .data2 :
    {
        . += 8;
    } > DATA

    .data3 :
    {
        . += 8;
    } > DATA AT> CODE
}
```

source file:
```
.text
.globl _start
_start:
    nop
```

Looking at the ELF that we get when using `--no-check-sections`, we find the
following program headers:

```
Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  LOAD           0x0000000000001000 0x0000000008000000 0x0000000008000000
                 0x0000000000000001 0x0000000000000001  R E    0x1000
  LOAD           0x0000000000001400 0x0000000020000400 0x0000000008000008
                 0x0000000000000004 0x0000000000000004  R E    0x1000
  LOAD           0x0000000000001404 0x0000000020000404 0x0000000020000404
                 0x0000000000000008 0x0000000000000008  R E    0x1000
  LOAD           0x000000000000140c 0x000000002000040c 0x0000000008000005
                 0x0000000000000008 0x0000000000000008  R E    0x1000
```
, indicating that .data3 is not aware of the alignment requirement of .data</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>