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

            Bug ID: 26152
           Summary: Linker wronlgy renames an external function
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Linker
          Assignee: unassignedb...@nondot.org
          Reporter: eugeni.stepa...@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

I'm linking 2 modules, where the first calls an external function A(), and the
second defines A() and also an alias for it.

The resulting module does not export A(). Instead it exports A.1().

The behavior depends on the order of modules in the link command line.

$ cat 1.ll
define void @B() {
  call void @A()
  ret void
}

declare void @A()

$ cat 2.ll
@C = alias void (), void ()* @A

define void @D() {
  call void @C()
  ret void
}

define void @A() {
  ret void
}

$ llvm-link 1.ll 2.ll -S -o - 
; ModuleID = 'llvm-link'

@C = alias void (), void ()* @A.1

define void @B() {
  call void @A.1()
  ret void
}

define void @D() {
  call void @C()
  ret void
}

define void @A.1() {
  ret void
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to