From 9127334dade7fa36cb5cb999fc116ceaa4f52ac9 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 4 Sep 2013 15:33:34 +0000 Subject: Error on linking appending globals with different unnamed_addr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189950 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Linker/LinkModules.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Linker') diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 16e2851..4fffa55 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -704,7 +704,11 @@ bool ModuleLinker::linkAppendingVarProto(GlobalVariable *DstGV, if (DstGV->getVisibility() != SrcGV->getVisibility()) return emitError( "Appending variables with different visibility need to be linked!"); - + + if (DstGV->hasUnnamedAddr() != SrcGV->hasUnnamedAddr()) + return emitError( + "Appending variables with different unnamed_addr need to be linked!"); + if (DstGV->getSection() != SrcGV->getSection()) return emitError( "Appending variables with different section name need to be linked!"); -- cgit v1.1