Skip to content
  1. Jan 09, 2014
  2. Jan 08, 2014
  3. Jan 02, 2014
  4. Dec 28, 2013
    • Rui Ueyama's avatar
      [PECOFF] Warn only when /export options are not compatible. · ffd81052
      Rui Ueyama authored
      Currently LLD always print a warning message if the same symbol is specified
      more than once for /export option. It's a bit annoying because specifying the
      same symbol with compatible options is actually safe and considered as a
      normal use case. This patch makes LLD to warn only when incompatible export
      options are given.
      
      llvm-svn: 198104
      ffd81052
  5. Dec 27, 2013
  6. Dec 26, 2013
  7. Dec 25, 2013
    • Rui Ueyama's avatar
      [PECOFF] Set default subsystem to the DLL header. · cc66ff67
      Rui Ueyama authored
      Subsystem field in the PE/COFF file header has no meanining for the DLL.
      It looks like MSVC link.exe sets the default subsystem (Windows GUI) to
      the field if no /subsystem option is specified.
      
      llvm-svn: 198015
      cc66ff67
  8. Dec 20, 2013
  9. Dec 19, 2013
    • Nick Kledzik's avatar
      [lld] Introduce registry and Reference kind tuple · e5552777
      Nick Kledzik authored
      The main changes are in:
        include/lld/Core/Reference.h
        include/lld/ReaderWriter/Reader.h
      Everything else is details to support the main change.
      
      1) Registration based Readers
      Previously, lld had a tangled interdependency with all the Readers.  It would
      have been impossible to make a streamlined linker (say for a JIT) which
      just supported one file format and one architecture (no yaml, no archives, etc).
      The old model also required a LinkingContext to read an object file, which
      would have made .o inspection tools awkward.
      
      The new model is that there is a global Registry object. You programmatically 
      register the Readers you want with the registry object. Whenever you need to 
      read/parse a file, you ask the registry to do it, and the registry tries each 
      registered reader.
      
      For ease of use with the existing lld code base, there is one Registry
      object inside the LinkingContext object. 
      
      
      2) Changing kind value to be a tuple
      Beside Readers, the registry also keeps track of the mapping for Reference
      Kind values to and from strings.  Along with that, this patch also fixes
      an ambiguity with the previous Reference::Kind values.  The problem was that
      we wanted to reuse existing relocation type values as Reference::Kind values.
      But then how can the YAML write know how to convert a value to a string? The
      fix is to change the 32-bit Reference::Kind into a tuple with an 8-bit namespace
      (e.g. ELF, COFFF, etc), an 8-bit architecture (e.g. x86_64, PowerPC, etc), and
      a 16-bit value.  This tuple system allows conversion to and from strings with 
      no ambiguities.
      
      llvm-svn: 197727
      e5552777
  10. Dec 17, 2013
    • Rui Ueyama's avatar
      [PECOFF] Truncate long section name. · 1fc1bab8
      Rui Ueyama authored
      Executable files do not use a string table, so section names longer than 8
      characters are not permitted. Long section names should just be truncated.
      
      llvm-svn: 197470
      1fc1bab8
  11. Dec 16, 2013
    • Rui Ueyama's avatar
      [PECOFF] Support export-only-by-ordinal exports. · 64d491d1
      Rui Ueyama authored
      If NONAME option is given for an export, that symbol will be exported only by
      its ordinal. LLD will not emit the symbol name to the export table.
      
      llvm-svn: 197371
      64d491d1
    • Rui Ueyama's avatar
      [PECOFF] Set OrdinalBase field in the export table. · 69b899a1
      Rui Ueyama authored
      OrdinalBase is an addend to the ordinals. We used to always set 1 to the field.
      Although it produced a valid a DLL export table, it'd be a waste if the first
      ordinal does not start with 1 -- we had to have NULL fields at the beginning of
      the export address table. By setting the ordinal base, we can eliminate the
      NULL fields.
      
      llvm-svn: 197367
      69b899a1
    • Rui Ueyama's avatar
      [PECOFF] Make it possible to specify export ordinals. · fe1b3c09
      Rui Ueyama authored
      You can specify exported function's ordinal by /export:func,@<number> command
      line option, but LLD ignored the option until now. This patch implements the
      feature.
      
      Ordinal is basically the index into the exported function address table. So,
      for example, if /export:foo,@42 is specified, the linker writes foo's address
      to 42th entry in the address table. Windows supports import-by-ordinal; you
      can not only import a function by name, but by its ordinal. If you want to
      allow your DLL users to import your functions by their ordinals, you need to
      make sure that your functions are always exported with the same ordinals.
      This is the feature for that situation.
      
      llvm-svn: 197364
      fe1b3c09
  12. Dec 15, 2013
    • Simon Atanasyan's avatar
      Linking of shared libraries for MIPS little-endian 32-bit target. · 9931f95b
      Simon Atanasyan authored
      The following are the most significant peculiarities of MIPS target:
      - MIPS ABI requires some special tags in the dynamic table.
      - GOT consists of two parts local and global. The local part contains
        entries refer locally visible symbols. The global part contains entries
        refer global symbols.
      - Entries in the .dynsym section which have corresponded entries in the
        GOT should be:
        * Emitted at the end of .dynsym section
        * Sorted accordingly to theirs GOT counterparts
      - There are "paired" relocations. One or more R_MIPS_HI16 and R_MIPS_GOT16
        relocations should be followed by R_MIPS_LO16 relocation. To calculate
        result of R_MIPS_HI16 and R_MIPS_GOT16 relocations we need to combine
        addends from these relocations and paired R_MIPS_LO16 relocation.
      
      The patch reviewed by Michael Spencer, Shankar Easwaran, Rui Ueyama.
      http://llvm-reviews.chandlerc.com/D2156
      
      llvm-svn: 197342
      9931f95b
  13. Dec 14, 2013
  14. Dec 13, 2013
    • Rui Ueyama's avatar
      [PECOFF] Align .edata fields on natural boundaries. · 3a136547
      Rui Ueyama authored
      The only data in .edata whose length varies is the string. This patch moves
      all the strings to the end of the section, so that 16-bit or 32-bit integers
      are aligned on correct boundaries.
      
      llvm-svn: 197213
      3a136547
    • Rui Ueyama's avatar
      [PECOFF] Create .edata section for the DLL export table. · c91c24e3
      Rui Ueyama authored
      This is the first patch to emit data for the DLL export table. The DLL export
      table is the data used by the Windows loader to find the address of exported
      function from DLL. With this patch, LLD is able to emit a valid DLL export
      table which the Windows loader can interpret and load.
      
      The data structure of the DLL export table is described in the Microsoft
      PE/COFF Specification, section 5.3.
      
      DLL support is not complete yet; the linker needs to emit an import library
      for a DLL, otherwise the linker cannot link against the DLL. We also do not
      support export-only-by-ordinal yet.
      
      llvm-svn: 197212
      c91c24e3
  15. Dec 11, 2013
  16. Dec 09, 2013
  17. 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
  18. Dec 05, 2013
    • 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
  19. Dec 04, 2013
  20. Dec 03, 2013
  21. Dec 02, 2013
  22. Nov 28, 2013
  23. Nov 27, 2013
    • 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] 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
      [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