Skip to content
  1. Jul 05, 2017
    • Peter Smith's avatar
      [ELF] Allow multiple thunks to be added for a symbol. · fa237642
      Peter Smith authored
      This change permits there to be more than one thunk to be associated with
      a symbol. For interworking thunks we only require one thunk, but range
      extension thunks may require more than one.
      
      Differential Revision: https://reviews.llvm.org/D34037
      
      llvm-svn: 307136
      fa237642
    • Peter Smith's avatar
      [ELF] Introduce Thunk reuse compatibility · 7d66e849
      Peter Smith authored
      On ARM the interworking thunks are only produced for branch instructions
      that can't be changed into a blx instruction so only Thumb callers would
      call Thumb thunks and only ARM callers would call ARM thunks. With range
      extension thunks branch and link instructions may need a Thunk. These
      instructions can be rewritten as a blx and can use either ARM or Thumb
      thunks.
      
      We introduce an isCompatibleWith() function so that a caller can check if
      an existing Thunk is compatible before reusing it.
      
      Differential Revision: https://reviews.llvm.org/D34035
      
      llvm-svn: 307132
      7d66e849
    • Peter Smith's avatar
      [ELF] Extract allocateHeaders() from assignAddresses() · 5aedebff
      Peter Smith authored
      The allocateHeaders() function is called at the end of assignAddresses(), it
      decides whether the ELF header and program header table can be allocated to
      a PT_LOAD program header. As the function alters state, it prevents
      assignAddresses() from being called multiple times.
      
      This change splits out the call to allocateHeaders() from assignAddresses()
      this will permit assignAddresses() to be called while processing range
      extension thunks without trying to allocateHeaders().
      
      Differential Revision: https://reviews.llvm.org/D34344
      
      llvm-svn: 307131
      5aedebff
    • Rafael Espindola's avatar
      Fix PR33635. · cf00d437
      Rafael Espindola authored
      This is a semantic revert of r306036.
      
      We have to change the names, otherwise dynamic relocations will point
      to the wrong name.
      
      llvm-svn: 307110
      cf00d437
  2. Jul 04, 2017
  3. 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
  4. Jun 30, 2017
  5. Jun 29, 2017
  6. 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
  7. 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
  8. Jun 22, 2017
  9. Jun 21, 2017
Loading