Skip to content
  1. Jan 10, 2017
  2. Jan 06, 2017
  3. Jan 04, 2017
    • Peter Smith's avatar
      [ELF] Add support for thunks to undefined non-weak symbols · 97c6d78f
      Peter Smith authored
          
      In a shared library an undefined symbol is implicitly imported. If the
      symbol is called as a function a PLT entry is generated for it. When the
      caller is a Thumb b.w a thunk to the PLT entry is needed as all PLT
      entries are in ARM state.
          
      This change allows undefined symbols to have thunks in the same way that
      shared symbols may have thunks.
      
      llvm-svn: 290951
      97c6d78f
  4. Dec 21, 2016
    • Rui Ueyama's avatar
      De-template DefinedSynthetic. · 4f2f50dc
      Rui Ueyama authored
      DefinedSynthetic is not created for a real ELF object, so it doesn't
      have to be a template function. It has a virtual st_value, which is
      either 32 bit or 64 bit, but we can simply use 64 bit.
      
      llvm-svn: 290241
      4f2f50dc
  5. Dec 19, 2016
  6. Dec 15, 2016
    • Sean Silva's avatar
      Rename this variable. · 902ae3cb
      Sean Silva authored
      `SC` didn't make much sense. We don't seem to have a clear convention,
      but `IS` sounds good here because it emphasizes that it is an input
      section (this is one place in the code where we are dealing with both
      input sections and output sections at the same time so that extra
      emphasis makes it a bit clearer).
      
      llvm-svn: 289748
      902ae3cb
  7. Dec 08, 2016
    • Peter Smith's avatar
      [ELF] ifunc implementation using synthetic sections · baffdb8b
      Peter Smith authored
      This change introduces new synthetic sections IpltSection, IgotPltSection
      that represent the ifunc entries that would previously have been put in
      the PltSection and the GotPltSection. The separation makes sure that
      the R_*_IRELATIVE relocations are placed after the non R_*_IRELATIVE
      relocations, which permits ifunc resolvers to know that the .got.plt
      slots will be initialized prior to the resolver being called.
      
      A secondary benefit is that for ARM we can move the IgotPltSection and its
      dynamic relocations to the .got and .rel.dyn as the ARM glibc expects all
      the R_*_IRELATIVE relocations to be in the .rel.dyn
      
      Differential revision: https://reviews.llvm.org/D27406
      
      llvm-svn: 289045
      baffdb8b
    • Rui Ueyama's avatar
  8. Dec 05, 2016
  9. Nov 29, 2016
    • Rui Ueyama's avatar
      Introduce StringRefZ class to represent null-terminated strings. · a13efc2a
      Rui Ueyama authored
      StringRefZ is a class to represent a null-terminated string. String
      length is computed lazily, so it's more efficient than StringRef to
      represent strings in string table.
      
      The motivation of defining this new class is to merge functions
      that only differ in string types; we have many constructors that takes
      `const char *` or `StringRef`. With StringRefZ, we can merge them.
      
      Differential Revision: https://reviews.llvm.org/D27037
      
      llvm-svn: 288172
      a13efc2a
  10. Nov 24, 2016
  11. Nov 23, 2016
    • Rui Ueyama's avatar
      Define toString() as a generic function to get a string for error message. · 3fc0f7e5
      Rui Ueyama authored
      We have different functions to stringize objects to construct
      error messages. For InputFile, we have getFilename, and for
      InputSection, we have getName. You had to memorize them.
      
      I think this is the case where the function overloading comes in handy.
      
      This patch defines toString() functions that are overloaded for all these
      types, so that you just call it in error().
      
      Differential Revision: https://reviews.llvm.org/D27030
      
      llvm-svn: 287787
      3fc0f7e5
    • Rui Ueyama's avatar
      Parse symbol versions in scanVersionScript() instead of insert(). · 35fa6c58
      Rui Ueyama authored
      There are two ways to set symbol versions. One way is to use symbol
      definition file, and the other is to embed version names to symbol
      names. In the latter way, symbol name is in the form of `foo@version1`
      where `foo` is a real name and `version1` is a version.
      
      We were parsing symbol names in insert(). That seems unnecessarily
      too early. We can do it later after we resolve all symbols. Doing it
      lazily is a good thing because it makes code easier to read
      (because now we have a separate pass to parse symbol names). Also
      it could slightly improve performance because if two identical symbols
      have versions, we now parse them only once.
      
      llvm-svn: 287741
      35fa6c58
    • Rui Ueyama's avatar
      Allow calling getName() on local symbols. · c72ba3a4
      Rui Ueyama authored
      Previously, we stored offsets in string tables to symbols, so
      you needed to pass a string table to get a symbol name. This patch
      stores const char pointers instead to eliminate the need to pass
      a string table.
      
      llvm-svn: 287737
      c72ba3a4
  12. Nov 18, 2016
  13. Nov 16, 2016
  14. Nov 11, 2016
  15. Nov 10, 2016
  16. Nov 09, 2016
    • Rafael Espindola's avatar
      Split Header into individual fields. · 04a2e348
      Rafael Espindola authored
      This is similar to what was done for InputSection.
      
      With this the various fields are stored in host order and only
      converted to target order when writing.
      
      llvm-svn: 286327
      04a2e348
  17. Nov 06, 2016
    • Rui Ueyama's avatar
      Rewrite CommonInputSection as a synthetic input section. · e8a6102f
      Rui Ueyama authored
      A CommonInputSection is a section containing all common symbols.
      That was an input section but was abstracted in a different way
      than the synthetic input sections because it was written before
      the synthetic input section was invented.
      
      This patch rewrites CommonInputSection as a synthetic input section
      so that it behaves better with other sections.
      
      llvm-svn: 286053
      e8a6102f
  18. 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
  19. Oct 26, 2016
    • Rafael Espindola's avatar
      Reduce the number of allocators. · 5da1d884
      Rafael Espindola authored
      We used to have one allocator per file, which reduces the advantage of
      using an allocator in the first place.
      
      This is a small speed up is most cases. The largest speedup was in
      1.014X in chromium no-gc. The largest slowdown was scylla at 1.003X.
      
      llvm-svn: 285205
      5da1d884
    • Rafael Espindola's avatar
      Read section headers upfront. · 0e090522
      Rafael Espindola authored
      Instead of storing a pointer, store the members we need.
      
      The reason for doing this is that it makes it far easier to create
      synthetic sections. It also avoids reading data from files multiple
      times., which might help with cross endian linking and host
      architectures with slow unaligned access.
      
      There are obvious compacting opportunities, but this already has mixed
      results even on native x86_64 linking.
      
      There is also the possibility of better refactoring the code for
      handling common symbols, but this already shows that a custom class is
      not necessary.
      
      llvm-svn: 285148
      0e090522
  20. Oct 21, 2016
    • Simon Atanasyan's avatar
      [ELF][MIPS] Put local GOT entries accessed via a 16-bit index first · bed04bf1
      Simon Atanasyan authored
      Some MIPS relocations used to access GOT entries are able to manipulate
      16-bit index. The other ones like R_MIPS_CALL_HI16/LO16 can handle
      32-bit indexes. 16-bit relocations are generated by default. The 32-bit
      relocations are generated by -mxgot flag passed to compiler. Usually
      these relocation are not mixed in the same code but files like crt*.o
      contain 16-bit relocations so even if all "user's" code compiled with
      -mxgot flag a few 16-bit relocations might come to the linking phase.
      
      Now LLD does not differentiate local GOT entries accessed via a 16-bit
      and 32-bit indexes. That might lead to relocation's overflow if 16-bit
      entries are allocated to far from the beginning of the GOT.
      
      The patch introduces new "part" of MIPS GOT dedicated to the local GOT
      entries accessed by 32-bit relocations. That allows to put local GOT
      entries accessed via a 16-bit index first and escape relocation's overflow.
      
      Differential revision: https://reviews.llvm.org/D25833
      
      llvm-svn: 284809
      bed04bf1
  21. Oct 12, 2016
  22. Oct 04, 2016
  23. Sep 29, 2016
  24. Sep 14, 2016
    • Simon Atanasyan's avatar
      [ELF] Do not adjust TLS symbol value when produce relocatable object · d10a5ea1
      Simon Atanasyan authored
      When the linker generates a relocatable object there is no TLS program
      header and we should not adjust TLS symbols value.
      
      llvm-svn: 281494
      d10a5ea1
    • 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
  25. Aug 31, 2016
  26. Aug 11, 2016
  27. Aug 02, 2016
    • Rui Ueyama's avatar
      Remove DefinedCommon::Section. · 07784904
      Rui Ueyama authored
      Since CommonInputSection is a singleton class, we don't need
      to store pointers to all DefinedCommon symbols.
      
      llvm-svn: 277410
      07784904
  28. Jul 28, 2016
Loading