Skip to content
  1. Jul 04, 2017
  2. Jul 03, 2017
    • Rafael Espindola's avatar
      fix msvc build · 43ee3604
      Rafael Espindola authored
      llvm-svn: 307044
      43ee3604
    • Rafael Espindola's avatar
      Move clearOutputSections earlier. · c080ff64
      Rafael Espindola authored
      Now removeUnusedSyntheticSections operates entirely on the linker
      script.
      
      llvm-svn: 307043
      c080ff64
    • George Rimar's avatar
      [ELF] - Simplify allocateHeaders(). NFC. · d971e703
      George Rimar authored
      * Return type changed to void, because it was unused.
      * std::find_if -> llvm::find_if
      
      llvm-svn: 307039
      d971e703
    • Petr Hosek's avatar
      [ELF] Remove unused synthetic sections from script commands · 52db9a4f
      Petr Hosek authored
      Script commands are processed before unused synthetic sections are
      removed. Therefore, if a linker script matches one of these sections
      it'll get emitted as an empty output section because the logic for
      removing unused synthetic sections ignores script commands which
      could have already matched and captured one of these sections. This
      patch fixes that by also removing the unused synthetic sections from
      the script commands.
      
      Differential Revision: https://reviews.llvm.org/D34800
      
      llvm-svn: 307037
      52db9a4f
    • Andrew Ng's avatar
      [LLD][LinkerScript] Allow non-alloc sections to be assigned to segments. · a020d348
      Andrew Ng authored
      This patch makes changes to allow sections without the SHF_ALLOC bit to be
      assigned to segments in a linker script.
      
      The assignment of output sections to segments is performed in
      LinkerScript::createPhdrs. Previously, this function would bail as soon as it
      encountered an output section which did not have the SHF_ALLOC bit set, thus
      preventing any output section without SHF_ALLOC from being assigned to a
      segment.
      
      This restriction has now been removed from LinkerScript::createPhdrs and instead
      a check for SHF_ALLOC has been added to LinkerScript::adjustSectionsAfterSorting
      to not propagate program headers to sections without SHF_ALLOC which matches the
      behaviour of bfd linker scripts.
      
      Differential Revision: https://reviews.llvm.org/D34204
      
      llvm-svn: 307013
      a020d348
    • Rui Ueyama's avatar
      Revert r306813: "[ELF] - Resolve references properly when using .symver directive" · 80cbc776
      Rui Ueyama authored
      This reverts commit r306813 because it broke linking of the
      FreeBSD base system.
      
      llvm-svn: 306996
      80cbc776
  3. Jun 30, 2017
  4. Jun 29, 2017
  5. Jun 28, 2017
    • Rui Ueyama's avatar
      Move copy function from Symbol to SymbolBody. · b2269ec4
      Rui Ueyama authored
      We could have add this function either Symbol or SymbolBody. I added it
      to Symbol at first. But I noticed that if I've added it to SymbolBody,
      we could've removed SymbolBody::setName(). So I'll do that in this patch.
      
      llvm-svn: 306590
      b2269ec4
    • Rui Ueyama's avatar
      Define Symbol::copyBody function. · 8e11b6d9
      Rui Ueyama authored
      This patch adds a utility function to Symbol. This function should
      be useful in https://reviews.llvm.org/D33680 too.
      
      llvm-svn: 306587
      8e11b6d9
    • Rui Ueyama's avatar
      Add basic 64-bit SPARC support · 0cc14835
      Rui Ueyama authored
      Add support for the most common SPARC relocations.
      Make DT_PLTGOT point to the PLT on SPARC.
      Mark the PLT as executable on SPARC.
      
      This adds a basic test that creates a SPARV9 executable
      that invokes the exit system call on OpenBSD.
      
      Patch by Mark Kettenis.
      
      Differential Revision: https://reviews.llvm.org/D34618
      
      llvm-svn: 306565
      0cc14835
    • George Rimar's avatar
      [ELF] - Do not crash when LLD synthesizes output sections with BYTE commands and -r · e0b43df3
      George Rimar authored
      This is PR33596. Previously LLD would crash
      because BYTE command synthesized output section,
      but it was not assigned to Sec member of OutputSectionCommand.
      
      Behaviour of -script and -r combination is not well defined,
      but it seems after this change LLD naturally inherits behavior of
      GNU linkers - creates output section requested in script and does not
      crash anymore.
      
      Differential revision: https://reviews.llvm.org/D34676
      
      llvm-svn: 306527
      e0b43df3
    • George Rimar's avatar
      [ELF] - Do not set st_size field of SHT_UNDEF symbols. · dbe843d6
      George Rimar authored
      This fixes PR33598.
      
      Size field for undefined symbols is not significant.
      Setting it to fixed value, like zero, may be useful though.
      
      For example when we have 2 DSO's, like in this PR, if lower level DSO may
      change slightly (in part of some symbol's st_size)  and higher-level DSO is
      rebuilt, then tools that monitoring checksum of high level DSO file can notice
      it and trigger cascade of some other unnecessary actions. 
      If we set st_size to zero, that can be avoided.
      
      Differential revision: https://reviews.llvm.org/D34673
      
      llvm-svn: 306526
      dbe843d6
    • Peter Smith's avatar
      [ELF] Consolidate .ARM.extab.* sections into .ARM.extab · 691ff766
      Peter Smith authored
      When -ffunction-sections and ARM C++ exceptions are used each .text.suffix
      section will have at least one .ARM.exidx.suffix section and may have an
      additional .ARM.extab.suffix section if the unwinding instructions are too
      large to inline into the .ARM.exidx table entry. For a large program without
      a linker script this can lead to a large number of section header table
      entries that can increase the size of the ELF file.
      
      This change introduces a default rule for .ARM.extab.* to be placed in
      a single output section called .ARM.extab . This follows the behavior of
      ld.gold and ld.bfd.
      
      fixes pr33407
      
      Differential Revision: https://reviews.llvm.org/D34678
      
      llvm-svn: 306522
      691ff766
  6. Jun 26, 2017
    • Rui Ueyama's avatar
      Add trap instructions for ARM and MIPS. · 921d43fb
      Rui Ueyama authored
      This patch fills holes in executable sections with 0xd4 (ARM) or
      0xef (MIPS). These trap instructions were suggested by Theo de Raadt.
      
      llvm-svn: 306322
      921d43fb
    • Rui Ueyama's avatar
      Move `assert` upwards so that it fails early if it fails. · 82143d3f
      Rui Ueyama authored
      llvm-svn: 306308
      82143d3f
    • Rui Ueyama's avatar
      Remove confusing `return`. · 71fab2f0
      Rui Ueyama authored
      `addInputSec` returns void. Even though it is syntactically correct,
      the use of `return` here is just confusing.
      
      llvm-svn: 306307
      71fab2f0
    • Rui Ueyama's avatar
      Add GlobalOffsetTable to ElfSym. NFC. · 92c37819
      Rui Ueyama authored
      Most "reserved" symbols are in ElfSym and it looks like there's no
      reason to not do the same thing for _GLOBAL_OFFSET_TABLE_. This should
      help https://reviews.llvm.org/D34618 too.
      
      llvm-svn: 306292
      92c37819
    • Peter Smith's avatar
      [ELF] Define _GLOBAL_OFFSET_TABLE_ symbol relative to .got · 113a59e7
      Peter Smith authored
      On many architectures gcc and clang will recognize _GLOBAL_OFFSET_TABLE_ - .
      and produce a relocation that can be processed without needing to know the
      value of _GLOBAL_OFFSET_TABLE_. This is not always the case; for example ARM
      gcc produces R_ARM_BASE_PREL but clang produces the more general
      R_ARM_REL32 to _GLOBAL_OFFSET_TABLE_. To evaluate this relocation
      correctly _GLOBAL_OFFSET_TABLE_ must be defined to be the either the base of
      the GOT or end of the GOT dependent on architecture..
      
      If/when llvm-mc is changed to recognize _GLOBAL_OFFSET_TABLE_ - . this
      change will not be necessary for new objects. However there may still be
      old objects and versions of clang.
      
      Differential Revision: https://reviews.llvm.org/D34355
      
      llvm-svn: 306282
      113a59e7
  7. Jun 22, 2017
  8. Jun 21, 2017
  9. Jun 20, 2017
    • Sam Clegg's avatar
      Fix argument numbersing in OPTION macro · 7859216b
      Sam Clegg authored
      The option numbers in the macro were off by one which
      leads to some confusion.  There are actually 12 arguments
      to this macro.
      
      Differential Revision: https://reviews.llvm.org/D34413
      
      llvm-svn: 305823
      7859216b
    • Yuka Takahashi's avatar
      [GSoC] Flag value completion for clang · ba5d4af4
      Yuka Takahashi authored
      This is patch for GSoC project, bash-completion for clang.
      
      To use this on bash, please run `source clang/utils/bash-autocomplete.sh`.
      bash-autocomplete.sh is code for bash-completion.
      
      In this patch, Options.td was mainly changed in order to add value class
      in Options.inc.
      
      llvm-svn: 305805
      ba5d4af4
    • Rafael Espindola's avatar
      Prefer -Ttext over linker script values. · 9c0395e3
      Rafael Espindola authored
      I found this while trying to build u-boot. It uses -Ttext in
      combination with linker scripts.
      
      My first reaction was to change the linker scripts to have the correct
      value, but I found that it is actually quite convenient to have -Ttext
      take precedence.
      
      By having just
      
      .text : { *(.text) }
      
      In the script, they can define the text address in a single Makefile
      and pass it to ld with -Ttext and for the C code with
      -DFoo=value. Doing the same with linker scripts would require them to
      be generated during the build.
      
      llvm-svn: 305766
      9c0395e3
  10. Jun 19, 2017
    • Konstantin Zhuravlyov's avatar
      LLD: Move ELF/Mips.cpp to ELF/Arch/MipsArchTree.cpp · f3e3629f
      Konstantin Zhuravlyov authored
      Differential Revision: https://reviews.llvm.org/D34358
      
      llvm-svn: 305742
      f3e3629f
    • Andrew Ng's avatar
      [LLD][LinkerScript] Add support for segment NONE. · 6e9f98c1
      Andrew Ng authored
      This patch adds support for segment NONE in linker scripts which enables the
      specification that a section should not be assigned to any segment.
      
      Note that GNU ld does not disallow the definition of a segment named NONE, which
      if defined, effectively overrides the behaviour described above. This feature
      has been copied.
      
      Differential Revision: https://reviews.llvm.org/D34203
      
      llvm-svn: 305700
      6e9f98c1
    • James Henderson's avatar
      [ELF] Emit only one error if -z max-page-size without value · 38e67e82
      James Henderson authored
      In r305364, Rui changed the mechanism that parses -z option values slightly.
      This caused a bug, as demonstrated by this test, which now fails:
      
      ---
      # REQUIRES: x86
      # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
      # RUN: ld.lld %t.o -o %t -z max-page-size
      
      .global _start
      _start:
        nop
      ---
      
      Before, the link succeeded and set the max-page-size to the target default.
      
      After we get the following two error messages:
      "invalid max-page-size: "
      "max-page-size: value isn't a power of 2"
      
      The latter error is because an uninitialised variable ends up being passed back
      to getMaxPageSize).
      
      This change ensures we only get the first error.
      
      Reviewers: ruiu
      
      Differential Revision: https://reviews.llvm.org/D34234
      
      llvm-svn: 305679
      38e67e82
    • Peter Smith's avatar
      [ELF] make default for get{ARM,AArch64}UndefinedRelativeWeakVA unreachable · 9873c4b5
      Peter Smith authored
          
      The get{ARM,AArch64}UndefinedRelativeWeakVA() functions should only be
      called for PC-relative relocations. Complete the supported pc-relative
      relocations in the switch statement and make the default case unreachable.
      
      The R_ARM_TARGET relocation can be evaluated as R_ARM_REL32 but it is only
      used in the context of exception tables, and is never output with respect
      to a weak reference so it does not appear in the switch statement.
          
      Differential Revision: https://reviews.llvm.org/D34138
      
      llvm-svn: 305673
      9873c4b5
  11. Jun 17, 2017
Loading