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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to