Skip to content
  1. Dec 12, 2013
    • Rui Ueyama's avatar
      [PECOFF] Add /dllexport option. · 4cf5a161
      Rui Ueyama authored
      /DLLEXPORT is a command line option to export a symbol. __declspec(dllexport)
      uses that to make the linker to export DLLExport'ed functions, by adding the
      option to .drectve section.
      
      This patch implements the parser of the command line option.
      
      llvm-svn: 197122
      4cf5a161
  2. 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
  3. Dec 05, 2013
    • 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
  4. Dec 04, 2013
    • Rui Ueyama's avatar
      [PECOFF] Ignore /functionpadmin option. · ea35c0ba
      Rui Ueyama authored
      If /functionpadmin is specified, the linker is supposed to make room at the
      beginning of each function, so that self-modifying program would easily
      hotpatch existing functions. Since I'm not sure if this feature is really used,
      I'll make LLD to ignore the option for now.
      
      llvm-svn: 196363
      ea35c0ba
  5. 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
  6. 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] Rename getFinalSectionName -> getOutputSectionName. · 951dd1d4
      Rui Ueyama authored
      llvm-svn: 195855
      951dd1d4
  7. Nov 26, 2013
  8. Nov 25, 2013
    • 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
  9. 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
  10. Nov 22, 2013
  11. Nov 21, 2013
  12. Nov 20, 2013
  13. Nov 19, 2013
  14. Nov 09, 2013
  15. Nov 07, 2013
  16. Nov 06, 2013
    • Nick Kledzik's avatar
      [mach-o] fix EXPECT_EQ types · f3e89cb8
      Nick Kledzik authored
      llvm-svn: 194173
      f3e89cb8
    • Nick Kledzik's avatar
      [mach-o] binary reader and writer · e34182f3
      Nick Kledzik authored
      This patch adds support for converting normalized mach-o to and from binary
      mach-o. It also changes WriterMachO (which previously directly wrote a 
      mach-o binary given a set of Atoms) to instead do it in two steps. The first 
      step uses normalizedFromAtoms() to convert Atoms to normalized mach-o, and the
      second step uses writeBinary() which to generate the mach-o binary file.  
      
      llvm-svn: 194167
      e34182f3
    • Rui Ueyama's avatar
      [PECOFF] Rename getSectionAlignment -> getSectionDefaultAlignment. · 41b99dce
      Rui Ueyama authored
      These fields are for /align option. Section alignment can be set per-section
      basis with /section option too. In order to avoid name conflicts, rename the
      existing identifiers to become more specific. No functionality change.
      
      llvm-svn: 194160
      41b99dce
    • Rui Ueyama's avatar
      [PECOFF] Add /section option. · 108b3713
      Rui Ueyama authored
      /section command line option is to set/reset attributes of the Characteristics
      field in the section header. You can set non-default values with this option.
      You can make .data section executable with this, for example.
      
      This patch implements the parser of the command line option. The code to use
      the parsed values will be committed in a separate patch.
      
      llvm-svn: 194133
      108b3713
    • Rui Ueyama's avatar
      [PECOFF] Make /disallowlib an alias for /nodefaultlib. · 67b277c3
      Rui Ueyama authored
      I'm not sure if it is really an alias for /nodefaultlib, but I can say that
      they are at least similar. Making it an alias would be better than ignoring it.
      
      llvm-svn: 194131
      67b277c3
    • Rui Ueyama's avatar
      [PECOFF] Do not add the same library to the input graph more than once. · 249c7b33
      Rui Ueyama authored
      /defaultlib options can be specified implicitly via the .drectve section, and
      it's pretty common that multiple object files add the same library, such as
      user32.lib, to the input. We shouldn't add the same library multiple times.
      
      llvm-svn: 194129
      249c7b33
    • Rui Ueyama's avatar
      [PECOFF] Ignore /disallowlib. · c13f43f4
      Rui Ueyama authored
      msvcrt.lib contains "/disallowlib" command line option in its .drectve section.
      I couldn't spot any documentation for the option. Ignore it for now so that we
      can link the library without error.
      
      llvm-svn: 194114
      c13f43f4
  17. Oct 26, 2013
    • Rui Ueyama's avatar
      [PECOFF] Parse /merge command line option. · 863931c9
      Rui Ueyama authored
      /merge:<from>=<to> option makes the linker to combine "from" section to "to"
      section. This patch is to parse the option. The actual feature will be
      implemented in a subsequent patch.
      
      llvm-svn: 193454
      863931c9
  18. Oct 22, 2013
  19. Oct 16, 2013
    • Rui Ueyama's avatar
      Make undefines check into an assertion. · f3630fe4
      Rui Ueyama authored
      Dead-strip root symbols can be undefined atoms, but should not really be
      nonexistent, because dead-strip root symbols should be added to initial
      undefined atoms at startup. Whenever you look up its name in the symbol
      table, some type of atom will always exist.
      
      llvm-svn: 192831
      f3630fe4
  20. Oct 08, 2013
    • Rui Ueyama's avatar
      Rename path() -> getPath(). · 53f31af7
      Rui Ueyama authored
      Differential Revision: http://llvm-reviews.chandlerc.com/D1853
      
      llvm-svn: 192167
      53f31af7
    • Nick Kledzik's avatar
      fix all EXPECT_EQ(.address) tests · 58070025
      Nick Kledzik authored
      llvm-svn: 192153
      58070025
    • Nick Kledzik's avatar
      fix test case failing on bot · 7e28e755
      Nick Kledzik authored
      llvm-svn: 192152
      7e28e755
    • Nick Kledzik's avatar
      Supoort mach-o encoded in yaml. · 30332b19
      Nick Kledzik authored
      This is the first step in how I plan to get mach-o object files support into 
      lld. We need to be able to test the mach-o Reader and Write on systems without 
      a mach-o tools. Therefore, we want to support a textual way (YAML) to represent 
      mach-o files.
      
      MachONormalizedFile.h defines an in-memory abstraction of the content of mach-o  
      files. The in-memory data structures are always native endianess and always
      use 64-bit sizes. That internal data structure can then be converted to or
      from three different formats: 1) yaml (text) encoded mach-o, 2) binary mach-o
      files, 3) lld Atoms.
      
      This patch defines the internal model and uses YAML I/O to implement the 
      conversion to and from the model to yaml. The next patch will implement
      the conversion from normalized to binary mach-o.
      
      This patch includes unit tests to validate the yaml conversion APIs.
      
      llvm-svn: 192147
      30332b19
  21. Oct 07, 2013
    • Shankar Easwaran's avatar
      [lld][InputGraph] Change the Resolver to use inputGraph · a96f3a3d
      Shankar Easwaran authored
      Changes :-
      
      a) Functionality in InputGraph to insert Input elements at any position
      b) Functionality in the Resolver to use nextFile
      c) Move the functionality of assigning file ordinals to InputGraph
      d) Changes all inputs to MemoryBuffers
      e) Remove LinkerInput, InputFiles, ReaderArchive
      
      llvm-svn: 192081
      a96f3a3d
Loading