<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 - linker script parser rejects INFO output section type when used with a start address"
   href="https://bugs.llvm.org/show_bug.cgi?id=38625">38625</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>linker script parser rejects INFO output section type when used with a start address
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>djc@djc.id.au
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Lld supports INFO as an output section type, similar to NOLOAD. See:
<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - LLD does not support following output section types in script: DSECT, COPY, INFO, OVERLAY"
   href="show_bug.cgi?id=36298">https://bugs.llvm.org/show_bug.cgi?id=36298</a>
<a href="https://sourceware.org/binutils/docs/ld/Output-Section-Type.html#Output-Section-Type">https://sourceware.org/binutils/docs/ld/Output-Section-Type.html#Output-Section-Type</a>

However it only accepts the (INFO) type when no start address is present. That
is, it rejects this:

  .stack _edata (INFO) :
  {

with this error:

lld: error: link.x:32: NOLOAD expected, but got INFO
<span class="quote">>>>   .stack _edata (INFO) :
>>>                  ^</span >

whereas it accepts the same without a specific start address:

  .stack (INFO) :
  {

Here is a more complete and somewhat realistic reproducer:

$ cat test.c 
void _start(void) {
}
$ gcc -nostdlib -nostartfiles -c test.c
$ cat link.x
MEMORY
{
  FLASH : ORIGIN = 0x20400000, LENGTH = 512M
  RAM : ORIGIN = 0x80000000, LENGTH = 16K
}
SECTIONS
{
  .text :
  {
    *(.text);
  } > FLASH

  .rodata :
  {
    *(.rodata);
  } > FLASH

  .bss :
  {
    *(.bss);
  } > RAM

  .data : AT(LOADADDR(.rodata) + SIZEOF(.rodata))
  {
    _sdata = .;
    *(.data);
    . = ALIGN(4);
    _edata = .;
  } > RAM

  PROVIDE(_stack_start = ORIGIN(RAM) + LENGTH(RAM));
  .stack _edata (INFO) :
  {
    _estack = .;
    . = _stack_start;
    _sstack = .;
  } > RAM

  /DISCARD/ :
  {
    *(.eh_frame);
  }
}
$ lld -flavor gnu -Tlink.x -o test test.o
lld: error: link.x:32: NOLOAD expected, but got INFO
<span class="quote">>>>   .stack _edata (INFO) :
>>>                  ^</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>