Skip to content
  1. 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] Rename getFinalSectionName -> getOutputSectionName. · 951dd1d4
      Rui Ueyama authored
      llvm-svn: 195855
      951dd1d4
    • 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
  2. Nov 26, 2013
  3. Nov 25, 2013
    • Rui Ueyama's avatar
      [PECOFF] Skip sections with LNK_INFO. · 50e2d7ae
      Rui Ueyama authored
      According to the PE/COFF spec, a section with IMAGE_SCN_LNK_INFO should only
      appear in an object file, and not allowed in an executable. So I believe
      treating it as the same way as IMAGE_SCN_LNK_INFO is the right thing.
      
      llvm-svn: 195692
      50e2d7ae
    • Rui Ueyama's avatar
      [PECOFF] String pointed by StringRef is not always NUL-terminated. · 69cec146
      Rui Ueyama authored
      In order not to overrun a StringRef and copy the trailing garbage, we need to
      set the maximum length to be copied by strncpy.
      
      llvm-svn: 195688
      69cec146
    • Rui Ueyama's avatar
      Early return. · 8b08c379
      Rui Ueyama authored
      llvm-svn: 195663
      8b08c379
    • Rui Ueyama's avatar
      Use range-based for loop. · 17e899c9
      Rui Ueyama authored
      llvm-svn: 195662
      17e899c9
    • Rui Ueyama's avatar
      Indentation. · 5a3804f9
      Rui Ueyama authored
      llvm-svn: 195661
      5a3804f9
    • Rui Ueyama's avatar
      [PECOFF] Move definitions to IdataPass.cpp. · 52b9cbf8
      Rui Ueyama authored
      llvm-svn: 195618
      52b9cbf8
    • Rui Ueyama's avatar
      [PECOFF] Set ordinals to linker internal atoms. · 6194109c
      Rui Ueyama authored
      This patch won't change the output because the layout of linker internal
      atoms is forced by layout-{before,after} references. Ordinals of the linker
      internal atoms are not currently used. (That's why it's working even if there
      are atoms having the same ordinals.)
      
      llvm-svn: 195610
      6194109c
    • Shankar Easwaran's avatar
      [Gnu] Set the defaults in the ELFLinkingContext. · 89d0335a
      Shankar Easwaran authored
      Comment from Rui Ueyema.
      
      llvm-svn: 195598
      89d0335a
    • Shankar Easwaran's avatar
      [Gnu] Ignore unknown arguments, and print message. · 70944784
      Shankar Easwaran authored
      llvm-svn: 195597
      70944784
    • Shankar Easwaran's avatar
      [Gnu] Set the type of binary that lld would generate. · f6ec3faf
      Shankar Easwaran authored
      This is needed before any of the search paths are searched for.
      
      llvm-svn: 195596
      f6ec3faf
    • Rui Ueyama's avatar
      [PECOFF] Change sectionChoice attribute. · 2e36c8de
      Rui Ueyama authored
      Change the attribute from sectionBasedOnContent to sectionCustomRequired
      because its the right attribute for atoms read from COFF files to have.
      COFF atoms should basically be emitted to the section having the same name
      as input. Permissions/attributes should not affect that.
      
      There's no functionality change because the writer doesn't yet use the
      section name. The writer will be modified in a following patch, so that atoms
      are written to its customSectionName()'s section.
      
      llvm-svn: 195595
      2e36c8de
    • Shankar Easwaran's avatar
      [Gnu] -L paths is not positional. · a27fe1c9
      Shankar Easwaran authored
      Looks like -L paths are not positional. They need to be added to a list of
      search paths and those needs to be searched when lld looks for a library.
      
      llvm-svn: 195594
      a27fe1c9
    • Rui Ueyama's avatar
      Fix MSVC buildbot. · ffbf4c39
      Rui Ueyama authored
      llvm-svn: 195593
      ffbf4c39
    • Rui Ueyama's avatar
      [PECOFF] Infer subsystem from the entry point function. · 1a11b3b0
      Rui Ueyama authored
      If /subsystem option is not specified, the linker needs to infer it from the
      entry point function. If "main" or "wmain" is defined, it's a console
      application. If "WinMain" or "wWinMain" is defined, it's a GUI application.
      
      llvm-svn: 195592
      1a11b3b0
    • Shankar Easwaran's avatar
      [InputGraph][Gnu] Add LinkerScript support. · d87a021c
      Shankar Easwaran authored
      This adds LinkerScript support by creating a type Script which is of type
      FileNode in the InputGraph. Once the LinkerScript Parser converts the
      LinkerScript into a sequence of command, the commands are handled by the
      equivalent LinkerScript node for the current Flavor/Target. For ELF, a
      ELFGNULdScript gets created which converts the commands to ELF nodes and ELF
      control nodes(ELFGroup for handling Group nodes).
      
      Since the Inputfile type has to be determined in the Driver, the Driver needs
      to determine the complete path of the file that needs to be processed by the
      Linker. Due to this, few tests have been removed since the Driver uses paths
      that doesnot exist.
      
      llvm-svn: 195583
      d87a021c
  4. Nov 24, 2013
  5. Nov 23, 2013
    • Shankar Easwaran's avatar
      [InputGraph] Add capability to process Hidden nodes. · 67e98f51
      Shankar Easwaran authored
      Hidden nodes could be a result of expansion, where a flavor might decide to keep
      the node that we want to expand but discard it from being processed by the
      resolver.
      
      Verifies with unittests.
      
      llvm-svn: 195516
      67e98f51
    • Shankar Easwaran's avatar
      [InputGraph] Expand InputGraph nodes. · 3ac09bcb
      Shankar Easwaran authored
      Flavors may like to expand InputGraph nodes, when a filenode after parsing
      results in more elements. One such example is while parsing GNU linker scripts.
      The linker scripts after parsing would result in a lot of filenodes and probably
      controlnodes too.
      
      Adds unittests to verify functionality.
      
      llvm-svn: 195515
      3ac09bcb
  6. Nov 22, 2013
  7. Nov 21, 2013
  8. Nov 20, 2013
    • Rui Ueyama's avatar
      [PECOFF] Recognize but ignore /implib and /safeseh for now. · f8b41867
      Rui Ueyama authored
      So that the LLD won't print error message saying that it couldn't find
      /implib or /safeseh files.
      
      llvm-svn: 195276
      f8b41867
    • Rui Ueyama's avatar
      Use NativeReferenceIvarsV2 if necessary. · e05b629d
      Rui Ueyama authored
      NativeReferenceIvarsV1 cannot handle more than 65535 relocation targets
      because its field to point to the target table is of type uint16_t. Because
      of that limitation, the LLD couldn't link a file containing more than 65535
      relocations. 65535 is not a big number - the LLD couldn't even link itself
      with V1.
      
      This patch solves the issue by adding NativeReferenceIvarsV2 support. The
      new structure has more bits for the target table, so it can handle a large
      number of relocatinos.
      
      V2 structure is larger than V1. In order to prevent file bloating, V2 format
      is used only when the resulting file cannot be represented in V1 format. The
      writer and the reader support both V1 and V2 formats.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2217
      
      llvm-svn: 195270
      e05b629d
    • Rui Ueyama's avatar
      Fix Weak External symbol handling. · 70f11d75
      Rui Ueyama authored
      The fallback atom was used only when it's searching for a symbol in a library;
      if an undefined symbol was not found in a library, the LLD looked for its
      fallback symbol in the library.
      
      Although it worked in most cases, because symbols with fallbacks usually occur
      only in OLDNAMES.LIB (a standard library), that behavior was incompatible with
      link.exe. This patch fixes the issue so that the semantics is the same as
      MSVC's link.exe
      
      The new (and correct, I believe) behavior is this:
      
       - If there's no definition for an undefined atom, replace the undefined atom
         with its fallback and then proceed (e.g. look in the next file or stop
         linking as usual.)
      
      Weak External symbols are underspecified in the Microsoft PE/COFF spec. However,
      as long as I observed the behavior of link.exe, this seems to be what we want
      for compatibility.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2162
      
      llvm-svn: 195269
      70f11d75
    • Rui Ueyama's avatar
      Do not inline large member functions. No functionality change. · 7b3c42a5
      Rui Ueyama authored
      llvm-svn: 195169
      7b3c42a5
  9. Nov 19, 2013
Loading