Skip to content
  1. Feb 16, 2017
    • Rui Ueyama's avatar
      Removes a trivial accessor. · f829e8c9
      Rui Ueyama authored
      llvm-svn: 295288
      f829e8c9
    • Rui Ueyama's avatar
      Do not overload a one-bit variable, NeedsCopyOrPltAddr. · 924b361d
      Rui Ueyama authored
      This patch removes NeedsCopyOrPltAddr and instead add two variables,
      NeedsCopy and NeedsPltAddr. This uses one more bit in Symbol class,
      but the actual size doesn't increase because we had unused bits.
      This should improve code readability.
      
      llvm-svn: 295287
      924b361d
    • Rui Ueyama's avatar
      Add comments. · 26ad0570
      Rui Ueyama authored
      llvm-svn: 295283
      26ad0570
    • Rui Ueyama's avatar
      Split a function and add comments. · 750c11c0
      Rui Ueyama authored
      This is slightly inefficient than the previous code, but that is really
      negligible as this function is usually called at most only a few times.
      
      llvm-svn: 295282
      750c11c0
    • Rui Ueyama's avatar
      Add comments. · dec4ab0d
      Rui Ueyama authored
      llvm-svn: 295280
      dec4ab0d
    • Rui Ueyama's avatar
      Add CopyRelSection instances to BSS in the regular way. · da5cc846
      Rui Ueyama authored
      Previously, space in a BSS section for copy relocations are reserved
      in a special way. We directly manipulated size of the BSS section.
      r294577 changed the way of doing it. Now, we create an instance of
      CopyRelSection (which is a synthetic input section) for each copy
      relocation.
      
      This patch removes the remains of the old way and add CopyRelSections
      to BSS sections using `addSections` function, which is the usual
      way to add an input section to an output section.
      
      llvm-svn: 295278
      da5cc846
    • Rafael Espindola's avatar
      Addends should always be signed. · 7386ceac
      Rafael Espindola authored
      In the target dependent code we already always return a int64_t. In
      the target independent code we carefully use uintX_t, which has the
      same result given 2 complement rules.
      
      This just simplifies the code to use int64_t everywhere.
      
      llvm-svn: 295263
      7386ceac
  2. 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
    • Rui Ueyama's avatar
      Simplify operator tests. · a4601b5d
      Rui Ueyama authored
      llvm-svn: 295222
      a4601b5d
    • Rui Ueyama's avatar
      Rename a test as they are tests for operators. · fd5edff8
      Rui Ueyama authored
      llvm-svn: 295221
      fd5edff8
    • George Rimar's avatar
      [ELF] - Fix relocation-group.test · 2c29b403
      George Rimar authored
      Main intention of test was to check that 
      we do not crash, but for additional check
      it previously run readobj for input object
      instead of output.
      
      llvm-svn: 295161
      2c29b403
    • 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
  3. Feb 14, 2017
  4. Feb 13, 2017
  5. 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
  6. Feb 10, 2017
    • Rafael Espindola's avatar
      Relax tests a bit. · 7f0e6348
      Rafael Espindola authored
      The values being tested were not relevant to the test.
      
      llvm-svn: 294776
      7f0e6348
    • 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
    • Bob Haarman's avatar
      added missing "savetemps/" in test/COFF/savetemps.ll · c87da867
      Bob Haarman authored
      llvm-svn: 294664
      c87da867
    • Hans Wennborg's avatar
      Don't try to link to the 4.0 release notes · 36bcf8ca
      Hans Wennborg authored
      llvm-svn: 294659
      36bcf8ca
  7. Feb 09, 2017
Loading