Skip to content
  1. May 31, 2017
    • Rafael Espindola's avatar
      Store a single Parent pointer for InputSectionBase. · db5e56f7
      Rafael Espindola authored
      Before InputSectionBase had an OutputSection pointer, but that was not
      always valid. For example, if it was a merge section one actually had
      to look at MergeSec->OutSec.
      
      This was brittle and caused bugs like the one fixed by r304260.
      
      We now have a single Parent pointer that points to an OutputSection
      for InputSection, but to a SyntheticSection for merge sections and
      .eh_frame. This makes it impossible to accidentally access an invalid
      OutSec.
      
      llvm-svn: 304338
      db5e56f7
  2. May 18, 2017
    • Rafael Espindola's avatar
      Alternative way to detemplate GotSection. · a6465bbb
      Rafael Espindola authored
      GetSection is a template because write calls relocate.
      
      relocate has two parts. The non alloc code really has to be a
      template, as it is looking a raw input file data.
      
      The alloc part is only a template because of getSize.
      
      This patch folds the value of getSize early, detemplates
      getRelocTargetVA and splits relocate into a templated non alloc case
      and a regular function for the alloc case. This has the nice advantage
      of making sure we collect all the information we need for relocations
      before getting to InputSection::relocateNonAlloc.
      
      Since we know got is alloc, it can just call the function directly and
      avoid the template.
      
      llvm-svn: 303355
      a6465bbb
  3. May 17, 2017
  4. May 12, 2017
  5. May 11, 2017
  6. May 05, 2017
    • Rafael Espindola's avatar
      Remove isTlsLocalDynamicRel and isTlsInitialExecRel. · 81273c72
      Rafael Espindola authored
      This feels a bit hackish, but I think it is still an improvement.
      
      The way a tls address is computed in the various architectures is not
      that different. For example, for local dynamic we need the base of the
      tls (R_TLSLD or R_TLSLD_PC), and the offset of that particular symbol
      (R_ABS).
      
      Given the similarity, we can just use the expressions instead of
      having two additional target hooks.
      
      llvm-svn: 302279
      81273c72
  7. May 03, 2017
    • Rui Ueyama's avatar
      Accept archive files with no symbol table instad of warning on them. · fd7deda5
      Rui Ueyama authored
      It seems virtually everyone who tries to do LTO build with Clang and
      LLD was hit by a mistake to forget using llvm-ar command to create
      archive files. I wasn't an exception. Since this is an annoying common
      issue, it is probably better to handle that gracefully rather than
      reporting an error and tell the user to redo build with different
      configuration.
      
      Differential Revision: https://reviews.llvm.org/D32721
      
      llvm-svn: 302083
      fd7deda5
  8. Apr 13, 2017
  9. Apr 08, 2017
    • George Rimar's avatar
      [ELF] - Stop producing broken output for R_386_GOT32[X] relocations. · e7bf9688
      George Rimar authored
      Previously we silently produced broken output for R_386_GOT32X/R_386_GOT32 
      relocations if they were used to compute the address of the symbol’s global
      offset table entry without base register when position-independent code is disabled.
      
      Situation happened because of recent ABI changes. Released ABI mentions that
      R_386_GOT32X can be calculated in a two different ways (so we did not follow ABI here 
      before this patch), but draft ABI also mentions R_386_GOT32 relocation here. 
      We should use the same calculations for both relocations.
      
      Problem is that we always calculated them as G + A - GOT (offset from end of GOT),
      but for case when PIC is disabled, according to i386 ABI calculation should be G + A,
      what should produce just an address in GOT finally.
      
      ABI: https://github.com/hjl-tools/x86-psABI/wiki/intel386-psABI-draft.pdf (p36, p60).
      llvm-svn: 299812
      e7bf9688
  10. Apr 07, 2017
  11. Apr 06, 2017
    • Rui Ueyama's avatar
      Create GOT and PLT entries early in scanRelocs(). · 5036cc67
      Rui Ueyama authored
      scanRelocs() does a lot of things. It fills InputSection's Relocations vector,
      making a decision whether a TLS relocation should be relaxed or not,
      and making a decision whether a GOT/PLT slot needs to be created or not.
      
      They don't actually have to be done in a single loop. I want to separate
      them so that some of them can be run concurently. As a first step, this
      patch moves PLT/GOT slot assignment to beginning of the loop, so that
      they just fall through to the next statements. This should make it clear
      that that code doesn't affect other parts of the loop.
      
      llvm-svn: 299615
      5036cc67
    • Rui Ueyama's avatar
      Remove Target::isTlsGlobalDynamicRel() · c2a49bf9
      Rui Ueyama authored
      Relocations are abstracted as platform-independent R_TLS_* relocations,
      so we don't need to check platform-specific ones to see if a relocation
      is TLS GD.
      
      llvm-svn: 299614
      c2a49bf9
  12. Apr 05, 2017
    • Peter Smith's avatar
      [ELF] Make createThunks a class [NFC] · 56abf209
      Peter Smith authored
          
      For range extension thunks we will need to repeatedly call createThunks()
      until no more thunks are created. We will need to retain the state of
      Thunks that we have created so far to avoid recreating them on later
      passes. This change does not change the functionality of createThunks().
      
      Differential Revision: https://reviews.llvm.org/D31654
      
      llvm-svn: 299530
      56abf209
  13. Apr 03, 2017
    • Rui Ueyama's avatar
      Change the error message format for an incompatible relocation. · 6ea72527
      Rui Ueyama authored
      Previous error message style:
      
        error: /home/alice/src/bar.c:12: relocation R_X86_64_PLT32 cannot refer to absolute symbol 'answer' defined in /home/alice/src/foo.o
      
      New error message style:
      
        error: relocation R_X86_64_PLT32 cannot refer to absolute symbol: foo
        >>> defined in /home/alice/src/foo.o
        >>> referenced by bar.c:12 (/home/alice/src/bar.c:12)
        >>>               /home/alice/src/bar.o:(.text+0x1)
      
      llvm-svn: 299390
      6ea72527
  14. Mar 31, 2017
  15. Mar 30, 2017
  16. Mar 29, 2017
  17. Mar 27, 2017
    • Rui Ueyama's avatar
      Simplify. NFC. · ceb5bd59
      Rui Ueyama authored
      This patch calls getAddend on a relocation only when the relocation is RELA.
      That doesn't really improve runtime performance but should improve
      readability as the code now matches the function description.
      
      llvm-svn: 298828
      ceb5bd59
  18. Mar 26, 2017
Loading