Skip to content
  1. Feb 15, 2017
    • Ed Schouten's avatar
      Make --export-dynamic work on non-PIC/PIE targets. · 3bf71304
      Ed Schouten authored
      For CloudABI I'm only interested in generating non-PIC/PIE executables
      on armv6 and i686, as PIE introduces larger overhead than on aarch64 and
      x86_64. Still, I want to be able to instruct the linker to generate a
      dynamic symbol table if requested. One example use for this is that
      dynamic symbol tables can be used by programs to print nicely formatted
      stacktraces, including symbol names.
      
      Right now there seems to be some logic in LLD that it only wants to emit
      dynamic symbol tables when either linking against libraries or when
      building PIC. Let's extend this to also take --export-dynamic into
      account.
      
      Reviewed by:	ruiu
      Differential Revision:	https://reviews.llvm.org/D29982
      
      llvm-svn: 295240
      3bf71304
    • Rui Ueyama's avatar
      Apply different tokenization rules to linker script expressions. · 731a66ae
      Rui Ueyama authored
      The linker script lexer is context-sensitive. In the regular context,
      arithmetic operator characters are regular characters, but in the
      expression context, they are independent tokens. This afects how the
      lexer tokenizes "3*4", for example. (This kind of expression is real;
      the Linux kernel uses it.)
      
      This patch defines function `maybeSplitExpr`. This function splits the
      current token into multiple expression tokens if the lexer is in the
      expression context.
      
      Differential Revision: https://reviews.llvm.org/D29963
      
      llvm-svn: 295225
      731a66ae
    • Simon Atanasyan's avatar
      [ELF][MIPS] Fix writing updated addend for R_MIPS_GOT16 relocation · 91e30ae2
      Simon Atanasyan authored
      If target of R_MIPS_GOT16 relocation is a local symbol its addend
      is high 16 bits of complete addend. To calculate a final value, the addend
      of this relocation is read, shifted to the left and combined with addend
      of paired R_MIPS_LO16 relocation. To save updated addend when the linker
      produces a relocatable output, we need to store high 16 bits of the
      addend's value. It is different from the case of writing the relocation
      result when the linker saves a 16-bit GOT index as-is.
      
      llvm-svn: 295159
      91e30ae2
    • Rafael Espindola's avatar
      Set the correct r_offset even when creating a R_*_NONE. · d50c8598
      Rafael Espindola authored
      With this lld can use its own -r output when a fde is discarded.
      
      llvm-svn: 295143
      d50c8598
    • Rafael Espindola's avatar
      Make lld able to handle gold's -r output. · f340ca89
      Rafael Espindola authored
      This is still not sufficient for lld to handle its own output when a
      fde points to a discarded section. I am investigating if it is better
      to change the -r output or make lld able to read the current version.
      
      llvm-svn: 295141
      f340ca89
    • Rafael Espindola's avatar
      Handle .eh_frame pointing to discarded section in -r. · 60b02509
      Rafael Espindola authored
      This is a really horrible case. If a .eh_frame points to a discarded
      section, it is not clear what is the correct thing to do.
      
      It looks like ld.bfd discards the entire .eh_frame content and gold
      discards the second relocation, leaving one frame with an fde that
      refers to a bogus location. This is similar to what gold does.
      
      llvm-svn: 295133
      60b02509
    • Rafael Espindola's avatar
      Revert "Relax the restriction on what relocations can be in a non-alloc section." · a8541675
      Rafael Espindola authored
      This reverts commit r295102.
      
      In the link of seabios the assumption seems to be that the section has
      an actual address, so this is not sufficient. Changing the assembly
      code to add a "a" flag seems like the correct thing to do instead of
      extending this hack.
      
      Sorry about the noise.
      
      Original message:
      
          Relax the restriction on what relocations can be in a non-alloc section.
      
          The main thing that they can't have is relocations that require the
          creation of gots or plt.  For now also accept R_PC.
      
          Found while linking seabios.
      
      llvm-svn: 295130
      a8541675
    • Rafael Espindola's avatar
      Fix the st_name of section symbols. · 1b36eeaa
      Rafael Espindola authored
      If it is non-zero then objdump will print an empty name when printing
      relocations against the section.
      
      llvm-svn: 295129
      1b36eeaa
    • Rui Ueyama's avatar
      Explicitly return a new value instead of implicitly mutating a reference. · 35723f09
      Rui Ueyama authored
      I think this is more readable than before.
      
      llvm-svn: 295121
      35723f09
  2. Feb 14, 2017
  3. Feb 13, 2017
  4. Feb 11, 2017
    • Rafael Espindola's avatar
      Create only one section symbol per section. · 08d6a3f1
      Rafael Espindola authored
      Unfortunately some consumers of our .o files produced with -r expect
      only one section symbol per section. That is true of at least of go's
      own linker.
      
      Combining them is a somewhat convoluted process. We have to create a
      symbol for every section since we don't know which ones will be
      needed. The relocation sections also have to be written first to
      handle the Elf_Rel addend.
      
      I did consider a completely different approach:
      
      We could remove the -r special case of relocation sections when
      reading. We would instead have a copyRelocs function that is used
      instead of scanRelocs. It would create a DynamicReloc for each
      relocation and a RelocationSection for each input relocation section.
      
      A complication of such change is that DynamicReloc would have to take
      a section index and a input section instead of a symbol since with
      -emit-relocs some DynamicReloc would hold relocations referring to the
      dynamic symbol table and other to the static symbol table.
      
      That would be a pretty big change, and if we do it it is probably
      better to do it as a refactoring.
      
      llvm-svn: 294816
      08d6a3f1
  5. Feb 10, 2017
    • Eric Fiselier's avatar
      [CMake] Fix pthread handling for out-of-tree builds · 87c87f4c
      Eric Fiselier authored
      LLVM defines `PTHREAD_LIB` which is used by AddLLVM.cmake and various projects
      to correctly link the threading library when needed. Unfortunately
      `PTHREAD_LIB` is defined by LLVM's `config-ix.cmake` file which isn't installed
      and therefore can't be used when configuring out-of-tree builds. This causes
      such builds to fail since `pthread` isn't being correctly linked.
      
      This patch attempts to fix that problem by renaming and exporting
      `LLVM_PTHREAD_LIB` as part of`LLVMConfig.cmake`. I renamed `PTHREAD_LIB`
      because It seemed likely to cause collisions with downstream users of
      `LLVMConfig.cmake`.
      
      llvm-svn: 294690
      87c87f4c
  6. Feb 09, 2017
  7. Feb 08, 2017
  8. Feb 07, 2017
  9. Feb 06, 2017
Loading