<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 - error during fuzzer linking: .text.sancov.module_ctor referenced in section defined in discarded section"
   href="https://bugs.llvm.org/show_bug.cgi?id=36653">36653</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>error during fuzzer linking: .text.sancov.module_ctor referenced in section defined in discarded section
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </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>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>compiler-rt
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>pdknsk@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ clang -v
clang version 7.0.0 (trunk 327009) (llvm/trunk 327036)

I'm getting many of these, which causes linking to fail.

`.text.sancov.module_ctor.14' referenced in section
`.init_array.2[sancov.module_ctor.14]' of
./.libs/libexample_util.a(example_util.o): defined in discarded section
`.text.sancov.module_ctor.14[sancov.module_ctor]' of
./.libs/libexample_util.a(example_util.o)

Now this is on Ubuntu 14.04 LTS with fairly old binutils.

$ ld -v
GNU ld (GNU Binutils for Ubuntu) 2.24

Updating to binutils of the latest LTS (16.04) doesn't work either, same error.

$ ld -v
GNU gold (GNU Binutils for Ubuntu 2.26.1) 1.11

Only an update to the latest version of the first non-LTS release (17.01) turns
the errors into warnings.

./.libs/libexample_util.a(example_util.o)(.init_array.2+0x0): warning:
relocation refers to discarded section

$ ld -v
GNU gold (GNU Binutils for Ubuntu 2.29.1) 1.14

I don't know what the policy is, but unless binutils isn't supported any more,
I think this classifies as a bug.

PS. lld works of course.</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>