Index: lib/MC/MCParser/ELFAsmParser.cpp =================================================================== --- lib/MC/MCParser/ELFAsmParser.cpp +++ lib/MC/MCParser/ELFAsmParser.cpp @@ -743,6 +743,9 @@ const MCExpr *Value = MCSymbolRefExpr::create(Sym, getContext()); getStreamer().EmitAssignment(Alias, Value); + // The alias name is global since it needs to be externally available + // for the linker. + getStreamer().EmitSymbolAttribute(Alias, MCSA_Global); return false; } Index: test/LTO/X86/symver-asm.ll =================================================================== --- test/LTO/X86/symver-asm.ll +++ test/LTO/X86/symver-asm.ll @@ -1,7 +1,10 @@ ; RUN: llvm-as < %s >%t1 ; RUN: llvm-lto -o %t2 %t1 ; RUN: llvm-nm %t2 | FileCheck %s +; RUN: llvm-lto2 -r %t1,io_cancel_0_4,plx -r %t1,io_cancel_0_4,plx -r %t1,io_cancel@@LIBAIO_0.4,plx -o %t3 %t1 +; RUN: llvm-nm %t3.0 | FileCheck %s +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" module asm ".symver io_cancel_0_4,io_cancel@@LIBAIO_0.4"