Skip to content
  1. Nov 23, 2016
  2. Nov 22, 2016
  3. Nov 21, 2016
  4. Nov 18, 2016
  5. Nov 17, 2016
  6. Nov 16, 2016
  7. Nov 15, 2016
  8. Nov 14, 2016
  9. Nov 11, 2016
    • Rafael Espindola's avatar
      Don't sort sections in -r links. · 1960bcd7
      Rafael Espindola authored
      Unlike gold, bfd, gas or MC we were putting exidx sections first since
      they are ro.
      
      The spec doesn't explicitly say that they must come after, but it is
      definitely more convenient for the consumer, matches other producers
      and matches other areas in ELF (like SHT_GROUP) where sections are
      ordered in a natural way.
      
      llvm-svn: 286659
      1960bcd7
    • Rafael Espindola's avatar
      Avoid a crash with -r and .comment. · d4372f78
      Rafael Espindola authored
      We would create a MergeInputSection for the synthetic .comment and
      crash trying to add it to a regular output section.
      
      With this we just don't add the synthetic section with -r. That is
      consistent with gold that doesn't create .note.gnu.gold-version with
      -r.
      
      llvm-svn: 286635
      d4372f78
    • Eugene Leviant's avatar
      [ELF] Convert .got section to input section · ad4439e8
      Eugene Leviant authored
      Differential revision: https://reviews.llvm.org/D26498
      
      llvm-svn: 286580
      ad4439e8
  10. Nov 10, 2016
    • Rui Ueyama's avatar
      Include version string into ".comment" section. · 3da3f06d
      Rui Ueyama authored
      Summary:
      This patch adds a ".comment" section to an output. The comment
      section contains the linker's version string. You can now
      find out whether a binary is created by LLD or not using objdump
      command like this.
      
        $ objdump -s -j .comment foo
      
        foo:     file format elf64-x86-64
      
        Contents of section .comment:
         0000 00474343 3a202855 62756e74 7520342e  .GCC: (Ubuntu 4.
         0010 382e342d 32756275 6e747531 7e31342e  8.4-2ubuntu1~14.
         ...
         00c0 766d2f74 72756e6b 20323835 38343629  vm/trunk 285846)
         00d0 004c696e 6b65723a 204c4c44 20342e30  .Linker: LLD 4.0
         00e0 2e302028 7472756e 6b203238 36343036  .0 (trunk 286406
         00f0 2900                                 ).
      
      Compilers emits .comment section as well, so the output contains
      both compiler and linker information.
      
      Alternative considered:
      
      I first tried to add a SHT_NOTE section because GNU gold does that.
      A NOTE section starts with a header which contains content type.
      It turned out that ld.gold sets type NT_GNU_GOLD_VERSION to their
      NOTE section. So the NOTE type is only for GNU gold (surprise!)
      
      Next, I tried to create ".linker-version" section. However, it seems
      that reusing the existing ".comment" section is better because 1)
      other tools already know about .comment section and is able to strip
      it and 2) the result contans not only linker info but also compiler
      info.
      
      Differential Revision: https://reviews.llvm.org/D26487
      
      llvm-svn: 286496
      3da3f06d
    • Rafael Espindola's avatar
      Parse relocations only once. · 9f0c4bb7
      Rafael Espindola authored
      Relocations are the last thing that we wore storing a raw section
      pointer to and parsing on demand.
      
      With this patch we parse it only once and store a pointer to the
      actual data.
      
      The patch also changes where we store it. It is now in
      InputSectionBase. Not all sections have relocations, but most do and
      this simplifies the logic. It also means that we now only support one
      relocation section per section. Given that that constraint is
      maintained even with -r with gold bfd and lld, I think it is OK.
      
      llvm-svn: 286459
      9f0c4bb7
    • Eugene Leviant's avatar
      [ELF] Convert .got.plt section to input section · 41ca327b
      Eugene Leviant authored
      Differential revision: https://reviews.llvm.org/D26349
      
      llvm-svn: 286443
      41ca327b
    • 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
Loading