OSDN Git Service

[ThinLTO/gold] Enable symbol resolution in distributed backend case
authorTeresa Johnson <tejohnson@google.com>
Wed, 13 Jul 2016 16:35:56 +0000 (16:35 +0000)
committerTeresa Johnson <tejohnson@google.com>
Wed, 13 Jul 2016 16:35:56 +0000 (16:35 +0000)
While testing a follow-on change to enable index-based symbol resolution
and internalization in the distributed backends, I realized that a test
case change I made in r275247 was only required because we were not
analyzing symbols in the claimed files in thinlto-index-only mode.

In the fixed test case there should be no internalization because we are
linking in -shared mode, so f() is in fact exported, which is detected
properly when we analyze symbols in thinlto-index-only mode. Note that
this is not (yet) a correctness issue (because we are not yet performing
the index-based linkage optimizations in the distributed backends -
that's coming in a follow-on patch).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275277 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/gold/X86/thinlto.ll
tools/gold/gold-plugin.cpp

index 771dfa0..09bf21d 100644 (file)
@@ -62,8 +62,6 @@
 ; BACKEND1-NEXT: </MODULE_STRTAB_BLOCK
 ; BACKEND1-NEXT: <GLOBALVAL_SUMMARY_BLOCK
 ; BACKEND1-NEXT: <VERSION
-; One of these will be a COMBINED_ORIGINAL_NAME since f can be internalized.
-; BACKEND1-NEXT: <COMBINED
 ; BACKEND1-NEXT: <COMBINED
 ; BACKEND1-NEXT: <COMBINED
 ; BACKEND1-NEXT: </GLOBALVAL_SUMMARY_BLOCK
index 4fff5dc..dfe3d6f 100644 (file)
@@ -524,11 +524,6 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
     cf.name += ".llvm." + std::to_string(file->offset) + "." +
                sys::path::filename(Obj->getModule().getSourceFileName()).str();
 
-  // If we are doing ThinLTO compilation, don't need to process the symbols.
-  // Later we simply build a combined index file after all files are claimed.
-  if (options::thinlto && options::thinlto_index_only)
-    return LDPS_OK;
-
   for (auto &Sym : Obj->symbols()) {
     uint32_t Symflags = Sym.getFlags();
     if (shouldSkip(Symflags))