Skip to content
  1. Jun 12, 2015
  2. Jun 11, 2015
    • Peter Collingbourne's avatar
      COFF: Symbol resolution for common and comdat symbols defined in bitcode. · 1b6fd1f5
      Peter Collingbourne authored
      In the case where either a bitcode file and a regular file or two bitcode
      files export a common or comdat symbol with the same name, the linker needs
      to pick one of them following COFF semantics. This patch implements a design
      for resolving such symbols that pushes most of the work onto either LLD's
      regular mechanism for resolving common or comdat symbols or the IR linker's
      mechanism for doing the same.
      
      We modify SymbolBody::compare to always prefer non-bitcode symbols, so that
      during the initial phase of symbol resolution, the symbol table always contains
      a regular symbol in any case where we need to choose between a regular and
      a bitcode symbol. In SymbolTable::addCombinedLTOObject, we force export
      any bitcode symbols that were initially pre-empted by a regular symbol,
      and later use SymbolBody::compare to choose between the regular symbol in
      the symbol table and the regular symbol from the combined LTO object file.
      
      This design seems to be sound, so long as the resolution mechanism is defined
      to be commutative and associative modulo arbitrary choices between symbols
      (which seems to be the case for COFF).
      
      Differential Revision: http://reviews.llvm.org/D10329
      
      llvm-svn: 239563
      1b6fd1f5
    • Marshall Clow's avatar
      767c4571
    • Lang Hames's avatar
      [Orc] Make partition identification in the CompileOnDemand layer lazy. · 6a14edd9
      Lang Hames authored
      This also breaks out the logical dylib symbol resolution logic.
      
      llvm-svn: 239561
      6a14edd9
    • Peter Collingbourne's avatar
      Object: Prepend __imp_ when mangling a dllimport symbol in IRObjectFile. · 82e657b5
      Peter Collingbourne authored
      We cannot prepend __imp_ in the IR mangler because a function reference may
      be emitted unmangled in a constant initializer. The linker is expected to
      resolve such references to thunks. This is covered by the new test case.
      
      Strictly speaking we ought to emit two undefined symbols, one with __imp_ and
      one without, as we cannot know which symbol the final object file will refer
      to. However, this would require rather intrusive changes to IRObjectFile,
      and lld works fine without it for now.
      
      This reimplements r239437, which was reverted in r239502.
      
      Differential Revision: http://reviews.llvm.org/D10400
      
      llvm-svn: 239560
      82e657b5
Loading