Skip to content
  1. Dec 09, 2013
    • Rui Ueyama's avatar
      [PECOFF] Add /alternatename option parser. · 34d6e9b3
      Rui Ueyama authored
      /ALTERNATENAME is a rarely-used, undocumented command line option that is
      needed to link LLD for release build. It seems that the option is for defining
      an weak alias; /alternatename:foo=bar defines weak symbol "foo" for "bar".
      If "foo" is defined in an input file, it'll be linked normally and the command
      line option will have no effect. If it's not defined, "foo" will be handled
      as an alias for "bar".
      
      This patch implements the parser for the option. The actual weak alias handling
      will be implemented in a separate patch.
      
      llvm-svn: 196743
      34d6e9b3
    • Rui Ueyama's avatar
      Move scattered debug functions into one #ifndef-guarded place. · a930d12f
      Rui Ueyama authored
      llvm-svn: 196741
      a930d12f
  2. Dec 08, 2013
    • Rui Ueyama's avatar
      Fix -Wunused-function to unbreak buildbot. · 2994f6f7
      Rui Ueyama authored
      llvm-svn: 196716
      2994f6f7
    • Rui Ueyama's avatar
      Move static member functions out of a class. · 5af4622f
      Rui Ueyama authored
      Because compare() and its heper functions no longer have to be members of
      LayoutPass class, we can remove it from the class. No functionality change.
      
      llvm-svn: 196715
      5af4622f
    • Rui Ueyama's avatar
      Optimize the layout pass. · 37c43e9f
      Rui Ueyama authored
      The comparator used in the layout pass has many calls of map::find(). Because
      std::sort runs the comparator N*log2(N) times, the maps are looked up with the
      same key again and again. The map lookup is not a very fast operation. It made
      the pass slow.
      
      This patch eliminates the duplicate map lookups using decorate-sort-undecorate
      idiom. The pass used to take 1.1 seconds when linking LLD with LLD on Windows,
      but it now takes only 0.3 seconds. Overall performance gain in that case is from
      6.1 seconds to 5.2 seconds.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2358
      
      llvm-svn: 196714
      37c43e9f
  3. Dec 07, 2013
    • Rui Ueyama's avatar
      Re-submit r195852 with GroupedSectionsPass change. · 32c3f17d
      Rui Ueyama authored
      GroupedSectionsPass was a complicated pass. That pass's job was to reorder
      atoms by section name, so that the atoms with the same section prefix will be
      emitted consecutively to the executable. The pass added layout edges to atoms,
      and let the layout pass to actually reorder them.
      
      This patch simplifies the design by making GroupedSectionPass to directly
      reorder atoms, rather than adding layout edges. This resembles ELF's
      ArrayOrderPass.
      
      This patch improves the performance of LLD; it used to take 7.1 seconds to
      link LLD with LLD on my Macbook Pro, but it now takes 6.1 seconds.
      
      llvm-svn: 196628
      32c3f17d
  4. Dec 06, 2013
  5. Dec 05, 2013
    • Rui Ueyama's avatar
      Use !! to convert to a boolean value. · d2014f19
      Rui Ueyama authored
      llvm-svn: 196505
      d2014f19
    • Rui Ueyama's avatar
      [PECOFF] Handle .lib files as if they are grouped by --{start,end}-group. · 16c025e2
      Rui Ueyama authored
      Currently we do not de-duplicate library files specified by /defaultlib option.
      As a result, the same files are added multiple times to the input graph. In
      particular, some popular files, such as kernel32.lib or oldnames.lib, are added
      more than 10 times during linking of LLD. That makes the linker slower, as it
      needs to parse the same file again and again.
      
      This patch solves the issue by de-duplicating. The same file will be added only
      once to the input graph. This patch improved the LLD linking time from 10.5
      seconds to 7.7 seconds on my 4-core Core i7 Macbook Pro.
      
      llvm-svn: 196504
      16c025e2
    • Rui Ueyama's avatar
      Remove makeArrayRef() calls. · 7b472104
      Rui Ueyama authored
      Because ArrayRef has implicit conversion from C arrays, we don't need
      makeArrayRef.
      
      llvm-svn: 196475
      7b472104
    • Rui Ueyama's avatar
      Use makeArrayRef to construct ArrayRefs from C arrays. · 62acf862
      Rui Ueyama authored
      llvm-svn: 196465
      62acf862
    • Rui Ueyama's avatar
      [PECOFF] Emit the import table to .idata section. · 6cfe07b9
      Rui Ueyama authored
      Emitting idata atoms to their own section would make debugging easier.
      The Windows loader do not really care about whether the DLL import table is
      in .rdata or its own .idata section, so there is no change in functionality.
      
      llvm-svn: 196458
      6cfe07b9
  6. Dec 04, 2013
  7. Dec 03, 2013
  8. Dec 02, 2013
  9. Dec 01, 2013
    • Rui Ueyama's avatar
      [PECOFF] Fix /debug option. · 8de2250a
      Rui Ueyama authored
      /DEBUG option is to make the linker to emit debug information to the resulting
      executable. It's not for enable debugging of the linker itself.
      
      llvm-svn: 196040
      8de2250a
  10. Nov 28, 2013
  11. Nov 27, 2013
    • Rui Ueyama's avatar
      [PECOFF] Improve /merge option handling. · 615b200c
      Rui Ueyama authored
      /MERGE option is a bit complicated for many reasons. Firstly, it takes both
      positive and negative arguments. That means we have to have one of three
      distinctive values (set, clear or unchange) for each permission bit. In this
      patch we represent the three values using two bitmasks.
      
      Secondly, the permissions specified by the parameter is bitwise or-ed with the
      default permissions of a section. There is an exception for that rule; if one
      of READ, WRITE or EXECUTE bit is specified, unspecified bits need to be
      cleared. (So if you specify only WRITE for example, the resulting section will
      not have WRITE nor EXECUTE bits.)
      
      Lastly, multiple /merge options are allowed.
      
      llvm-svn: 195882
      615b200c
    • Rui Ueyama's avatar
      Refactor tests by using short identifiers. · ccb8f168
      Rui Ueyama authored
      This patch is to improve the readability of the tests before making a change
      to /merge option.
      
      llvm-svn: 195863
      ccb8f168
    • Rui Ueyama's avatar
      [PECOFF] Implement /merge option. · a5e09c84
      Rui Ueyama authored
      /MERGE:foo=bar command line option merges section foo to section bar. If
      section bar does not exist, foo is just renamed as bar.
      
      llvm-svn: 195856
      a5e09c84
    • Rui Ueyama's avatar
      [PECOFF] Rename getFinalSectionName -> getOutputSectionName. · 951dd1d4
      Rui Ueyama authored
      llvm-svn: 195855
      951dd1d4
    • Rui Ueyama's avatar
      [PECOFF] Remove extraneous command line options from tests. · 26c191ae
      Rui Ueyama authored
      llvm-svn: 195854
      26c191ae
    • Rui Ueyama's avatar
      [PECOFF] Add a test for r195797. · 60bbba65
      Rui Ueyama authored
      llvm-svn: 195853
      60bbba65
    • Rui Ueyama's avatar
      [PECOFF] Fix atom ordinals. · 878a8c90
      Rui Ueyama authored
      Atom ordinals are the indeces in a file. Currently the PECOFF reader assigns
      ordinals for each section, so it's (incorrectly) assigning duplicate ordinals.
      
      llvm-svn: 195852
      878a8c90
    • Rui Ueyama's avatar
      Print a bit more information before aborting. · cd480759
      Rui Ueyama authored
      llvm-svn: 195801
      cd480759
    • Rui Ueyama's avatar
      [PECOFF] Add a generic section writer. · 3e873b05
      Rui Ueyama authored
      Instead of having multiple SectionChunks for each section (.text, .data,
      .rdata and .bss), we could have one chunk writer that can emit any sections.
      This patch does that -- removing all section-sepcific chunk writers and
      replace them with one "generic" writer.
      
      This change should simplify the code because it eliminates similar-but-
      slightly-different classes.
      
      It also fixes an issue in the previous design. Before this patch, we could
      emit only limited set of sections (i.e. .text, .data, .rdata and .bss). With
      this patch, we can emit any sections.
      
      llvm-svn: 195797
      3e873b05
    • Rui Ueyama's avatar
      Revert "WriterPECOFF" · 57b4da58
      Rui Ueyama authored
      This reverts accidental commit r195794.
      
      llvm-svn: 195795
      57b4da58
    • Rui Ueyama's avatar
      WriterPECOFF · 6dc6d18f
      Rui Ueyama authored
      llvm-svn: 195794
      6dc6d18f
Loading