From 5d618ef7f1ad005fc6912f3e9a08c044b082e47f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 14 Feb 2011 22:23:49 +0000 Subject: Switch llvm to using comdats. For now always use groups with a single section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125526 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/gold/gold-plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/gold/gold-plugin.cpp') diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index 257c766345..01816aeafc 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -339,6 +339,7 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file, } int definition = attrs & LTO_SYMBOL_DEFINITION_MASK; + sym.comdat_key = NULL; switch (definition) { case LTO_SYMBOL_DEFINITION_REGULAR: sym.def = LDPK_DEF; @@ -350,6 +351,7 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file, sym.def = LDPK_COMMON; break; case LTO_SYMBOL_DEFINITION_WEAK: + sym.comdat_key = sym.name; sym.def = LDPK_WEAKDEF; break; case LTO_SYMBOL_DEFINITION_WEAKUNDEF: @@ -360,9 +362,7 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file, return LDPS_ERR; } - // LLVM never emits COMDAT. sym.size = 0; - sym.comdat_key = NULL; sym.resolution = LDPR_UNKNOWN; } -- cgit v1.2.3