Skip to content
  1. Mar 01, 2017
  2. Feb 28, 2017
    • Rui Ueyama's avatar
      Refactor {Gnu,}HashTableSection classes. · 6b776ad9
      Rui Ueyama authored
      In other places in LLD, we use write32<E> instead of Elf_Word.
      This patch uses the same technique in the hash table classes.
      The hash table classes needs improving as they have almost no
      comments. We at least need to describe the hash table structure
      and why we have to support two different on-disk hash tables
      for the same purpose. I'll do that later.
      
      llvm-svn: 296439
      6b776ad9
    • Rui Ueyama's avatar
      Remove unused typedefs. · ab0a85ef
      Rui Ueyama authored
      llvm-svn: 296437
      ab0a85ef
    • Rui Ueyama's avatar
      Merge SymbolTableSection::add{Global,Local} into one function. · b8dcdb59
      Rui Ueyama authored
      Previously, these two functions put their symbols in different queues.
      Now that the queues have been merged. So there's no point to keep two
      separate functions.
      
      llvm-svn: 296435
      b8dcdb59
    • Rui Ueyama's avatar
      Move SymbolTableSection::getOutputSection to SymbolBody::getOutputSection. · 968db48c
      Rui Ueyama authored
      That function doesn't use any member of SymbolTableSection, so I
      couldn't see a reason to make it a member of that class. The function
      takes a SymbolBody, so it is more natural to make it a member of
      SymbolBody.
      
      llvm-svn: 296433
      968db48c
    • Rui Ueyama's avatar
      Improve SymbolTableSection synthetic section. · 1f032537
      Rui Ueyama authored
      The previous code was a bit hard to understand because it unnecessarily
      distinguished local and non-local symbols. It had NumLocals member
      variable, but that variable didn't have a number of local symbols but
      had some value that I cannot describe easily.
      
      This patch rewrites SynbolTableSection::finalizeContents and
      SymbolTableSection::writeTo to make it easy to understand. NumLocals
      member variable has been removed, and writeGlobalSymbols and
      writeLocalSymbols have been merged into one function.
      
      There's still a piece of code that I think unnecessary. I'm not removing
      that code in this patch, but will do in a follow-up patch.
      
      llvm-svn: 296423
      1f032537
  3. Feb 27, 2017
  4. Feb 24, 2017
  5. Feb 23, 2017
  6. Feb 16, 2017
    • Rui Ueyama's avatar
      Add CopyRelSection instances to BSS in the regular way. · da5cc846
      Rui Ueyama authored
      Previously, space in a BSS section for copy relocations are reserved
      in a special way. We directly manipulated size of the BSS section.
      r294577 changed the way of doing it. Now, we create an instance of
      CopyRelSection (which is a synthetic input section) for each copy
      relocation.
      
      This patch removes the remains of the old way and add CopyRelSections
      to BSS sections using `addSections` function, which is the usual
      way to add an input section to an output section.
      
      llvm-svn: 295278
      da5cc846
    • Rafael Espindola's avatar
      Addends should always be signed. · 7386ceac
      Rafael Espindola authored
      In the target dependent code we already always return a int64_t. In
      the target independent code we carefully use uintX_t, which has the
      same result given 2 complement rules.
      
      This just simplifies the code to use int64_t everywhere.
      
      llvm-svn: 295263
      7386ceac
  7. Feb 15, 2017
  8. Feb 09, 2017
    • Peter Smith's avatar
      [ELF] Refactor PltSection and IPltSection into PltSection [NFC] · f09245a6
      Peter Smith authored
          
      Much of the code in PltSection and IPltSection is similar, we identify
      the IPlt by a HeaderSize of 0 and alter our behaviour in the member
      functions appropriately:
      -Iplt does not have a header
      -Iplt always follows after the Plt
          
      Differential Revision: https://reviews.llvm.org/D29664
      
      llvm-svn: 294579
      f09245a6
    • Peter Smith's avatar
      [ELF] Use synthetic section to hold copy relocation · ebfe9941
      Peter Smith authored
          
      When we need a copy relocation we create a synthetic SHT_NOBITS
      section that contains the right amount of ZI and assign it to either
      .bss or .rel.ro.bss as appropriate. This allows the dynamic relocation
      to be placed on the InputSection, removing the last case where a
      dynamic relocation is stored as an offset from the OutputSection. This
      has the side effect that we can run assignOffsets() after scanRelocs()
      without losing the additional ZI needed for the copy relocations.
      
      Differential Revision: https://reviews.llvm.org/D29637
      
      llvm-svn: 294577
      ebfe9941
  9. Feb 03, 2017
    • Rafael Espindola's avatar
      Replace MergeOutputSection with a synthetic section. · 9e9754b5
      Rafael Espindola authored
      With a synthetic merge section we can have, for example, a single
      .rodata section with stings, fixed sized constants and non merge
      constants.
      
      I can be simplified further by not setting Entsize, but that is
      probably better done is a followup patch.
      
      This should allow some cleanup in the linker script code now that
      every output section command maps to just one output section.
      
      llvm-svn: 294005
      9e9754b5
  10. Feb 01, 2017
    • Peter Smith's avatar
      [ELF] Use SyntheticSections for Thunks · 3a52eb00
      Peter Smith authored
          
      Thunks are now implemented by redirecting the relocation to the
      symbol S, to a symbol TS in a Thunk. The Thunk will transfer control
      to S. This has the following implications:
      - All the side-effects of Thunks happen within createThunks()
      - Thunks are no longer stored in InputSections and Symbols no longer
        need to hold a pointer to a Thunk
      - The synthetic Thunk sections need to be merged into OutputSections
          
      This implementation is almost a direct conversion of the existing
      Thunks with the following exceptions:
      - Mips LA25 Thunks are placed before the InputSection that defines
        the symbol that needs a Thunk.
      - All ARM Thunks are placed at the end of the OutputSection of the
        first caller to the Thunk.
          
      Range extension Thunks are not supported yet so it is optimistically
      assumed that all Thunks can be reused.
      
      This is a recommit of r293283 with a fixed comparison predicate as
      std::merge requires a strict weak ordering.
      
      Differential revision: https://reviews.llvm.org/D29327
      
      llvm-svn: 293757
      3a52eb00
  11. Jan 28, 2017
  12. Jan 27, 2017
    • Peter Smith's avatar
      [ELF][ARM] Use SyntheticSections for Thunks · 5191c6f9
      Peter Smith authored
          
      Thunks are now implemented by redirecting the relocation to the
      symbol S, to a symbol TS in a Thunk. The Thunk will transfer control
      to S. This has the following implications:
      - All the side-effects of Thunks happen within createThunks()
      - Thunks are no longer stored in InputSections and Symbols no longer
        need to hold a pointer to a Thunk
      - The synthetic Thunk sections need to be merged into OutputSections
          
      This implementation is almost a direct conversion of the existing
      Thunks with the following exceptions:
      - Mips LA25 Thunks are placed before the InputSection that defines
        the symbol that needs a Thunk.
      - All ARM Thunks are placed at the end of the OutputSection of the
        first caller to the Thunk.
          
      Range extension Thunks are not supported yet so it is optimistically
      assumed that all Thunks can be reused.
      
      Differential Revision:  https://reviews.llvm.org/D29129
      
      llvm-svn: 293283
      5191c6f9
  13. Jan 25, 2017
  14. Jan 24, 2017
  15. Jan 23, 2017
    • George Rimar's avatar
      [ELF] - Stop handling local symbols in a special way. · 190bac5d
      George Rimar authored
      Previously we stored kept locals in a KeptLocalSyms arrays,
      belonged to files.
      
      Patch makes SymbolTableSection to store locals in Symbols member,
      that already present and was used for globals.
      SymbolTableSection already had NumLocals counter member, so change
      itself is trivial.
      
      That allows to simplify handling of -r,
      Body::DynsymIndex is no more used as "symbol table index" for relocatable
      output.
      
      Change was suggested during review of D28773 and opens road for D28612.
      
      Differential revision: https://reviews.llvm.org/D29021
      
      llvm-svn: 292789
      190bac5d
  16. Jan 20, 2017
  17. Dec 15, 2016
  18. Dec 14, 2016
    • Peter Smith's avatar
      [ELF] Accept first SHT_ARM_ATTRIBUTES section · 532bc984
      Peter Smith authored
          
      The eglibc library, as used by Ubuntu 14.04 requires the presence of an
      SHT_ARM_ATTRIBUTES section in for the purposes of checking hard/soft float
      compatibility when dlopen() is used. Unfortunately when the section is not
      present dlopen() fails with a generic could not find file message.
          
      This change makes lld keep the first .ARM.attributes section that it
      encounters and propagates it to the output. This is not a complete
      SHT_ARM_ATTRIBUTES implementation, that would involve reading the contents
      of the section and joining each individual attribute. It should suffice
      for a homogenous build all libraries and executables on the same system
      with a compatible set of command line options.
      
      Differential revision: https://reviews.llvm.org/D27718
      
      llvm-svn: 289642
      532bc984
  19. Dec 12, 2016
  20. 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
  21. Nov 29, 2016
Loading