<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 - LLD doesn't support archive:file syntax in linker scripts"
   href="https://bugs.llvm.org/show_bug.cgi?id=44450">44450</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLD doesn't support archive:file syntax in linker scripts
          </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>john.brawn@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If you you have:

main.c
  extern int fn();
  int main() {
    return fn();
  }

example.c
  int fn() {
    return 0;
  }

script.ld
  SECTIONS
  {
    ALL 0x1000 : {
      main.o(*)
      lib.a:example.o(*)
    }
  }

And do:
  clang main.c example.c -c
  ar t lib.a
  rm example.o
  ld.lld -T script.ld main.o lib.a -M

Then the map that's output shows

             VMA              LMA     Size Align Out     In      Symbol
            1000             1000       56     4 ALL
            1000             1000       28     4         main.o:(.text)
            1000             1000        0     1                 $x.0
            1000             1000       28     1                 main
            1028             1028       2e     1         <internal>:(ALL)
            1058             1058        8     4 .text
            1058             1058        8     4        
lib.a(example.o):(.text)
            1058             1058        0     1                 $x.0
            1058             1058        8     1                 fn

The syntax of lib.a:example.o should select example.o inside of lib.a but this
isn't happening. *:example.o also doesn't work. GNU ld will also accept
*example.o (though I don't think this is documented anywhere) but this also
doesn't work with lld. What does work is *example.o* as lld treats the filename
as lib.a(example.o).</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>