Skip to content
  1. May 03, 2017
    • Rui Ueyama's avatar
      Accept archive files with no symbol table instad of warning on them. · fd7deda5
      Rui Ueyama authored
      It seems virtually everyone who tries to do LTO build with Clang and
      LLD was hit by a mistake to forget using llvm-ar command to create
      archive files. I wasn't an exception. Since this is an annoying common
      issue, it is probably better to handle that gracefully rather than
      reporting an error and tell the user to redo build with different
      configuration.
      
      Differential Revision: https://reviews.llvm.org/D32721
      
      llvm-svn: 302083
      fd7deda5
    • Peter Collingbourne's avatar
      Revert r301897, "ELF: Set symbol binding to STB_GLOBAL when undefining symbols during LTO." · 1c697e99
      Peter Collingbourne authored
      It doesn't matter what binding we store in a non-UsedInRegularObj undefined
      symbol because we should reset it when we see a real undefined symbol in
      a combined LTO object. The fact that we weren't doing so before is a bug
      (PR32899) which is now fixed.
      
      llvm-svn: 302067
      1c697e99
    • Rafael Espindola's avatar
      Handle mixed strong and weak undefined symbols. · 5e20c75e
      Rafael Espindola authored
      We were ignoring strong undefined symbols if they followed weak ones.
      
      Fixes pr32899.
      
      llvm-svn: 302065
      5e20c75e
    • Peter Smith's avatar
      [ELF] Fix problems with fabricateDefaultCommands() and --section-start · c60b4510
      Peter Smith authored
      The --section-start <name>=<address> needs to be translated into equivalent
      linker script commands. There are a couple of problems with the existing
      implementation:
      - The --section-start with the lowest address is assumed to be at the start
      of the map. This assumption is incorrect, we have to iterate through the
      SectionStartMap to find the lowest address.
      - The addresses in --section-start were being over-aligned when the
      sections were marked as PageAlign. This is inconsistent with the use of
      SectionStartMap in fixHeaders(), and can cause problems when the PageAlign
      causes an "unable to move location counter backward" error when the
      --section-start with PageAlign is aligned to an address higher than the next
      --section-start. The ld.bfd and ld.gold seem to be more consistent with this
      approach but this is not a well specified area.
          
      This change fixes the problems above and also corrects a typo in which
      fabricateDefaultCommands() is called with the wrong parameter, it should be
      called with AllocateHeader not Config->MaxPageSize.
      
      Differential Revision: https://reviews.llvm.org/D32749
      
      llvm-svn: 302007
      c60b4510
    • George Rimar's avatar
      [ELF] - Added testcase gdb-index-ranges.s (https://reviews.llvm.org/D32750) · 99e1890e
      George Rimar authored
      Before rL301170 was landed, LLD did not produce correct entries in .gdb_index address area.
      Issue was fixed on LLVM DWARF parsers side and was relative to how .debug_ranges
      section was scanned. It was main problem of PR32319.
      
      It makes sense to have testcase on LLD size too. This checks that we generate proper values 
      now, because we do not have any tests for .gdb_index which works with .debug_ranges atm.
      
      Differential revision: https://reviews.llvm.org/D32750
      
      llvm-svn: 302006
      99e1890e
    • Rui Ueyama's avatar
      Remove a dead function declaration. · 9decbfee
      Rui Ueyama authored
      llvm-svn: 301982
      9decbfee
    • Joel Jones's avatar
      Remove _NC suffix from ELF relocations TLSDESC_{LD64,ADD}_LO12 · 93340741
      Joel Jones authored
      llvm-svn: 301979
      93340741
  2. May 02, 2017
  3. May 01, 2017
  4. Apr 30, 2017
  5. Apr 29, 2017
  6. Apr 28, 2017
    • Hans Wennborg's avatar
      Flush output in log() · ca31b9f8
      Hans Wennborg authored
      This change was motivated by output from lld-link.exe and link.exe
      getting intermixed. There's already a flush() call in message(), so
      there's precedence.
      
      llvm-svn: 301693
      ca31b9f8
    • Rafael Espindola's avatar
      Rename one of the variables to avoid confusion. · a7a945a1
      Rafael Espindola authored
      llvm-svn: 301691
      a7a945a1
    • Rui Ueyama's avatar
      Change the format of the map file. · 3012b371
      Rui Ueyama authored
      Previously, we printed out input sections and input files in
      separate columns as shown below.
      
        Address          Size             Align Out     In      File    Symbol
        0000000000201000 0000000000000015     4 .text
        0000000000201000 000000000000000e     4         .text
        0000000000201000 000000000000000e     4                 foo.o
        0000000000201000 0000000000000000     0                         _start
        0000000000201005 0000000000000000     0                         f(int)
        000000000020100e 0000000000000000     0                         local
        0000000000201010 0000000000000002     4                 bar.o
        0000000000201010 0000000000000000     0                         foo
        0000000000201011 0000000000000000     0                         bar
      
      This format doesn't make much sense because for each input section,
      there's always exactly one input file. This patch changes the format
      to this.
      
        Address          Size             Align Out     In      Symbol
        0000000000201000 0000000000000015     4 .text
        0000000000201000 000000000000000e     4         foo.o:(.text)
        0000000000201000 0000000000000000     0                 _start
        0000000000201005 0000000000000000     0                 f(int)
        000000000020100e 0000000000000000     0                 local
        0000000000201010 0000000000000002     4         bar.o:(.text)
        0000000000201010 0000000000000000     0                 foo
        0000000000201011 0000000000000000     0                 bar
      
      Differential Revision: https://reviews.llvm.org/D32657
      
      llvm-svn: 301683
      3012b371
    • Rafael Espindola's avatar
      Remove LinkerScript::flush. · b3bc1ed0
      Rafael Espindola authored
      This patch replaces flush with a last ditch attempt at synchronizing
      the section list with the linker script "AST".
      
      The synchronization is a bit of a hack and should in time be avoided
      by creating the AST earlier so that modifications can be made directly
      to it instead of modifying the section list and synchronizing it back.
      
      This is the main step for fixing
      https://bugs.llvm.org/show_bug.cgi?id=32816. With this in place I
      think the only missing thing would be to have processCommands assign
      section indexes as dummy offsets so that the sort in
      OutputSection::finalize works.
      
      With this LinkerScript::assignAddresses becomes much simpler, which
      should help with the thunk work.
      
      llvm-svn: 301678
      b3bc1ed0
    • Rui Ueyama's avatar
      Use toString(Inputfile*) to format a file object. · 8a3ef95f
      Rui Ueyama authored
      llvm-svn: 301674
      8a3ef95f
    • Rui Ueyama's avatar
      Remove trailing whitespace from the -Map output. · 72408fb2
      Rui Ueyama authored
      If a string is shorter than 7 characters, we used to print out
      trailing whitespace characters.
      
      llvm-svn: 301668
      72408fb2
    • Rui Ueyama's avatar
      Remove a redundant local variable. · 2634d0ff
      Rui Ueyama authored
      llvm-svn: 301661
      2634d0ff
    • Rui Ueyama's avatar
      Speed up the -Map option. · b882e591
      Rui Ueyama authored
      We found that some part of code for the -Map option takes O(m*n)
      where m is the number of input sections in some file and n is
      the number of symbols in the same file. If you do LTO, we usually
      have only a few object files as inputs for the -Map option
      feature, so this performance characteristic was worse than I
      expected.
      
      This patch rewrites the -Map option feature to speed it up.
      I eliminated the O(m*n) bottleneck and also used multi-threading.
      
      As a result, clang link time with the -Map option improved from
      18.7 seconds to 11.2 seconds. Without -Map, it takes 7.7 seconds,
      so the -Map option is now about 3x faster than before for this
      test case (from 11.0 seconds to 3.5 seconds.) The generated output
      file size was 223 MiB, and the file contains 1.2M lines.
      
      Differential Revision: https://reviews.llvm.org/D32631
      
      llvm-svn: 301659
      b882e591
    • Saleem Abdulrasool's avatar
      COFF: actually synthesize CONST imports properly · 5c98b745
      Saleem Abdulrasool authored
      CONSTANT imports expect both the `_imp_` prefixed and non-prefixed
      symbols should be added to the symbol table.  This allows for linking
      symbols like _NSConcreteGlobalBlock in WinObjC.  The previous change
      would generate the import library properly by handling the option but
      would not consume the generated entry properly.
      
      llvm-svn: 301657
      5c98b745
    • Rui Ueyama's avatar
      COFF ICF: Merge only functions. Do not merge read-only data. · a85572eb
      Rui Ueyama authored
      This seems to be the behavior of the MSVC linker. Previously, this
      incompatibility caused nasty issues in chromium build a few times.
      
      Differential Revision: https://reviews.llvm.org/D30363
      
      llvm-svn: 301598
      a85572eb
Loading