[LLVMbugs] [Bug 23501] New: LLVM IR should be able to represent definitions of interposable functions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 12 11:51:48 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23501

            Bug ID: 23501
           Summary: LLVM IR should be able to represent definitions of
                    interposable functions
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
          Assignee: unassignedbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvmbugs at cs.uiuc.edu, mseaborn at chromium.org,
                    rafael.espindola at gmail.com
    Classification: Unclassified

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.
http://hubicka.blogspot.com/2015/04/GCC5-IPA-LTO-news.html

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().

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150512/5369894e/attachment.html>


More information about the llvm-bugs mailing list