Skip to content
  1. May 01, 2019
    • Fangrui Song's avatar
      [llvm-readobj] Change -long-option to --long-option in tests. NFC · e29e30b1
      Fangrui Song authored
      We use both -long-option and --long-option in tests. Switch to --long-option for consistency.
      
      In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf.
      
      While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf).
      
      llvm-svn: 359649
      e29e30b1
  2. Apr 15, 2019
    • Stephen Tozer's avatar
      [llvm-readobj] Reapply: Improve error message for --string-dump · 19bb1d57
      Stephen Tozer authored
      This is a resubmission of a previous patch that caused test failures,
      with the fixes for the relevant tests included.
      
      Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630
      
      This patch changes the error message when the section specified by
      --string-dump cannot be found by including the name of the section in
      the error message and changing the prefix text to not imply that the
      file itself was invalid. As part of this change some uses of
      std::error_code have been replaced with the llvm Error class to better
      encapsulate the error info (rather than passing File strings around),
      and the WithColor class replaces string literal error prefixes.
      
      llvm-svn: 358395
      19bb1d57
  3. Apr 05, 2019
  4. Mar 29, 2019
  5. Mar 01, 2019
    • Igor Kudrin's avatar
      [CommandLine] Allow grouping options which can have values. · a38432ce
      Igor Kudrin authored
      This patch allows all forms of values for options to be used at the end
      of a group. With the fix, it is possible to follow the way GNU binutils
      tools handle grouping options better. For example, the -j option can be
      used with objdump in any of the following ways:
      
      $ objdump -d -j .text a.o
      $ objdump -d -j.text a.o
      $ objdump -dj .text a.o
      $ objdump -dj.text a.o
      
      Differential Revision: https://reviews.llvm.org/D58711
      
      llvm-svn: 355185
      a38432ce
  6. Feb 27, 2019
  7. Feb 07, 2019
    • Alexandre Ganea's avatar
      [CodeView] Fix cycles in debug info when merging Types with global hashes · 120366ed
      Alexandre Ganea authored
      When type streams with forward references were merged using GHashes, cycles 
      were introduced in the debug info. This was caused by 
      GlobalTypeTableBuilder::insertRecordAs() not inserting the record on the second
      pass, thus yielding an empty ArrayRef at that record slot. Later on, upon PDB 
      emission, TpiStreamBuilder::commit() would skip that empty record, thus 
      offseting all indices that came after in the stream. 
      
      This solution comes in two steps: 
      
      1. Fix the hash calculation, by doing a multiple-step resolution, iff there are
      forward references in the input stream.
      2. Fix merge by resolving with multiple passes, therefore moving records with
      forward references at the end of the stream. 
      
      This patch also adds support for llvm-readoj --codeview-ghash.
      Finally, fix dumpCodeViewMergedTypes() which previously could reference deleted
      memory. 
      
      Fixes PR40221 
      
      Differential Revision: https://reviews.llvm.org/D57790 
      
      llvm-svn: 353412
      120366ed
  8. Feb 01, 2019
    • Matt Davis's avatar
      [llvm-readobj] Add a flag to dump just the section-to-segment mapping. · 50ca8edb
      Matt Davis authored
      Summary:
      The following patch introduces a new function `printSectionMapping` which is responsible for dumping just the section-to-segment mapping.
      This patch also introduces a n option `-section-mapping` that outputs that mapping without the program headers.
      
      Previously, this functionality was controlled by `printProgramHeaders`, and the output from `-program-headers` has not been changed.  I am happy to change the option name, I copied  the name that was displayed when outputting the mapping table.
      
      Reviewers: khemant, jhenderson, grimar, rupprecht
      
      Reviewed By: jhenderson, grimar, rupprecht
      
      Subscribers: rupprecht, jhenderson, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D57365
      
      llvm-svn: 352896
      50ca8edb
  9. Jan 23, 2019
    • James Henderson's avatar
      [llvm-readelf] Don't suppress static symbol table with --dyn-symbols + --symbols · 21ed8683
      James Henderson authored
      In r287786, a bug was introduced into llvm-readelf where it didn't print
      the static symbol table if both --symbols and --dyn-symbols were
      specified, even if there was no dynamic symbol table. This is obviously
      incorrect.
      
      This patch fixes this issue, by delegating the decision of which symbol
      tables should be printed to the final dumper, rather than trying to
      decide in the command-line option handling layer. The decision was made
      to follow the approach taken in this patch because the LLVM style dumper
      uses a different order to the original GNU style behaviour (and GNU
      readelf) for ELF output. Other approaches resulted in behaviour changes
      for other dumpers which felt wrong. In particular, I wanted to avoid
      changing the order of the output for --symbols --dyn-symbols for LLVM
      style, keep what is emitted by --symbols unchanged for all dumpers, and
      avoid having different orders of .dynsym and .symtab dumping for GNU
      "--symbols" and "--symbols --dyn-symbols".
      
      Reviewed by: grimar, rupprecht
      
      Differential Revision: https://reviews.llvm.org/D57016
      
      llvm-svn: 351960
      21ed8683
  10. Jan 22, 2019
    • James Henderson's avatar
      [llvm-readelf]Revert --dyn-symbols behaviour to make it GNU compatible, and... · 5fc812f1
      James Henderson authored
      [llvm-readelf]Revert --dyn-symbols behaviour to make it GNU compatible, and add new --hash-symbols switch for old behaviour
      
      In r287786, the behaviour of --dyn-symbols in llvm-readelf (but not
      llvm-readobj) was changed to print the dynamic symbols as derived from
      the hash table, rather than to print the dynamic symbol table contents
      directly. The original change was initially submitted without review,
      and some comments were made on the commit mailing list implying that the
      new behavious is GNU compatible. I argue that it is not:
      
        1) It does not include a null symbol.
        2) It prints the symbols based on an order derived from the hash
           table.
        3) It prints an extra column indicating which bucket it came from.
           This could break parsers that expect a fixed number of columns,
           with the first column being the symbol index.
        4) If the input happens to have both .hash and .gnu.hash section, it
           prints interpretations of them both, resulting in most symbols
           being printed twice.
        5) There is no way of just printing the raw dynamic symbol table,
           because --symbols also prints the static symbol table.
      
      This patch reverts the --dyn-symbols behaviour back to its old behaviour
      of just printing the contents of the dynamic symbol table, similar to
      what is printed by --symbols. As the hashed interpretation is still
      desirable to validate the hash table, it puts it under a new switch
      "--hash-symbols". This is a no-op on all output forms except for GNU
      output style for ELF. If there is no hash table, it does nothing,
      unlike the previous behaviour which printed the raw dynamic symbol
      table, since the raw dynsym is available under --dyn-symbols.
      
      The yaml input for the test is based on that in
      test/tools/llvm-readobj/demangle.test, but stripped down to the bare
      minimum to provide a valid dynamic symbol.
      
      Note: some LLD tests needed updating. I will commit a separate patch for
      those.
      
      Reviewed by: grimar, rupprecht
      
      Differential Revision: https://reviews.llvm.org/D56910
      
      llvm-svn: 351789
      5fc812f1
  11. Jan 19, 2019
    • Chandler Carruth's avatar
      Update the file headers across all of the LLVM projects in the monorepo · 2946cd70
      Chandler Carruth authored
      to reflect the new license.
      
      We understand that people may be surprised that we're moving the header
      entirely to discuss the new license. We checked this carefully with the
      Foundation's lawyer and we believe this is the correct approach.
      
      Essentially, all code in the project is now made available by the LLVM
      project under our new license, so you will see that the license headers
      include that license only. Some of our contributors have contributed
      code under our old license, and accordingly, we have retained a copy of
      our old license notice in the top-level files in each project and
      repository.
      
      llvm-svn: 351636
      2946cd70
  12. Jan 17, 2019
    • James Henderson's avatar
      [llvm-readobj][ELF]Add demangling support · e50d9cb3
      James Henderson authored
      This change adds demangling support to the ELF side of llvm-readobj,
      under the switch --demangle/-C.
      
      The following places are demangled: symbol table dumps (static and
      dynamic), relocation dumps (static and dynamic), addrsig dumps, call
      graph profile dumps, and group section signature symbols.
      
      Although GNU readelf doesn't support demangling, it is still a useful
      feature to have, and brings it on a par with llvm-objdump's
      capabilities.
      
      This fixes https://bugs.llvm.org/show_bug.cgi?id=40054.
      
      Reviewed by: grimar, rupprecht
      
      Differential Revision: https://reviews.llvm.org/D56791
      
      llvm-svn: 351450
      e50d9cb3
  13. Jan 15, 2019
    • Jordan Rupprecht's avatar
      [llvm-readelf] Allow single-letter flags to be merged. · 58aac950
      Jordan Rupprecht authored
      Summary:
      This patch adds support for merged arguments (e.g. -SW == -S -W) for llvm-readelf.
      
      No changes are intended for llvm-readobj. There are a few short flags (-sd, -sr, -st, -dt) that would conflict with grouped single letter flags, and having only some grouped flags might be confusing. So, allow merged flags for readelf compatibility, but force separate args for llvm-readobj. From what I can tell, these two-letter flags are only used with llvm-readobj, not llvm-readelf.
      
      This fixes PR40064.
      
      Reviewers: jhenderson, kristina, echristo, phosek
      
      Reviewed By: jhenderson
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D56629
      
      llvm-svn: 351205
      58aac950
  14. Dec 20, 2018
  15. Dec 11, 2018
  16. Nov 12, 2018
    • Jordan Rupprecht's avatar
      [llvm-readelf] Make llvm-readelf more compatible with GNU readelf. · dbf552c4
      Jordan Rupprecht authored
      Summary:
      This change adds a bunch of options that GNU readelf supports. There is one breaking change when invoked as `llvm-readobj`, and three breaking changes when invoked as `llvm-readelf`:
       - Add --all (implies --file-header, --program-headers, etc.)
       - [Breaking] -a is --all instead of --arm-attributes
       - Add --file-header as an alias for --file-headers
       - Replace --sections with --sections-headers, keeping --sections as an alias for it
       - Add --relocs as an alias for --relocations
       - Add --dynamic as an alias for --dynamic-table
       - Add --segments as an alias for --program-headers
       - Add --section-groups as an alias for --elf-section-groups
       - Add --dyn-syms as an alias for --dyn-symbols
       - Add --syms as an alias for --symbols
       - Add --histogram as an alias for --elf-hash-histogram
       - [Breaking] When invoked as `llvm-readelf`, -s is --symbols instead of --sections
       - [Breaking] When invoked as `llvm-readelf`, -t is no longer an alias for --symbols
      
      Reviewers: MaskRay, phosek, mcgrathr, jhenderson
      
      Reviewed By: MaskRay, jhenderson
      
      Subscribers: sbc100, aheejin, edd, jhenderson, silvas, echristo, compnerd, kristina, javed.absar, kristof.beyls, llvm-commits, Bigcheese
      
      Differential Revision: https://reviews.llvm.org/D54124
      
      llvm-svn: 346685
      dbf552c4
  17. Sep 15, 2018
  18. Aug 23, 2018
  19. Jul 25, 2018
  20. Jul 18, 2018
  21. Jul 11, 2018
  22. Jun 28, 2018
  23. Jun 15, 2018
  24. Jun 02, 2018
    • Michael J. Spencer's avatar
      [MC] Add assembler support for .cg_profile. · ae6eeaea
      Michael J. Spencer authored
      Object FIle Representation
      At codegen time this is emitted into the ELF file a pair of symbol indices and a weight. In assembly it looks like:
      
      .cg_profile a, b, 32
      .cg_profile freq, a, 11
      .cg_profile freq, b, 20
      
      When writing an ELF file these are put into a SHT_LLVM_CALL_GRAPH_PROFILE (0x6fff4c02) section as (uint32_t, uint32_t, uint64_t) tuples as (from symbol index, to symbol index, weight).
      
      Differential Revision: https://reviews.llvm.org/D44965
      
      llvm-svn: 333823
      ae6eeaea
  25. May 01, 2018
    • Adrian Prantl's avatar
      Remove @brief commands from doxygen comments, too. · 4dfcc4a7
      Adrian Prantl authored
      This is a follow-up to r331272.
      
      We've been running doxygen with the autobrief option for a couple of
      years now. This makes the \brief markers into our comments
      redundant. Since they are a visual distraction and we don't want to
      encourage more \brief markers in new code either, this patch removes
      them all.
      
      Patch produced by
        for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done
      
      https://reviews.llvm.org/D46290
      
      llvm-svn: 331275
      4dfcc4a7
  26. Apr 13, 2018
  27. Jan 30, 2018
    • Saleem Abdulrasool's avatar
      CodeGen: support an extension to pass linker options on ELF · b36fbbc3
      Saleem Abdulrasool authored
      Introduce an extension to support passing linker options to the linker.
      These would be ignored by older linkers, but newer linkers which support
      this feature would be able to process the linker.
      
      Emit a special discarded section `.linker-option`.  The content of this
      section is a pair of strings (key, value).  The key is a type identifier for
      the parameter.  This allows for an argument free parameter that will be
      processed by the linker with the value being the parameter.  As an example,
      `lib` identifies a library to be linked against, traditionally the `-l`
      argument for Unix-based linkers with the parameter being the library name.
      
      Thanks to James Henderson, Cary Coutant, Rafael Espinolda, Sean Silva
      for the valuable discussion on the design of this feature.
      
      llvm-svn: 323783
      b36fbbc3
  28. Jan 10, 2018
  29. Dec 13, 2017
  30. Nov 30, 2017
  31. Nov 03, 2017
  32. Oct 14, 2017
  33. Sep 20, 2017
  34. Jul 19, 2017
  35. Jun 22, 2017
Loading