Skip to content
  1. Jan 11, 2019
  2. Jan 10, 2019
  3. Jan 07, 2019
    • Jordan Rupprecht's avatar
      [llvm-objcopy] Handle -O <format> flag. · 70038e01
      Jordan Rupprecht authored
      Summary:
      The -O flag is currently being mostly ignored; it's only checked whether or not the output format is "binary". This adds support for a few formats (e.g. elf64-x86-64), so that when specified, the output can change between 32/64 bit and sizes/alignments are updated accordingly.
      
      This fixes PR39135
      
      Reviewers: jakehehrlich, jhenderson, alexshap, espindola
      
      Reviewed By: jhenderson
      
      Subscribers: emaste, arichardson, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53667
      
      llvm-svn: 350541
      70038e01
  4. Jan 03, 2019
    • Jordan Rupprecht's avatar
      [llvm-objcopy] Fix buildbots on older compilers · 415dc5dd
      Jordan Rupprecht authored
      llvm-svn: 350343
      415dc5dd
    • Jordan Rupprecht's avatar
      Fix typos in comments · 78213c7e
      Jordan Rupprecht authored
      llvm-svn: 350337
      78213c7e
    • Jordan Rupprecht's avatar
      [llvm-objcopy][ELF] Implement a mutable section visitor that updates... · 1f82176f
      Jordan Rupprecht authored
      [llvm-objcopy][ELF] Implement a mutable section visitor that updates size-related fields (Size, EntrySize, Align) before layout.
      
      Summary:
      Fix EntrySize, Size, and Align before doing layout calculation.
      
      As a side cleanup, this removes a dependence on sizeof(Elf_Sym) within BinaryReader, so we can untemplatize that.
      
      This unblocks a cleaner implementation of handling the -O<format> flag. See D53667 for a previous attempt. Actual implementation of the -O<format> flag will come in an upcoming commit, this is largely a NFC (although not _totally_ one, because alignment on binary input was actually wrong before).
      
      Reviewers: jakehehrlich, jhenderson, alexshap, espindola
      
      Reviewed By: jhenderson
      
      Subscribers: emaste, arichardson, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D56211
      
      llvm-svn: 350336
      1f82176f
  5. Dec 30, 2018
  6. Dec 20, 2018
  7. Dec 19, 2018
  8. Dec 12, 2018
  9. Dec 11, 2018
    • David Blaikie's avatar
      llvm-objcopy: Improve/simplify llvm::Error handling during notes iteration · ba005aa4
      David Blaikie authored
      Using an Error as an out parameter from an indirect operation like
      iteration as described in the documentation (
      http://llvm.org/docs/ProgrammersManual.html#building-fallible-iterators-and-iterator-ranges
      ) seems to be a little fussy - so here's /one/ possible solution, though
      I'm not sure it's the right one.
      
      Alternatively such APIs may be better off being switched to a standard
      algorithm style, where they take a lambda to do the iteration work that
      is then called back into (eg: "Error e = obj.for_each_note([](const
      Note& N) { ... });"). This would be safer than having an unwritten
      assumption that the user of such an iteration cannot return early from
      the inside of the function - and must always exit through the gift
      shop... I mean error checking. (even though it's guaranteed that if
      you're mid-way through processing an iteration, it's not in an  error
      state).
      
      Alternatively we'd need some other (the super untrustworthy/thing we've
      generally tried to avoid) error handling primitive that actually clears
      the error state entirely so it's safe to ignore.
      
      Fleshed this solution out a bit further during review - it now relies on
      op==/op!= comparison as the equivalent to "if (Err)" testing the Error.
      So just like an Error must be checked (even if it's in a success state),
      the Error hiding in the iterator must be checked after each increment
      (including by comparison with another iterator - perhaps this could be
      constrained to only checking if the iterator is compared to the end
      iterator? Not sure it's too important).
      
      So now even just creating the iterator and not incrementing it at all
      should still assert because the Error has not been checked.
      
      Reviewers: lhames, jakehehrlich
      
      Differential Revision: https://reviews.llvm.org/D55235
      
      llvm-svn: 348811
      ba005aa4
  10. Dec 06, 2018
    • Jake Ehrlich's avatar
      [llvm-objcopy] Change --only-keep to --only-section · 85985ed3
      Jake Ehrlich authored
      I just hard core goofed when I wrote this and created a different name
      for no good reason. I'm failry aware of most "fresh" users of llvm-objcopy
      (that is, users which are not using it as a drop in replacement for GNU
      objcopy) and can say that only "-j" is being used by such people so this
      patch should strictly increase compatibility and not remove it.
      
      Differential Revision: https://reviews.llvm.org/D52180
      
      llvm-svn: 348446
      85985ed3
  11. Dec 03, 2018
    • Jake Ehrlich's avatar
      [llvm-objcopy] Add --build-id-link-dir flag · 8ad77790
      Jake Ehrlich authored
      This flag does not exist in GNU objcopy but has a major use case.
      Debugging tools support the .build-id directory structure to find
      debug binaries. There is no easy way to build this structure up
      however. One way to do it is by using llvm-readelf and some crazy
      shell magic. This implements the feature directly. It is most often
      the case that you'll want to strip a file and send the original to
      the .build-id directory but if you just want to send a file to the
      .build-id directory you can copy to /dev/null instead.
      
      Differential Revision: https://reviews.llvm.org/D54384
      
      llvm-svn: 348174
      8ad77790
  12. Nov 29, 2018
  13. Nov 28, 2018
  14. Nov 17, 2018
  15. Nov 13, 2018
  16. Nov 11, 2018
  17. Nov 07, 2018
  18. Nov 01, 2018
  19. Oct 31, 2018
  20. Oct 30, 2018
  21. Oct 29, 2018
  22. Oct 25, 2018
  23. Oct 23, 2018
    • Jordan Rupprecht's avatar
      [llvm-objcopy] Fix use-after-move clang-tidy warning · ab9f6626
      Jordan Rupprecht authored
      llvm-svn: 345079
      ab9f6626
    • Jordan Rupprecht's avatar
      [llvm-strip] Support -s alias for --strip-all. Make both strip and objcopy... · aaeaa0a8
      Jordan Rupprecht authored
      [llvm-strip] Support -s alias for --strip-all. Make both strip and objcopy case sensitive to support both -s (--strip-all) and -S (--strip-debug).
      
      Summary:
      GNU strip supports both `-s` and `-S` as aliases for `--strip-all` and `--strip-debug`, respectfully.
      
      As part of this, it turns out that strip/objcopy were accepting case insensitive command line args. I'm not sure if there was an explicit reason for this. The only others uses of this are llvm-cvtres/llvm-mt/llvm-lib, which are all tools specific for windows support. Forcing case sensitivity allows both aliases to exist, but seems like a good idea anyway.
      
      And as a surprise test case adjustment, the llvm-strip unit test was running with `-keep=unavailable_symbol`, despite `keep` not be a valid flag for strip. This is because there is a flag `-K` which, when case insensitivity is permitted, allows it to be interpreted as `-K` = `eep=unavailable_symbol` (e.g. to allow `-Kfoo` == `--keep-symbol=foo`).
      
      Reviewers: jakehehrlich, jhenderson, alexshap
      
      Reviewed By: jakehehrlich
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53163
      
      llvm-svn: 345068
      aaeaa0a8
  24. Oct 16, 2018
Loading