Skip to content
  1. Jan 12, 2017
  2. Jan 11, 2017
    • George Rimar's avatar
      [ELF] - Ignore R_386_NONE. · 7fa220f5
      George Rimar authored
      We had an error when met this relocation
      after latest changes aboult listing
      x86 relocations explicitly.
      
      Since we support R_X86_64_NONE,
      and GNU ld supports R_386_NONE,
      it seems reasonable to have.
      
      Differential revision: https://reviews.llvm.org/D28552
      
      llvm-svn: 291672
      7fa220f5
    • George Rimar's avatar
      [ELF] - Explicitly list supported relocations for x86 target. · 57b0e6a5
      George Rimar authored
      Previously some value was returned by default for relocations by getRelExpr(),
      even if relocation actually was not supported.
      
      This is orthogonal alternative to D28094.
      Instead of implementing probably useless R_386_PC8/R_386_8 relocations,
      this patch uses them in a testcase to demonstrate what happens
      when LLD mets unsupported relocations.
      
      Patch passes all testcases and changes logic only for x86.
      
      Differential revision: https://reviews.llvm.org/D28516
      
      llvm-svn: 291658
      57b0e6a5
  3. Jan 06, 2017
  4. 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
  5. Dec 22, 2016
  6. Dec 21, 2016
    • George Rimar's avatar
      [ELF] - Do not call fatal() in Target.cpp, call error() instead. · dcf5b72e
      George Rimar authored
      We probably would want to avoid fatal() if we can in context of librarification,
      but for me reason of that patch is to help D27900 go.
      
      D27900 changes errors reporting to something like
      error: text1
      note: text2
      note: text3
      
      where hint used to provide additional information about location. In that case
      I can't just call fatal() because user will not see notes after that what adds additional complication to handle.
      So It is good to switch fatal() to error() where it is possible.
      
      Also it adds testcase with broken relocation number. 
      Previously we did not have any, It checks that error() instead of fatal() works fine.
      
      Differential revision: https://reviews.llvm.org/D27973
      
      llvm-svn: 290239
      dcf5b72e
    • Rui Ueyama's avatar
      Move a function defintion to make it static. · 6e3595d6
      Rui Ueyama authored
      llvm-svn: 290215
      6e3595d6
  7. Dec 18, 2016
    • Rui Ueyama's avatar
      Remove lld/Support/Memory.h. · 9381eb10
      Rui Ueyama authored
      I thought for a while about how to remove it, but it looks like we
      can just copy the file for now. Of course I'm not happy about that,
      but it's just less than 50 lines of code, and we already have
      duplicate code in Error.h and some other places. I want to solve
      them all at once later.
      
      Differential Revision: https://reviews.llvm.org/D27819
      
      llvm-svn: 290062
      9381eb10
  8. Dec 15, 2016
  9. Dec 13, 2016
    • Peter Smith's avatar
      [ELF] Add R_ARM_RELATIVE to relocations that can be applied to GotSection · d9209999
      Peter Smith authored
          
      When compiling -fpie and linking with the --pie option the R_ARM_GOTBREL
      relocation to D is resolved by writing the value of D into the .got slot
      and emitting an R_ARM_RELATIVE relocation for it.
          
      This changes adds the R_ARM_RELATIVE relocation to the switch in
      relocateOne() so we can process the GotSection relocation to write the
      value of the variable as well as emitting the dynamic relocation.
      
      Differential revision: https://reviews.llvm.org/D27678
      
      llvm-svn: 289527
      d9209999
  10. Dec 09, 2016
    • Rafael Espindola's avatar
      Add support for R_X86_64_GOT64. · 157c51dc
      Rafael Espindola authored
      llvm-svn: 289277
      157c51dc
    • Peter Smith's avatar
      [ELF][I386] .got.plt entries for i386 should use VA of ifunc resolver · 4b360292
      Peter Smith authored
      The i386 glibc ld.so expects the .got.slot entry that is relocated by a 
      R_386_IRELATIVE relocation to point directly at the ifunc resolver and
      not the address of the PLT entry + 6 (thus entering the lazy resolver).
      This is also the case for ARM and I suspect it is because these use REL
      relocations and can't use the addend field to store the address of the
      ifunc resolver. If the lazy resolver is used we get an error message
      stating that only R_386_JUMP_SLOT is supported.
      
      As ARM and i386 share the same code, I've removed the ARM specific test
      and added a writeIgotPlt() function that by default calls writeGotPlt().
      ARM and i386 override this to write the address of the ifunc resolver.
      
      Differential Revision: https://reviews.llvm.org/D27581
      
      llvm-svn: 289198
      4b360292
  11. Dec 08, 2016
  12. Dec 07, 2016
  13. Dec 05, 2016
  14. Dec 03, 2016
    • George Rimar's avatar
      [ELF] - Implemented R_386_16 and R_386PC16 relocations · 1b3d34a2
      George Rimar authored
      A program or object file using R_386_8, R_386_16, R_386_PC16 or R_386_PC8
      relocations is not conformant to latest ABI. The R_386_16, and R_386_8
      relocations truncate the computed value to 16 - bits and 8 - bits
      respectively. R_386_PC16 and R_386_16 are used by some
      applications, for example by FreeBSD loaders.
      
      Previously we did not take addend in account for these relocation,
      counting it as 0, what is wrong and was a reason of hangs.
      
      This patch needed for example for FreeBSD pmbr (protective mbr).
      
      Differential revision: https://reviews.llvm.org/D27303
      
      llvm-svn: 288581
      1b3d34a2
  15. Dec 02, 2016
    • Rafael Espindola's avatar
      Ignore R_X86_64_NONE. · 5708b2f8
      Rafael Espindola authored
      It looks like the way dtrace works is
      
      * The user creates .o files that reference magical symbol names.
      * dtrace reads those files, collecs the info it needs and changes the
        relocation to R_X86_64_NONE expecting the linker to ignore them.
      
      llvm-svn: 288485
      5708b2f8
  16. Nov 29, 2016
    • Peter Smith's avatar
      [ELF] Add support for static TLS to ARM · de3e7388
      Peter Smith authored
      The module index dynamic relocation R_ARM_DTPMOD32 is always 1 for an
      executable. When static linking and when we know that we are not a shared
      object we can resolve the module index relocation statically.
          
      The logic in handleNoRelaxTlsRelocation remains the same for Mips as it
      has its own custom GOT writing code. For ARM we add the module index
      relocation to the GOT when it can be resolved statically.
          
      In addition the type of the RelExpr for the static resolution of TlsGotRel
      should be R_TLS and not R_ABS as we need to include the size of
      the thread control block in the calculation.
          
      Addresses the TLS part of PR30218.
      
      Differential revision: https://reviews.llvm.org/D27213
      
      llvm-svn: 288153
      de3e7388
    • Eugene Leviant's avatar
      [ELF] Refactor target error messages · 84569e6c
      Eugene Leviant authored
      Differential revision: https://reviews.llvm.org/D27097
      
      llvm-svn: 288114
      84569e6c
    • Rafael Espindola's avatar
      Use relocations to fill statically known got entries. · f1e24531
      Rafael Espindola authored
      Right now we just remember a SymbolBody for each got entry and
      duplicate a bit of logic to decide what value, if any, should be
      written for that SymbolBody.
      
      With ARM there will be more complicated values, and it seems better to
      just use the relocation code to fill the got entries. This makes it
      clear that each entry is filled by the dynamic linker or by the static
      linker.
      
      llvm-svn: 288107
      f1e24531
    • Rafael Espindola's avatar
      Sort. NFC. · d3b32df3
      Rafael Espindola authored
      llvm-svn: 288102
      d3b32df3
  17. Nov 25, 2016
  18. Nov 23, 2016
  19. Nov 18, 2016
  20. Nov 16, 2016
    • Simon Atanasyan's avatar
      [ELF][MIPS] Add MipsGotSection to handle MIPS GOT · 725dc14b
      Simon Atanasyan authored
      MIPS GOT handling is very different from other targets so it is better
      to keep the code in the separatre section class MipsGotSection. This
      patch introduces the new section and moves all MIPS specific code from
      GotSection to the new class. I did not rename fields and methods in the
      MipsGotSection class to reduce the diff and plan to do that by the
      separate commit.
      
      Differential revision: https://reviews.llvm.org/D26733
      
      llvm-svn: 287150
      725dc14b
  21. Nov 15, 2016
    • Eugene Leviant's avatar
      [ELF] Convert DynamicSection to input section. · 6380ce22
      Eugene Leviant authored
      This patch introduces the following changes:
      - DynamicSection now inherits InputSection<ELFT> and was moved
        to SyntheticSections.h/.cpp.
      - Link and Entsize fields of DynamicSection are propagated to 
        its output section
      - In<ELFT>::SyntheticSections was removed.
      - Finalization of synthetic sections was removed from 
        OutputSection<ELFT>::finalize. Now finalizeSyntheticSections is
        used instead.
      
      Differential revision: https://reviews.llvm.org/D26603
      
      llvm-svn: 286950
      6380ce22
  22. Nov 11, 2016
  23. Nov 10, 2016
Loading