[LLVMbugs] [Bug 2463] New: linking weak and alias fails
    bugzilla-daemon at cs.uiuc.edu 
    bugzilla-daemon at cs.uiuc.edu
       
    Sun Jun 15 18:40:35 PDT 2008
    
    
  
http://llvm.org/bugs/show_bug.cgi?id=2463
           Summary: linking weak and alias fails
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Linker
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: alenhar2 at uiuc.edu
                CC: llvmbugs at cs.uiuc.edu
linking an aliased symbol with the same name as a weak symbol fails.
llvm-ld -disable-inlining -r -o c.o  a.bc b.o
a.ll:
; ModuleID = '<stdin>'
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"
@sched_clock = alias i64 ()* @native_sched_clock                ; <i64 ()*>
[#uses=0]
define i64 @native_sched_clock() nounwind  {
entry:
        ret i64 0
}
b.ll:
; ModuleID = '<stdin>'
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"
define i64 @sched_clock_cpu(i32 inreg  %cpu) nounwind  {
entry:
        %tmp = call i64 @sched_clock( ) nounwind                ; <i64>
[#uses=2]
        ret i64 %tmp
}
define weak i64 @sched_clock() {
entry:
        ret i64 1
}
-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
    
    
More information about the llvm-bugs
mailing list