Skip to content
  1. Jan 09, 2017
  2. Jan 06, 2017
  3. Dec 23, 2016
  4. Dec 08, 2016
    • Rafael Espindola's avatar
      Change the implementation of --dynamic-list to use linker script parsing. · d0ebd84c
      Rafael Espindola authored
      The feature is documented as
      -----------------------------
      The format of the dynamic list is the same as the version node
      without scope and node name.  See *note VERSION:: for more
      information.
      --------------------------------
      
      And indeed qt uses a dynamic list with an 'extern "C++"' in it. With
      this patch we support that
      
      The change to gc-sections-shared makes us match bfd. Just because we
      kept bar doesn't mean it has to be in the dynamic symbol table.
      
      The changes to invalid-dynamic-list.test and reproduce.s are because
      of the new parser.
      
      The changes to version-script.s are the only case where we change
      behavior with regards to bfd, but I would like to see a mix of
      --version-script and --dynamic-list used in the wild before
      complicating the code.
      
      llvm-svn: 289082
      d0ebd84c
  5. Nov 20, 2016
  6. Nov 19, 2016
  7. Nov 11, 2016
  8. Oct 28, 2016
    • Rui Ueyama's avatar
      Consolidate BumpPtrAllocators. · 55518e7d
      Rui Ueyama authored
      Previously, we have a lot of BumpPtrAllocators, but all these
      allocators virtually have the same lifetime because they are
      not freed until the linker finishes its job. This patch aggregates
      them into a single allocator.
      
      Differential revision: https://reviews.llvm.org/D26042
      
      llvm-svn: 285452
      55518e7d
  9. Oct 26, 2016
    • Rafael Espindola's avatar
      Call _exit. · cb09daab
      Rafael Espindola authored
      As the state of lld gets more complicated, shutting down gets more
      expensive.
      
      In a normal lld run we can just call _exit immediately after renaming
      the temporary output file. We still want the ability to run a full
      shutdown since that is useful for detecting memory leaks.
      
      This patch adds a --full-shutdown flag and changes lit to use it.
      
      llvm-svn: 285224
      cb09daab
    • Rui Ueyama's avatar
      Rename variable to be more consistent. · c773c9f4
      Rui Ueyama authored
      llvm-svn: 285164
      c773c9f4
  10. Oct 20, 2016
  11. Oct 19, 2016
  12. Sep 29, 2016
  13. Sep 14, 2016
    • Rui Ueyama's avatar
      Simplify InputFile ownership management. · 38dbd3ee
      Rui Ueyama authored
      Previously, all input files were owned by the symbol table.
      Files were created at various places, such as the Driver, the lazy
      symbols, or the bitcode compiler, and the ownership of new files
      was transferred to the symbol table using std::unique_ptr.
      All input files were then free'd when the symbol table is freed
      which is on program exit.
      
      I think we don't have to transfer ownership just to free all
      instance at once on exit.
      
      In this patch, all instances are automatically collected to a
      vector and freed on exit. In this way, we no longer have to
      use std::unique_ptr.
      
      Differential Revision: https://reviews.llvm.org/D24493
      
      llvm-svn: 281425
      38dbd3ee
  14. Sep 10, 2016
  15. Jul 26, 2016
    • Peter Collingbourne's avatar
      COFF: Implement /linkrepro flag. · feee2103
      Peter Collingbourne authored
      This flag is implemented similarly to --reproduce in the ELF linker.
      
      This patch implements /linkrepro by moving the cpio writer and associated
      utility functions to lldCore, and using that implementation in both linkers.
      
      One COFF-specific detail is that we store the object file from which the
      resource files were created in our reproducer, rather than the resource
      files themselves. This allows the reproducer to be used on non-Windows
      systems for example.
      
      Differential Revision: https://reviews.llvm.org/D22418
      
      llvm-svn: 276719
      feee2103
  16. Jun 06, 2016
  17. May 15, 2016
  18. May 13, 2016
    • Rui Ueyama's avatar
      Support --build-id=0x<hexstring>. · 9194db78
      Rui Ueyama authored
      If you specify the option in the form of --build-id=0x<hexstring>,
      that hexstring is set as a build ID. We observed that the feature
      is actually in use in some builds, so we want this feature.
      
      llvm-svn: 269495
      9194db78
  19. May 03, 2016
    • Rafael Espindola's avatar
      Produce cpio files for --reproduce. · 1dd2b3d1
      Rafael Espindola authored
      We want --reproduce to
      
      * not rewrite scripts and thin archives
      * work with absolute paths
      
      Given that, it pretty much has to create a full directory tree. On windows that
      is problematic because of the very short maximum path limit. On most cases
      users can still work around it with "--repro c:\r", but that is annoying and
      not viable for automated testing.
      
      We then need to produce some form of archive with the files. The first option
      that comes to mind is .a files since we already have code for writing them.
      There are a few problems with them
      
      The format has a dedicated string table, so we cannot start writing it until
      all members are known.
      Regular implementations don't support creating directories. We could make
      llvm-ar support that, but that is probably not a good idea.
      The next natural option would be tar. The problem is that to support long path
      names (which is how this started) it needs a "pax extended header" making this
      an annoying format to write.
      
      The next option I looked at seems a natural fit: cpio files.
      
      They are available on pretty much every unix, support directories and long path
      names and are really easy to write. The only slightly annoying part is a
      terminator, but at least gnu cpio only prints a warning if it is missing, which
      is handy for crashes. This patch still makes an effort to always create it.
      
      llvm-svn: 268404
      1dd2b3d1
  20. May 01, 2016
  21. Apr 30, 2016
    • Rui Ueyama's avatar
      ELF: Make --reproduce to produce a response file. · aa00e96a
      Rui Ueyama authored
      The aim of this patch is to make it easy to re-run the command without
      updating paths in the command line. Here is a use case.
      
      Assume that Alice is having an issue with lld and is reporting the issue
      to developer Bob. Alice's current directly is /home/alice/work and her
      command line is "ld.lld -o foo foo.o ../bar.o". She adds "--reproduce repro"
      to the command line and re-run. Then the following text will be produced as
      response.txt (notice that the paths are rewritten so that they are
      relative to /home/alice/work/repro.)
      
        -o home/alice/work/foo home/alice/work/foo.o home/alice/bar.o
      
      The command also produces the following files by copying inputs.
      
        /home/alice/repro/home/alice/work/foo.o
        /home/alice/repro/home/alice/bar.o
      
      Alice zips the directory and send it to Bob. Bob get an archive from Alice
      and extract it to his home directory as /home/bob/repro. Now his directory
      have the following files.
      
        /home/bob/repro/response.txt
        /home/bob/repro/home/alice/work/foo.o
        /home/bob/repro/home/alice/bar.o
      
      Bob then re-run the command with these files by the following commands.
      
        cd /home/bob/repro
        ld.lld @response.txt
      
      This command will run the linker with the same command line options and
      the same input files as Alice's, so it is very likely that Bob will see
      the same issue as Alice saw.
      
      Differential Revision: http://reviews.llvm.org/D19737
      
      llvm-svn: 268169
      aa00e96a
  22. Apr 28, 2016
    • Rafael Espindola's avatar
      Use a single context for lto. · 156f4ee1
      Rafael Espindola authored
      Using multiple context used to be a really big memory saving because we
      could free memory from each file while the linker proceeded with the
      symbol resolution. We are getting lazier about reading data from the
      bitcode, so I was curious if this was still a good tradeoff.
      
      One thing that is a bit annoying is that we still have to copy the
      symbol names. The problem is that the names are stored in the Module and
      get freed when we move the module bits during linking.
      
      Long term I think the solution is to add a symbol table to the bitcode.
      That way IRObject file will not need to use a Module or a Context and we
      can drop it while still keeping a StringRef to the names.
      
      This patch is still be an interesting medium term improvement.
      
      When linking llvm-as without debug info this patch is a small speedup:
      
      master: 29.861877513 seconds
      patch: 29.814533787 seconds
      
      With debug info the numbers are
      
      master: 34.765181469 seconds
      patch: 34.563351584 seconds
      
      The peak memory usage when linking llvm-as with debug info was
      
      master: 599.10MB
      patch: 600.13MB
      llvm-svn: 267921
      156f4ee1
  23. Apr 26, 2016
  24. Apr 22, 2016
    • Peter Collingbourne's avatar
      ELF: Implement basic support for --version-script. · 66ac1d61
      Peter Collingbourne authored
      This patch only implements support for version scripts of the form:
        { [ global: symbol1; symbol2; [...]; symbolN; ] local: *; };
      No wildcards are supported, other than for the local entry. Symbol versioning
      is also not supported.
      
      It works by introducing a new Symbol flag which tracks whether a symbol
      appears in the global section of a version script.
      
      This patch also simplifies the logic in SymbolBody::isPreemptible(), and
      teaches it to handle the case where symbols with default visibility in DSOs
      do not appear in the dynamic symbol table because of a version script.
      
      Fixes PR27482.
      
      Differential Revision: http://reviews.llvm.org/D19430
      
      llvm-svn: 267208
      66ac1d61
  25. Apr 13, 2016
    • Rafael Espindola's avatar
      git-clang-format. NFC. · ab14c889
      Rafael Espindola authored
      llvm-svn: 266231
      ab14c889
    • Adhemerval Zanella's avatar
      ELF: Implement --dynamic-list · 9df07207
      Adhemerval Zanella authored
      This patch implements the --dynamic-list option, which adds a list of
      global symbol that either should not be bounded by default definition
      when creating shared libraries, or add in dynamic symbol table in the
      case of creating executables.
      
      The patch modifies the ScriptParserBase class to use a list of Token
      instead of StringRef, which contains information if the token is a
      quoted or unquoted strings. It is used to use a faster search for
      exact match symbol name.
      
      The input file follow a similar format of linker script with some
      simplifications (it does not have scope or node names). It leads
      to a simplified parser define in DynamicList.{cpp,h}.
      
      Different from ld/gold neither glob pattern nor mangled names
      (extern 'C++') are currently supported.
      
      llvm-svn: 266227
      9df07207
  26. Apr 07, 2016
    • Rui Ueyama's avatar
      ELF: Implement --start-lib and --end-lib · f8baa660
      Rui Ueyama authored
      start-lib and end-lib are options to link object files in the same
      semantics as archive files. If an object is in start-lib and end-lib,
      the object is linked only when the file is needed to resolve
      undefined symbols. That means, if an object is in start-lib and end-lib,
      it behaves as if it were in an archive file.
      
      In this patch, I introduced a new notion, LazyObjectFile. That is
      analogous to Archive file type, but that works for a single object
      file instead of for an archive file.
      
      http://reviews.llvm.org/D18814
      
      llvm-svn: 265710
      f8baa660
  27. Apr 01, 2016
  28. Mar 15, 2016
  29. Mar 02, 2016
  30. Feb 28, 2016
  31. Feb 11, 2016
  32. Feb 02, 2016
Loading