Skip to content
  1. Nov 10, 2016
    • George Rimar's avatar
      [ELF] - Implemented --symbol-ordering-file option. · 1a33c0f2
      George Rimar authored
      Patch allows to pass a symbols file to linker.
      LLD will map symbols to sections and sort sections
      in output according to symbol ordering file.
      
      That can help to reduce the startup time and/or
      amount of pagefaults during startup.
      
      Also, interesting benchmark result was produced by Rafael Espíndola. 
      After applying the symbols file for clang he timed compiling 
      X86MCTargetDesc.ii to an object file.  
      
      The page faults went from just
      56,988 to 56,946 since most faults are not in the binary.
      Running time went from 4.403053515 to 4.178112244. 
      The speedup seems to be because of better cache
      locality.
      
      Differential revision: https://reviews.llvm.org/D26130
      
      llvm-svn: 286440
      1a33c0f2
    • Rui Ueyama's avatar
      Add comment and simplify code a bit. NFC. · 35e00751
      Rui Ueyama authored
      llvm-svn: 286422
      35e00751
    • Rui Ueyama's avatar
      Remove an overloaded function to simplify. · 1bdaf3e3
      Rui Ueyama authored
      This version of addRegular is almost identical to the other except
      it lacked "size" parameter.
      
      llvm-svn: 286416
      1bdaf3e3
    • Rafael Espindola's avatar
      Make OutputSectionBase a class instead of class template. · e08e78df
      Rafael Espindola authored
      The disadvantage is that we use uint64_t instad of uint32_t for some
      value in 32 bit files. The advantage is a substantially simpler code,
      faster builds and less code duplication.
      
      llvm-svn: 286414
      e08e78df
  2. Nov 09, 2016
    • Rui Ueyama's avatar
      Simplify parseEmulation. NFC. · 58026af7
      Rui Ueyama authored
      llvm-svn: 286406
      58026af7
    • Rui Ueyama's avatar
      Split OutputSection ctor. NFC. · df5d14d6
      Rui Ueyama authored
      llvm-svn: 286405
      df5d14d6
    • Simon Atanasyan's avatar
      [ELF][MIPS] Attempt to fix buildbot · 93214b70
      Simon Atanasyan authored
      llvm-svn: 286401
      93214b70
    • Simon Atanasyan's avatar
      [ELF][MIPS] Convert .MIPS.abiflags section to synthetic input section · fa03b0fa
      Simon Atanasyan authored
      Previously, we have both input and output section for .MIPS.abiflags.
      Now we have only one class for .MIPS.abiflags, which is MipsAbiFlagsSection.
      This class is a synthetic input section.
      
      .MIPS.abiflags sections are handled as regular sections until
      the control reaches Writer. Writer then aggregates all sections
      whose type is SHT_MIPS_ABIFLAGS to create a single synthesized
      input section. The synthesized section is then processed normally
      as if it came from an input file.
      
      llvm-svn: 286398
      fa03b0fa
    • Simon Atanasyan's avatar
      [ELF][MIPS] Convert .reginfo and .MIPS.options sections to synthetic input sections · ce02cf00
      Simon Atanasyan authored
      Previously, we have both input and output sections for .reginfo and
      .MIPS.options. Now for each such sections we have one synthetic input
      sections: MipsReginfoSection and MipsOptionsSection respectively.
      
      Both sections are handled as regular sections until the control reaches
      Writer. Writer then aggregates all sections whose type is SHT_MIPS_REGINFO
      or SHT_MIPS_OPTIONS to create a single synthesized input section. In that
      moment Writer also save GP0 value to the MipsGp0 field of the corresponding
      ObjectFile. This value required for R_MIPS_GPREL16 and R_MIPS_GPREL32
      relocations calculation.
      
      Differential revision: https://reviews.llvm.org/D26444
      
      llvm-svn: 286397
      ce02cf00
    • Rafael Espindola's avatar
      Make Discarded a InputSection. · 6ff570a3
      Rafael Espindola authored
      It was quite confusing that it had SectionKind of Regular, but was not
      actually a InputSection.
      
      llvm-svn: 286379
      6ff570a3
    • George Rimar's avatar
      [ELF] - Add separate form for -R alias. · 470de711
      George Rimar authored
      During link of devel/chrpath (FreeBSD port), found next issue:
      /usr/bin/ld: error: unclosed comment in a linker script
      /usr/bin/ld: error: line 1: unknown directive: �
      /usr/bin/ld: error: ��
      
      Problem was not obvious and the reason was that we did not accept
      the separate form of -R. While invocation line contained it:
      cc -Wl,-R /usr/local/lib -o prog prog.c
      
      CPIO file produced contained /usr/local/lib file. 
      Which looks because of reasons above
      contained inside the content of whole lib folder, 
      and it then was passed as an input and
      proccessed as linker script.
      
      llvm-svn: 286378
      470de711
    • Rafael Espindola's avatar
      Add a convenience getObj method. NFC. · 77dbe9a4
      Rafael Espindola authored
      llvm-svn: 286370
      77dbe9a4
    • Peter Smith's avatar
      [ELF] ARM and AArch64 undefined weak reference values · 8339bbd7
      Peter Smith authored
          
      The ARM 32 and 64-bit ABI does not use 0 for undefined weak references
      that are used in PC relative relocations. In particular:
      - A branch relocation to an undefined weak resolves to the next
        instruction. Effectively making the branch a no-op
      - In all other cases the symbol resolves to the place so that S + A - P
        resolves to A.
      
      Differential Revision: https://reviews.llvm.org/D26240
      
      llvm-svn: 286353
      8339bbd7
    • George Rimar's avatar
      [ELF] - Ignore -stats command line option. · 25143dfd
      George Rimar authored
      llvm-svn: 286348
      25143dfd
    • 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
  3. Nov 08, 2016
  4. Nov 07, 2016
  5. Nov 06, 2016
  6. Nov 05, 2016
    • Simon Atanasyan's avatar
      [ELF][MIPS] N32 ABI support · 9e0297b8
      Simon Atanasyan authored
      In short the patch introduces support for linking object file conform
      MIPS N32 ABI [1]. This ABI is similar to N64 ABI but uses 32-bit
      pointer size.
      
      The most non-trivial requirement of this ABI is one more relocation
      packing format. N64 ABI puts multiple relocation type into the single
      relocation record. The N32 ABI uses series of successive relocations
      with the same offset for this purpose. In this patch, new function
      `mergeMipsN32RelTypes` handle this case and "convert" N32 relocation to
      the N64 relocation so the rest of the code keep unchanged.
      
      For now, linker does not support series of relocations applied to sections
      without SHF_ALLOC bit. Probably later I will add the support or insert
      some sort of assert into the `relocateNonAlloc` routine to catch this
      case.
      
      [1] ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/MIPS-N32-ABI-Handbook.pdf
      
      Differential revision: https://reviews.llvm.org/D26298
      
      llvm-svn: 286052
      9e0297b8
    • Rui Ueyama's avatar
      Create a vector containing all input sections. · 8c6a5aaf
      Rui Ueyama authored
      Previously, we do this piece of code to iterate over all input sections.
      
        for (elf::ObjectFile<ELFT> *F : Symtab.getObjectFiles())
          for (InputSectionBase<ELFT> *S : F->getSections())
      
      It turned out that this mechanisms doesn't work well with synthetic
      input sections because synthetic input sections don't belong to any
      input file.
      
      This patch defines a vector that contains all input sections including
      synthetic ones.
      
      llvm-svn: 286051
      8c6a5aaf
    • Eugene Zelenko's avatar
  7. Nov 04, 2016
    • Rui Ueyama's avatar
      Don't gc .interp section. · a9ee8d6e
      Rui Ueyama authored
      This change fixes a bug that was introduced by r285851.
      r285851 converted .interp section as an output section to an input
      section. But I forgot to make it a "Live" section, so if -gc-section
      is given, it was garbage collected.
      
      llvm-svn: 286025
      a9ee8d6e
Loading