<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 - The lld cannot identify LMA overlapping when the VMA is not specified."
   href="https://bugs.llvm.org/show_bug.cgi?id=46263">46263</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>The lld cannot identify LMA overlapping when the VMA is not specified.
          </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>Windows NT
          </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>2077213809@qq.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I used the latest lld and one of the versions of lld and found that the latest
version had a problem.

MEMORY  {
  DDR : o = 0xfb00000, l = 185M
  TCM : o = 0x1F400000, l = 128K
}

SECTIONS {
  .text 0xfb00000 : {
    * (.text);
    _etext = .;
   } > DDR
  .mdata : AT(LOADADDR(.text) + SIZEOF(.text)) {
    _data = .;
    *(.data);
    _edata = .;
  } > TCM
  .bss : { // This is not reasonable because the LMA of .bss overlaps that of
.mdata.
    _bstart = .;
    *(.bss) * (COMMON);
    _bend = .;
  } > DDR
  .ARM.exidx : {
    *(.ARM.exidx);
  } > DDR
}

// The latest linker. from <a href="https://github.com/llvm/llvm-project">https://github.com/llvm/llvm-project</a> Source code
compilation

ld.lld -T my.ld test.o
objdump -hw a.out

## the .bss LMA is a Strange numbers.

Idx Name          Size      VMA       LMA       File off  Algn  Flags
  0 .text         00000008  0fb00000  0fb00000  00001000  2**2  CONTENTS,
ALLOC, LOAD, READONLY, CODE
  1 .mdata        00000004  1f400000  0fb00008  00002000  2**2  CONTENTS,
ALLOC, LOAD, DATA
  2 .bss          00000008  0fb00008  00200010  00002004  2**2  ALLOC
  3 .ARM.exidx    00000010  0fb00010  00200018  00002010  2**2  CONTENTS,
ALLOC, LOAD, READONLY, DATA
  4 .<a href="show_bug.cgi?id=46263#c000000">comment      000000</a>bc  00000000  00000000  00002020  2**0  CONTENTS,
READONLY
  5 .ARM.attributes 0000003e  00000000  00000000  000020dc  2**0  CONTENTS,
READONLY

// one of version lld. The overlap can be identified.
//./ld.lld -v
//LLD 11.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
07d68c24aa19483e44db4336b0935b00a5d69949) (compatible with GNU linkers)

ld.lld -T gcc.ld test.o
ld.lld: warning: lld uses blx instruction, no object with architecture
supporting feature detected
ld.lld: error: section .mdata load address range overlaps with .bss
<span class="quote">>>> .mdata range is [0xFB00008, 0xFB0000B]
>>> .bss range is [0xFB00008, 0xFB0000F]</span ></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>