<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 - /DISCARD/ section followed with a section with fill expression will cause link failure for newer version"
   href="https://bugs.llvm.org/show_bug.cgi?id=44903">44903</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>/DISCARD/ section followed with a section with fill expression will cause link failure for newer version
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>yadong.qi@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When use newer version(>=9) of ld.lld, there will be link issue as below:
    ld.lld: error: linker.lds:14: malformed number: :
    >>>   /DISCARD/ :
    >>>

link script:
OUTPUT_FORMAT("elf64-x86-64","elf64-x86-64","elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)

ENTRY(main);

SECTIONS
{
  . = 0x10000;
  .text : { *(.text) }
  . = 0x8000000;
  .data : { *(.data) }
  .bss : { *(.bss) } =0x90909090

  /DISCARD/ :
  {
    *(.eh_frame)
  }
}

I have 2 ways to bypass the link issue:
  1. remove the fill expression " =0x90909090";
  2. add a section command before /DISCARD/, e.g.: ". = .;"

This issue only happens on newer version(>=9) of ld.lld, did not meet such
issue for old version.</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>