aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/CommandGuide
AgeCommit message (Collapse)AuthorFilesLines
2024-12-24[llvm-objcopy] Add support of symbol modification flags for MachO (#120895)Richard Dzenis1-50/+50
This patch adds support of the following llvm-objcopy flags for MachO: - `--globalize-symbol`, `--globalize-symbols`, - `--keep-global-symbol`, `-G`, `--keep-global-symbols`, - `--localize-symbol`, `-L`, `--localize-symbols`, - `--skip-symbol`, `--skip-symbols`. Code in `updateAndRemoveSymbols` for MachO is kept similar to its version for ELF. Fixes #120894
2024-12-16[llvm-mc] Add --hex to disassemble hex bytesFangrui Song1-0/+4
`--disassemble`/`--cdis` parses input bytes as decimal, 0bbin, 0ooct, or 0xhex. While the hexadecimal digit form is most commonly used, requiring a 0x prefix for each byte (`0x48 0x29 0xc3`) is cumbersome. Tools like xxd -p and rz-asm use a plain hex dump form without the 0x prefix or space separator. This patch adds --hex to disassemble such hex bytes with optional whitespace. ``` % rz-asm -a x86 -b 64 -d 4829c34829c4 sub rbx, rax sub rsp, rax % llvm-mc -triple=x86_64 --cdis --hex --output-asm-variant=1 <<< 4829c34829c4 .text sub rbx, rax sub rsp, rax ``` Pull Request: https://github.com/llvm/llvm-project/pull/119992
2024-11-13[lit] Add --report-failures-only option for lit test reports (#115439)Rakshit Patel1-0/+4
- Add option (--report-failures-only) to generate a reduced report for lit tests that only includes failing tests - This is a continuation of proposed patches by @gregbedwell here: - https://reviews.llvm.org/D143516 - https://reviews.llvm.org/D143519 --------- Co-authored-by: Greg Bedwell <greg.bedwell@sony.com> Co-authored-by: James Henderson <James.Henderson@sony.com>
2024-11-11[llvm-debuginfo-analyzer] Incorrect DW_AT_call_line/DW_AT_call_file. (#115701)Carlos Alberto Enciso1-1/+1
The code dealing with DW_AT_call_line/DW_AT_call_file is in the wrong place. The correct functions were call, but with incorrect values: DW_AT_call_line <-- Filename Index DW_AT_call_file <-- Line number
2024-11-07[Docs][llvm-exegesis] Clarify AArch64 support (#114989)Sjoerd Meijer1-5/+16
Claiming AArch64 support for llvm-exegesis is a bit of a stretch in my opinion as only a couple of opcodes with GPR64 operands will work for snippet benchmarking, so I propose to clarify that AArch64 support is very experimental. Also added some clarifications about its libpfm4 dependency.
2024-11-04[CGData][llvm-cgdata] Support for stable function map (#112664)Kyungwoo Lee1-9/+7
This introduces a new cgdata format for stable function maps. The raw data is embedded in the __llvm_merge section during compile time. This data can be read and merged using the llvm-cgdata tool, into an indexed cgdata file. Consequently, the tool is now capable of handling either outlined hash trees, stable function maps, or both, as they are orthogonal. Depends on #112662. This is a patch for https://discourse.llvm.org/t/rfc-global-function-merging/82608.
2024-10-29[llvm][docs] Update list of llvm-lit optionsDavid Spickett1-49/+113
Fixes #62899 In this commit I have updated the list of options to include any missing options and re-rordered some of them to match the order in lit's --help. Where there was a larger description in this document I've used that instead of the --help description. This *does not* include --use-unique-output-file-name as this was only added recently and we are still debating whether it will be kept.
2024-10-23[llvm-cxxfilt] De-emphasize "function" in llvm-cxxfilt docs and --help (#113309)Edd Dawson1-3/+2
llvm-cxxfilt can demangle names of data symbols, in addition to function names. $ llvm-cxxfilt _ZN6garden5gnomeE garden::gnome And type names too, on request: $ llvm-cxxfilt -t i int Update some overly specific the wording in the --help and documentation that suggests otherwise.
2024-10-22[dsymutil] Provide an option to ignore object timestamp mismatches (#113238)Jonas Devlieghere1-0/+4
Provide a option (--no-object-timestamp) to ignore object file timestamp mismatches. We already have a similar option for Swift modules (--no-swiftmodule-timestamp). rdar://123975869
2024-10-21[llvm-cxxfilt] Add --quote option to quote demangled function names (#111871)Ronan Keryell1-0/+5
This is useful when looking at LLVM/MLIR assembly produced from C++ sources. For example cir.call @_ZN3aie4tileILi1ELi4EE7programIZ4mainE3$_0EEvOT_(%2, %7) : will be translated to cir.call @"void aie::tile<1, 4>::program<main::$_0>(main::$_0&&)"(%2, %7) : which can be parsed as valid MLIR by the right mlir-lsp-server. If a symbol is already quoted, do not quote it more. --------- Co-authored-by: James Henderson <jh7370@my.bristol.ac.uk>
2024-10-04[doc] Fix rendering for objcopy's --remove-symbol-prefix option text (#111131)bd1976bris1-2/+2
2024-10-04[doc] Add --verify-json to dwarfdump documentation (#110909)bd1976bris1-0/+28
This adds documentation for --verify-json, see: https://github.com/llvm/llvm-project/pull/81762
2024-10-04[doc] Add llvm --error-display to dwarfdump documentation (#110922)bd1976bris1-0/+10
This adds documentation for --error-display, see: https://github.com/llvm/llvm-project/pull/79648
2024-10-03[LIT] Rename substitution `%basename_s` to `%{s:basename}` (#111062)Rahul Joshi1-2/+3
Also added `%{t:stem}` as an alias for `%basename_t` and modified unit test to test these new substitutions.
2024-10-03[LIT] Add support for `%basename_s` to get base name of source file (#110993)Rahul Joshi1-0/+1
Add support for `%basename_s` pattern in the RUN commands to get the base name of the source file, and adopt it in a TableGen LIT test.
2024-10-01Revert "[Utils] Add new --update-tests flag to llvm-lit" (#110772)Henrik G. Olsson1-5/+0
Reverts llvm/llvm-project#108425
2024-10-01[Utils] Add new --update-tests flag to llvm-lit (#108425)Henrik G. Olsson1-0/+5
This adds a flag to lit for detecting and updating failing tests when possible to do so automatically. The flag uses a plugin architecture where config files can add additional auto-updaters for the types of tests in the test suite. When a test fails with `--update-tests` enabled lit passes the test RUN invocation and output to each registered test updater until one of them signals that it updated the test (or all test updaters have been run). As such it is the responsibility of the test updater to only update tests where it is reasonably certain that it will actually fix the test, or come close to doing so. Initially adds support for UpdateVerifyTests and UpdateTestChecks. The flag is currently only implemented for lit's internal shell, so `--update-tests` implies `LIT_USE_INTERNAL_SHELL=1`. Builds on work in #97369 Fixes #81320
2024-09-25Reapply "Deprecate the `-fbasic-block-sections=labels` option." (#110039)Rahman Lavaee1-1/+1
This reapplies commit 1911a50fae8a441b445eb835b98950710d28fc88 with a minor fix in lld/ELF/LTO.cpp which sets Options.BBAddrMap when `--lto-basic-block-sections=labels` is passed.
2024-09-25Revert "Deprecate the `-fbasic-block-sections=labels` option. (#107494)"Kazu Hirata1-1/+1
This reverts commit 1911a50fae8a441b445eb835b98950710d28fc88. Several bots are failing: https://lab.llvm.org/buildbot/#/builders/190/builds/6519 https://lab.llvm.org/buildbot/#/builders/3/builds/5248 https://lab.llvm.org/buildbot/#/builders/18/builds/4463
2024-09-25Deprecate the `-fbasic-block-sections=labels` option. (#107494)Rahman Lavaee1-1/+1
This feature is supported via the newer option `-fbasic-block-address-map`. Using the old option still works by delegating to the newer option, while a warning is printed to show deprecation.
2024-09-06[InstrProf] Add debuginfod correlation support (#106606)gulfemsavrun1-0/+19
This patch adds debuginfod support into llvm-profdata to find the assosicated executable by a build id in a raw profile to correlate a profile with a provided correlation kind (debug-info or binary).
2024-09-06[Clang][AArch64] Add customisable immediate range checking to NEON (#100278)SpencerAbson1-0/+4
This patch moves NEON immediate argument specification and checking to the system currently shared by both SVE and SME. In its current form, the TableGen definition of a NEON intrinsic cannot control how its immediate arguments are range-checked, this information must be inferred from the name of the intrinsic by NeonEmitter, which also assumes that any NEON instruction will only ever receive a single immediate argument. For SVE/SME instrinsics, this information is more conveniently supplied in the TableGen definition. As a result, for each immediate argument, NEON instructions must define - The index of the immediate argument to be checked - The type of immediate range check to be performed, (e.g., ImmCheckShiftRight) - The index of the argument whose type defines the context of this immediate check (base type, vector size). - **Difference from SVE/SME** If this definition generates a polymorphic NEON builtin, the base type defined by this argument is overwritten by that of the type code supplied to the overloaded builtin call. This third argument is omitted in some cases due to this. Here is an example for [`vfma_laneq`](https://developer.arm.com/architectures/instruction-sets/intrinsics/#f:@navigationhierarchiessimdisa=[Neon]&q=vfma_laneq) - The immediate is supplied in argument 3 - The immediate is used as an index into the lanes of argument 2 - So we must perform an immediate check on argument 3, based on the type information of argument 2. - `ImmCheck<3, ImmCheckLaneIndex, 2>` During this work, we discovered that the existing immediate range-checking system was largely untested, which made it difficult to make reliable progress. Missing tests have been added to verify this implementation against all intrinsics which take constrained immediate arguments. All test immediate range checking tests for NEON intrinsics are moved to a dedicated directory `clang/test/Sema/aarch64-neon-immediate-ranges/`.
2024-08-28[llvm-profdata] Enabled functionality to write split-layout profile (#101795)William Junda Huang1-0/+6
Using the flag `-split_layout` in llvm-profdata merge, the output profile can write profiles with and without inlined function into two different extbinary sections (and their FuncOffsetTable too). The section without inlined functions are marked with `SecFlagFlat` and is skipped by ThinLTO because it provides no useful info. The split layout feature was already implemented in SampleProfWriter but previously there is no way to use it from llvm-profdata.
2024-08-28[CGData] Document for llvm-cgdata (#106320)Kyungwoo Lee2-0/+69
This is a follow-up for https://github.com/llvm/llvm-project/pull/101461. This is a patch for https://discourse.llvm.org/t/rfc-enhanced-machine-outliner-part-2-thinlto-nolto/78753.
2024-08-05[Symbolizer] Support for Missing Line Numbers. (#82240)Amit Kumar Pandey1-0/+33
LLVM Symbolizer attempt to symbolize addresses of optimized binaries reports missing line numbers for some cases. It maybe due to compiler which sometimes cannot map an instruction to line number due to optimizations. Symbolizer should handle those cases gracefully. Adding an option '--skip-line-zero' to symbolizer so as to report the nearest non-zero line number. --------- Co-authored-by: Amit Pandey <amit.pandey@amd.com>
2024-07-30[llvm-objcopy] Add --change-section-address (#98664)Eleanor Bonnici1-0/+9
--change-section address and its alias --adjust-section-vma allows modification of section addresses in a relocatable file. This used to be used, for example, in Fiasco microkernel. On a relocatable file this option behaves the same as GNU objcopy, apart from the fact that it does not issue any warnings, for example, when an argument is not used. GNU objcopy does not produce an error when passed an executable file but the usecase for this is not clear, and the behaviour is inconsistent. The idea of GNU objcopy --change-section-address is that the option should change both LMA and VMA in an executable file. Since this patch does not implement executable file support, only VMA is changed.
2024-07-20[lit] Add a flag to disable lit time tests (#98270)Vincent Lee1-0/+4
LLVM lit assumes control of the test parallelism when running a test suite. This style of testing doesn't play nicely with build systems like Buck or Bazel since it prefers finer grained actions on a per-test level. In order for external build systems to control the test parallelism, add an option to disable `.lit_test_times.txt` under the `--skip-test-time-recording` flag, thus allowing other build systems to determine the parallelism and avoid race conditions when writing to that file. I went for `--skip-test-time-recording` instead of `--time-tests` in order to preserve the original functionality of writing to `.lit_test_times.txt` as the default behavior and only opt-in for those who do _not_ want `.lit_test_times.txt` file.
2024-07-11[llvm-objcopy] Add verification of added .note section formatserge-sans-paille1-0/+9
Also add a --no-verify-note-sections flag to make it possible to add invalid sections if needs be. Pull Request: https://github.com/llvm/llvm-project/pull/90458
2024-07-08[llvm-objcopy] Add change-section-lma *+/-offset (#95431)Eleanor Bonnici1-0/+4
llvm-objcopy did not support change-section-lma argument. This patch adds support for a use case of change-section-lma, that is shifting load address of all sections by the same offset. This seems to be the only practical use case of change-section-lma, found in other software such as Zephyr RTOS's build system. This is an option that could possibly be supported in some other than ELF formats, however this change only implements it for ELF. When used with other formats an error message is raised. In comparison, the behavior of GNU objcopy is inconsistent. For some ELF files it behaves the same as described above. For others, it copies the file without modifying the p_paddr fields when it would be expected. In some experiments it modifies arbitrary fields in section or program headers. It is unclear what exactly determines this. The executable file generated by yaml2obj in this test is not parsable by GNU objcopy. With Machine set to EM_AARCH64, the file can be parsed and the first test in the test file completes with 0 exit code. However, the result is rather arbitrary. AArch64 GNU objcopy subtracts 0x1000 from p_filesz and p_memsz of the first LOAD section and 0x1000 from p_offset of the second LOAD section. It does not look meaningful.
2024-07-02[FileCheck][Docs] Fix regex for FileCheck variable names (#97301)Anton Lydike1-1/+1
This fixes a minor oversight in the FileCheck documentation on what is considered a valid variable name. Global variables are prefixed with a `$`, which is explained two paragraphs below, but this was omitted in the presented regex in this paragraph.
2024-06-11[llvm][lit] Add tsan feature when enabled (#94573)Keith Smiley1-0/+17
2024-05-09[dsymutil] Add -q/--quiet flag to suppress warnings (#91658)Jonas Devlieghere1-0/+4
Add a -q/--quiet flag to suppress dsymutil output. For now the flag is limited to dsymutil, though there might be other places in the DWARF linker that could be conditionalized by this flag. The motivation is having a way to silence the "no debug symbols in executable" warning. This is useful when we want to generate a dSYM for a binary not containing debug symbols, but still want a dSYM that can be indexed by spotlight. rdar://127843467
2024-05-07[llvm-mca] Abort on parse error without -skip-unsupported-instructions (#90474)Peter Waller1-0/+10
[llvm-mca] Abort on parse error without -skip-unsupported-instructions Prior to this patch, llvm-mca would continue executing after parse errors. These errors can lead to some confusion since some analysis results are printed on the standard output, and they're printed after the errors, which could otherwise be easy to miss. However it is still useful to be able to continue analysis after errors; so extend the recently added -skip-unsupported-instructions to support this. Two tests which have parse errors for some of the 'RUN' branches are updated to use -skip-unsupported-instructions so they can remain as-is. Add a description of -skip-unsupported-instructions to the llvm-mca command guide, and add it to the llvm-mca --help output: ``` --skip-unsupported-instructions=<value> - Force analysis to continue in the presence of unsupported instructions =none - Exit with an error when an instruction is unsupported for any reason (default) =lack-sched - Skip instructions on input which lack scheduling information =parse-failure - Skip lines on the input which fail to parse for any reason =any - Skip instructions or lines on input which are unsupported for any reason ``` Tests within this patch are intended to cover each of the cases. Reason | Flag | Comment --------------|------|------- none | none | Usual case, existing test suite lack-sched | none | Advises user to use -skip-unsupported-instructions=lack-sched, tested in llvm/test/tools/llvm-mca/X86/BtVer2/unsupported-instruction.s parse-failure | none | Advises user to use -skip-unsupported-instructions=parse-failure, tested in llvm/test/tools/llvm-mca/bad-input.s any | none | (N/A, covered above) lack-sched | any | Continues, prints warnings, tested in llvm/test/tools/llvm-mca/X86/BtVer2/unsupported-instruction.s parse-failure | any | Continues, prints errors, tested in llvm/test/tools/llvm-mca/bad-input.s lack-sched | parse-failure | Advises user to use -skip-unsupported-instructions=lack-sched, tested in llvm/test/tools/llvm-mca/X86/BtVer2/unsupported-instruction.s parse-failure | lack-sched | Advises user to use -skip-unsupported-instructions=parse-failure, tested in llvm/test/tools/llvm-mca/bad-input.s none | * | This would be any test case with skip-unsupported-instructions, coverage added in llvm/test/tools/llvm-mca/X86/BtVer2/simple-test.s any | * | (Logically covered by the other cases)
2024-05-03[docs,utils] Convert text files from CRLF to LFFangrui Song1-38/+38
Skip *.bat, *.natvis, utils/lit/tests/Inputs/shtest-shell/diff-in.dos
2024-04-26[llvm-objcopy][docs] Use "Mark" rather than "Make" in the objcopy docs for ↵bd1976bris1-3/+3
consistency (#90080) llvm-objcopy --help uses the term "Mark" rather than "Make". e.g. "Mark all symbols local" Change llvm/docs to align.
2024-04-22[llvm-readobj] Remove --raw-relrFangrui Song2-8/+0
https://reviews.llvm.org/D47919 dumped RELR relocations as `R_*_RELATIVE` and added --raw-relr (not in GNU) for testing purposes (more readable than `llvm-readelf -x .relr.dyn`). The option is obsolete after `llvm-readelf -r` output gets improved (#89162). Since --raw-relr never seems to get more adoption. Let's remove it to avoid some complexity. Pull Request: https://github.com/llvm/llvm-project/pull/89426
2024-04-15[llvm-objcopy] Add --compress-sectionsFangrui Song1-0/+8
--compress-sections is similar to --compress-debug-sections but applies to arbitrary sections. * `--compress-sections <section>=none`: decompress sections * `--compress-sections <section>=[zlib|zstd]`: compress sections with zlib/zstd Like `--remove-section`, the pattern is by default a glob, but a regex when --regex is specified. For `--remove-section` like options, `!` prevents matches and is not dependent on ordering (see `ELF/wildcard-syntax.test`). Since `--compress-sections a=zlib --compress-sections a=none` naturally allows overriding, having an order-independent `!` would be confusing. Therefore, `!` is disallowed. Sections within a segment are effectively immutable. Report an error for an attempt to (de)compress them. `SHF_ALLOC` sections in a relocatable file can be compressed, but linkers usually reject them. Note: Before this patch, a compressed relocation section is recognized as a `RelocationSectionBase` as well and `removeSections` `!ToRemove(*ToRelSec)` may incorrectly interpret a `CompressedSections` as `RelocationSectionBase`, leading to ubsan failure for the new test. Fix this by setting `OriginalFlags` in CompressedSection::CompressedSection. Link: https://discourse.llvm.org/t/rfc-compress-arbitrary-sections-with-ld-lld-compress-sections/71674 Pull Request: https://github.com/llvm/llvm-project/pull/85036
2024-04-05Revert "[llvm-objcopy] Add --compress-sections"Mitch Phillips1-8/+0
This reverts commit 9e3b64b9f95aadf57568576712902a272fe66503. Reason: Broke the UBSan buildbot. See the comments in the pull request (https://github.com/llvm/llvm-project/pull/85036) for more information.
2024-04-04[llvm-objcopy] Add --compress-sectionsFangrui Song1-0/+8
--compress-sections is similar to --compress-debug-sections but applies to arbitrary sections. * `--compress-sections <section>=none`: decompress sections * `--compress-sections <section>=[zlib|zstd]`: compress sections with zlib/zstd Like `--remove-section`, the pattern is by default a glob, but a regex when --regex is specified. For `--remove-section` like options, `!` prevents matches and is not dependent on ordering (see `ELF/wildcard-syntax.test`). Since `--compress-sections a=zlib --compress-sections a=none` naturally allows overriding, having an order-independent `!` would be confusing. Therefore, `!` is disallowed. Sections within a segment are effectively immutable. Report an error for an attempt to (de)compress them. `SHF_ALLOC` sections in a relocatable file can be compressed, but linkers usually reject them. Link: https://discourse.llvm.org/t/rfc-compress-arbitrary-sections-with-ld-lld-compress-sections/71674 Pull Request: https://github.com/llvm/llvm-project/pull/85036
2024-03-27[llvm-debuginfo-analyzer][DOC] Convert 'README.txt' to markdown. (#86394)Carlos Alberto Enciso1-0/+4
As part of the WebAssembly support work https://github.com/llvm/llvm-project/pull/85566 The README.txt is a bit odd since it only lists issues and problems without talking about what works. It’s also hard to read on the GitHub web view. - Convert to Markdown and linking to the command docs https://llvm.org/docs/CommandGuide/llvm-debuginfo-analyzer - Rename some left 'elf reader' to 'DWARF reader'.
2024-03-21[llvm-objcopy] Add --skip-symbol and --skip-symbols options (#80873)Ilia Kuklin1-0/+13
Add --skip-symbol and --skip-symbols options that allow to skip symbols when executing other options that can change the symbol's name, binding or visibility, similar to an existing option --keep-symbol that keeps a symbol from being removed by other options.
2024-03-19[dsymutil] Remove support for obfuscated bitcode (#85713)Jonas Devlieghere1-4/+0
Remove support for obfuscated bitcode in dsymutil and the DWARF linker. We no longer support bitcode submissions and the obfuscation support has been removed from the rest of the compiler. rdar://123863918
2024-03-19Revert "[dsymutil] Remove support for obfuscated bitcode" (#85826)Andres Villegas1-0/+4
Reverts llvm/llvm-project#85713 Since it is breaking Linux x64 builds.
2024-03-19[dsymutil] Remove support for obfuscated bitcode (#85713)Jonas Devlieghere1-4/+0
Remove support for obfuscated bitcode in dsymutil and the DWARF linker. We no longer support bitcode submissions and the obfuscation support has been removed from the rest of the compiler. rdar://123863918
2024-03-18[llvm-debuginfo-analyzer][DOC] Change .wasm references to .o (#85566)Carlos Alberto Enciso1-14/+14
As part of the WebAssembly support work https://github.com/llvm/llvm-project/pull/82588 As the object files used in the test cases are a single object (just produced by clang without being processed by wasm-ld), it was determined to use .o intead of .wasm. Update the README.txt to reflect that the tool now supports WebAssembly.
2024-03-14[llvm-debuginfo-analyzer] Add support for WebAssembly binary format. (#82588)Carlos Alberto Enciso1-3/+313
Add support for the WebAssembly binary format and be able to generate logical views. https://github.com/llvm/llvm-project/issues/69181 The README.txt includes information about how to build the test cases.
2024-03-13[llvm-ar] Use COFF archive format for COFF targets. (#82898)Jacek Caban1-1/+1
Detect COFF files by default and allow specifying it with --format argument. This is important for ARM64EC, which uses a separated symbol map for EC symbols. Since K_COFF is mostly compatible with K_GNU, this shouldn't really make a difference for other targets. This originally landed as #82642, but was reverted due to test failures in tests using no symbol table. Since COFF symbol can't express it, fallback to GNU format in that case.
2024-03-11[Docs] Fix `llvm-remarkutil` docs (#84661)Zain Jaffal1-31/+53
Code blocks and option points weren't rendered correctly
2024-03-01[llvm-readobj] enable demangle option for the xcoff object file (#78455)zhijian lin1-4/+10
enable `--demangle` option for the xcoff object file for llvm-readobj
2024-02-28[llvm-objcopy] Add --set-symbol-visibility and --set-symbols-visibility ↵Ilia Kuklin1-0/+9
options (#80872) Add options --set-symbol-visibility and --set-symbols-visibility to manually change the visibility of symbols. There is already an option to set the visibility of newly added symbols via --add-symbol and --new-symbol-visibility. This option will allow to change the visibility of already existing symbols.