aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Linker
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-09-04 15:33:34 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-09-04 15:33:34 +0000
commit9127334dade7fa36cb5cb999fc116ceaa4f52ac9 (patch)
tree5bde247814483e267c07c6605c5f2f594b9e0e79 /lib/Linker
parentbf34f346420dbcdb3f9376967bde701682471a79 (diff)
downloadexternal_llvm-9127334dade7fa36cb5cb999fc116ceaa4f52ac9.zip
external_llvm-9127334dade7fa36cb5cb999fc116ceaa4f52ac9.tar.gz
external_llvm-9127334dade7fa36cb5cb999fc116ceaa4f52ac9.tar.bz2
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
Diffstat (limited to 'lib/Linker')
-rw-r--r--lib/Linker/LinkModules.cpp6
1 files changed, 5 insertions, 1 deletions
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!");