<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] forward reference"
   href="https://bugs.llvm.org/show_bug.cgi?id=38749">38749</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Linker script] forward reference
          </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>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </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>pshung807@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Can lld support forward reference to a section which is mentioned after?
At line 4, _text_start refers to .bss which is specified after and expected
value is 0x4000.
This feature is supported by bfd linker.


  1 # REQUIRES: x86
  2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
  3 # RUN: echo "SECTIONS {       \
  4 # RUN:  _text_start = LOADADDR(.bss);   \
  5 # RUN:  .text : { *(.text) }  \
  6 # RUN: . = 0x4000;     \
  7 # RUN:  .bss : { *(.bss) }  \
  8 # RUN: }" > %t.script
  9 # RUN: ld.lld -o %t1 --script %t.script %t
 10 # RUN: llvm-objdump -t %t1 | FileCheck %s
 11
 12 .text
 13 nop
 14 nop
 15 .section .bss, "aw",@nobits
 16  .quad 0
 17 # CHECK: 0000000000004000         *ABS*           00000000 _text_start</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>