<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - LLVM IR should be able to represent definitions of interposable functions"
   href="https://llvm.org/bugs/show_bug.cgi?id=23501">23501</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM IR should be able to represent definitions of interposable functions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>Core LLVM classes
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rnk@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu, mseaborn@chromium.org, rafael.espindola@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>ELF allows users to interpose function definitions in shared libraries, and C's
version of the ODR permits this. While this functionality isn't often used, we
should have some way of representing a function definition with external
linkage (it's not ELF weak) but may be overridden at runtime.

We probably don't want to enable interposability for all external C function
definitions by default in Clang, but once we have LLVM support this we can add
an attribute or flag get at this.

A GCC developer claimed this was an LLVM bug in the blog post below, but I
think the LLVM consensus is that this is working as intended. We just need an
escape hatch to complete the picture and reduce this to a difference in default
behaviors.
<a href="http://hubicka.blogspot.com/2015/04/GCC5-IPA-LTO-news.html">http://hubicka.blogspot.com/2015/04/GCC5-IPA-LTO-news.html</a>

Anyway, I would probably add a new linkage type, like external_interposable or
external_nonodr, and add it to the appropriate GlobalValue linkage predicates,
like mayBeOverridden().</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>