Skip to content
  1. Jun 16, 2017
  2. Jun 15, 2017
    • Rafael Espindola's avatar
      Move clearOutputSections before sortSections. · 383971d2
      Rafael Espindola authored
      This is probably the main patch left in unifying our intermediary
      representation.
      
      It moves the creation of default commands before section sorting. This
      has the nice effect that we now have one location where we decide
      where an orphan section should be placed.
      
      Before this patch sortSections would decide the relative location of
      orphan sections to other sections, but it was up to placeOrphanSection
      to decide on the exact location.
      
      We now only sort sections we created since the linker script is
      already in the correct order.
      
      llvm-svn: 305512
      383971d2
    • Zachary Turner's avatar
      Revert "[llvm-pdbutil] rewrite the "raw" output style." · da504b79
      Zachary Turner authored
      This reverts commit 83ea17ebf2106859a51fbc2a86031b44d33696ad.
      
      This is failing due to some strange template problems, so reverting
      until it can be straightened out.
      
      llvm-svn: 305505
      da504b79
    • Saleem Abdulrasool's avatar
      COFF: add support for lib mode usage · bc7ff702
      Saleem Abdulrasool authored
      When link is invoked with `/def:` and no input files, it behaves as if
      `lib.exe` was invoked.  Emulate this behaviour, generating the import
      library from the def file that was passed.  Because there is no input to
      actually generate the dll, we simply process the def file early and exit
      once we have created the import library.
      
      llvm-svn: 305502
      bc7ff702
    • Zachary Turner's avatar
      [llvm-pdbutil] rewrite the "raw" output style. · b560fdf3
      Zachary Turner authored
      After some internal discussions, we agreed that the raw output style had
      outlived its usefulness. It was originally created before we had even
      thought of dumping to YAML, and it was intended to give us some insight
      into the internals of a PDB file. Now we have YAML mode which does
      almost exactly this but is more powerful in that it can round-trip back
      to a PDB, which the raw mode could not do. So the raw mode had become
      purely a maintenance burden.
      
      One option was to just delete it. However, its original goal was to be
      as readable as possible while staying close to the "metal" - i.e.
      presenting the output in a way that maps directly to the underlying file
      format. We don't actually need that last requirement anymore since it's
      covered by the yaml mode, so we could repurpose "raw" mode to actually
      just be as readable as possible.
      
      This patch implements about 80% of the functionality previously in raw
      mode, but in a completely different style that is more akin to what
      cvdump outputs. Records are very compressed, often times appearing on
      just one line. One nice thing about this is that it makes full record
      matching easier, because you can grep for indices, names, and leaf types
      on a single line often.
      
      See the tests for some examples of what the new output looks like.
      
      Note that this patch actually regresses the functionality of raw mode in
      a few areas, but only because the patch was already unreasonably large
      and going 100% would have been even worse. Specifically, this patch is
      missing:
      
      The ability to dump module debug subsections (checksums, lines, etc)
      The ability to dump section headers
      Aside from that everything is here. While goign through the tests fixing
      them all up, I found many duplicate tests. They've been deleted. In
      subsequent patches I will go through and re-add the missing
      functionality.
      
      Differential Revision: https://reviews.llvm.org/D34191
      
      llvm-svn: 305495
      b560fdf3
    • Petr Hosek's avatar
      [ELF] Mark symbols referenced from linker script as live · 40f2866a
      Petr Hosek authored
      This is necessary to ensure that sections containing symbols referenced
      from linker scripts (e.g. in data commands) don't get GC'd.
      
      Differential Revision: https://reviews.llvm.org/D34195
      
      llvm-svn: 305452
      40f2866a
    • Leslie Zhai's avatar
      [ELF] Initial migration of AVR target · 49ba795d
      Leslie Zhai authored
      Reviewers: ruiu, rafael, grimar, atanasyan, psmith, dylanmckay
      
      Reviewed By: ruiu, rafael, grimar, dylanmckay
      
      Differential Revision: https://reviews.llvm.org/D32991
      
      llvm-svn: 305444
      49ba795d
    • Rui Ueyama's avatar
      Inline a small function. NFC. · 2aecdde5
      Rui Ueyama authored
      llvm-svn: 305428
      2aecdde5
  3. Jun 14, 2017
  4. Jun 13, 2017
    • Rafael Espindola's avatar
      Set non alloc section address to 0 earlier. · dece2808
      Rafael Espindola authored
      Currently we do layout as if non alloc sections had an actual address
      and then set it to zero. This produces a few odd results where a
      symbol has an address that is inconsistent with the section address.
      
      The simplest way to fix it is probably to just set the address earlier.
      
      The behavior of bfd seems to be similar, but it only sets the non
      alloc section address is missing from the linker script or if the
      script has an explicit " : 0" setting the address of the output
      section (which the default script does).
      
      llvm-svn: 305323
      dece2808
    • Sam Clegg's avatar
      Add llvm-pdbutil tool_patterns in lit.cfg · be373670
      Sam Clegg authored
      This means that 'llvm-pdbutil' in test commands will resolve
      to the absolute path to the tool, in line with what happens
      already for other tools.
      
      This works either way because the bin directory is also
      prepended to the PATH.  I'm not sure why both methods are
      used.
      
      Differential Revision: https://reviews.llvm.org/D34128
      
      llvm-svn: 305297
      be373670
    • Reid Kleckner's avatar
      [PDB] Add a module descriptor for every object file · 8cbdd0c0
      Reid Kleckner authored
      Summary:
      Expose the module descriptor index and fill it in for section
      contributions.
      
      Reviewers: zturner
      
      Subscribers: llvm-commits, ruiu, hiraditya
      
      Differential Revision: https://reviews.llvm.org/D34126
      
      llvm-svn: 305296
      8cbdd0c0
    • Reid Kleckner's avatar
      [lld] Add .s to the test suffix list for all lld ports · 41ff5706
      Reid Kleckner authored
      We have two .s test files in lld/test/COFF that weren't being run as
      part of check-lld. They both pass locally for me.
      
      llvm-svn: 305295
      41ff5706
    • Zachary Turner's avatar
      Fix broken LLD test. · fa18b2f6
      Zachary Turner authored
      llvm-svn: 305260
      fa18b2f6
    • Rafael Espindola's avatar
      Also check section address in test. · 4c4becf8
      Rafael Espindola authored
      This shows an oddity of this output. While the section address is 0,
      the the symbol address is computed as if the section was allocatable.
      
      llvm-svn: 305250
      4c4becf8
  5. Jun 12, 2017
  6. Jun 11, 2017
  7. Jun 10, 2017
    • Galina Kistanova's avatar
    • Rafael Espindola's avatar
      Relax the overflow checking of R_386_PC16. · 07c87416
      Rafael Espindola authored
      Currently the freebsd early boot code fails to link. The issue reduces
      to 16 bit code at position 0x7000 wanting to jump to position
      0x9000. That is represented in the .o file as a relocation with no
      symbol and an addend of 0x9000 - 2 (The -2 is because i386 uses the ip
      after the current instruction for jumps).
      
      If the addend is interpreted as signed (it should), it is -28674. In a
      32 bit architecture, that is the address 0xffff8ffe. To get there from
      0x7000 we have to add 4294909950 (too big) or subtract 57346 (too
      small). We then produce an error.
      
      What lld is missing is the fact that at runtime this will actually be
      a 16 bit architecture and adding 0x1ffe produces 0x8ffe which is the
      correct result in 16 bits (-28674).
      
      Since we have a 16 bit addend and a 16 bit PC, the relocation can move
      the PC to any 16 bit address and that is the only thing we really need
      to check: if the address we are pointing to fits in 16 bits. This is
      unfortunately hard to do since we have to delay subtracting the PC and
      if we want to do that outside of Target.cpp, we have to move the
      overflow check out too.  An incomplete patch that tries to do that is
      at https://reviews.llvm.org/D34070
      
      This patch instead just relaxes the check. Since the value we have is
      the destination minus the PC and the PC is 16 bits, it should fit in
      17 bits if the destination fits in 16 too.
      
      bfd had a similar issue for some time and got a similar fix:
      https://sourceware.org/ml/binutils/2005-08/msg00001.html
      
      llvm-svn: 305135
      07c87416
    • Rui Ueyama's avatar
      [ICF] Ignore SHF_GROUP flag when comparing two sections. · 1c837b5f
      Rui Ueyama authored
      SHF_GROUP bit doesn't make sense in executables or DSOs, so linkers are
      expected to remove that bit from section flags. We did that when we create
      output sections.
      
      This patch is to do that earlier than before. Now the flag is dropped when
      we instantiate input section objects.
      
      This change improves ICF. Previously, two sections that differ only in
      SHF_GROUP flag were not merged, because when the control reached ICF,
      the flag was still there. Now the flag is dropped before reaching to ICF,
      so the difference is ignored naturally.
      
      This issue was found by pcc.
      
      Differential Revision: https://reviews.llvm.org/D34074
      
      llvm-svn: 305134
      1c837b5f
  8. Jun 09, 2017
Loading