<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 does not implement INPUT_SECTION_FLAGS, but parses them as if it does"
   href="https://bugs.llvm.org/show_bug.cgi?id=44265">44265</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLD does not implement INPUT_SECTION_FLAGS, but parses them as if it does
          </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>peter.smith@linaro.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>LLD doesn't implement the INPUT_SECTION_FLAGS feature
(<a href="https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html">https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html</a>)
yet it seems to parse INPUT_SECTION_FLAGS as if it were a file name, hence
ignoring it.

Consider the following example:
SECTIONS {
  .foo : { INPUT_SECTION_FLAGS (SHF_WRITE) *(.foo) }
  .foo2 :  { INPUT_SECTION_FLAGS (!SHF_WRITE) *(.foo) }
}
with obj1.o containing:
        .section .foo, "wa", %progbits
        .global d1
d1:     
        .word 0
and obj2.o containing:
        .section .foo, "a", %progbits
        .global d2
d2:     
        .word 0

The INPUT_SECTION_FLAGS are supposed to constrain the match, so .foo from
obj1.o goes into OutputSection .foo, and .foo from obj2.o goes into
OutuptSection .foo2

This feature can be very useful to filter sections by flag when it is not known
what the names are. Until we support it we should fault INPUT_SECTION_FLAGS if
we see it as a filename in an InputSectionDescription.</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>