History log of /llvm-project/llvm/docs/CommandGuide/llvm-objcopy.rst (Results 1 – 25 of 65)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# 10772807 23-Jan-2025 Igor Kudrin <ikudrin@accesssoftek.com>

Reapply "[llvm-objcopy][ELF] Add an option to remove notes (#118739)"

This fixes "unused-local-typedef" warnings in 9324e6a7a5.

This adds an option `--remove-note=[name/]type` to selectively delete

Reapply "[llvm-objcopy][ELF] Add an option to remove notes (#118739)"

This fixes "unused-local-typedef" warnings in 9324e6a7a5.

This adds an option `--remove-note=[name/]type` to selectively delete
notes in ELF files, where `type` is the numeric value of the note type
and `name` is the name of the originator. The name can be omitted, in
which case all notes of the specified type will be removed. For now,
only `SHT_NOTE` sections that are not associated with segments are
handled. The implementation can be extended later as needed.

RFC: https://discourse.llvm.org/t/rfc-llvm-objcopy-feature-for-editing-notes/83491

show more ...


# 621e5cd8 23-Jan-2025 Igor Kudrin <ikudrin@accesssoftek.com>

Revert "[llvm-objcopy][ELF] Add an option to remove notes (#118739)"

This reverts commit 9324e6a7a5c5adc5b5c38c3e3cbecd7e1e98876a.


# 9324e6a7 23-Jan-2025 Igor Kudrin <ikudrin@accesssoftek.com>

[llvm-objcopy][ELF] Add an option to remove notes (#118739)

This adds an option `--remove-note=[name/]type` to selectively delete
notes in ELF files, where `type` is the numeric value of the note ty

[llvm-objcopy][ELF] Add an option to remove notes (#118739)

This adds an option `--remove-note=[name/]type` to selectively delete
notes in ELF files, where `type` is the numeric value of the note type
and `name` is the name of the originator. The name can be omitted, in
which case all notes of the specified type will be removed. For now,
only `SHT_NOTE` sections that are not associated with segments are
handled. The implementation can be extended later as needed.


RFC: https://discourse.llvm.org/t/rfc-llvm-objcopy-feature-for-editing-notes/83491

show more ...


Revision tags: llvmorg-19.1.7
# 334a5766 24-Dec-2024 Richard Dzenis <richard@dzenis.dev>

[llvm-objcopy] Add support of symbol modification flags for MachO (#120895)

This patch adds support of the following llvm-objcopy flags for MachO:

- `--globalize-symbol`, `--globalize-symbols`,

[llvm-objcopy] Add support of symbol modification flags for MachO (#120895)

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

show more ...


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2
# 097379ac 04-Oct-2024 bd1976bris <bd1976llvm@gmail.com>

[doc] Fix rendering for objcopy's --remove-symbol-prefix option text (#111131)


Revision tags: llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2
# 2b2f4ae0 30-Jul-2024 Eleanor Bonnici <eleanor.bonnici@arm.com>

[llvm-objcopy] Add --change-section-address (#98664)

--change-section address and its alias --adjust-section-vma allows
modification
of section addresses in a relocatable file. This used to be use

[llvm-objcopy] Add --change-section-address (#98664)

--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.

show more ...


Revision tags: llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5
# fb5a38bb 29-Apr-2024 serge-sans-paille <sguelton@mozilla.com>

[llvm-objcopy] Add verification of added .note section format

Also add a --no-verify-note-sections flag to make it possible to add
invalid sections if needs be.

Pull Request: https://github.com/llv

[llvm-objcopy] Add verification of added .note section format

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

show more ...


# 33200363 08-Jul-2024 Eleanor Bonnici <eleanor.bonnici@arm.com>

[llvm-objcopy] Add change-section-lma *+/-offset (#95431)

llvm-objcopy did not support change-section-lma argument.

This patch adds support for a use case of change-section-lma, that is
shifting

[llvm-objcopy] Add change-section-lma *+/-offset (#95431)

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.

show more ...


# 88a733f8 26-Apr-2024 bd1976bris <bd1976llvm@gmail.com>

[llvm-objcopy][docs] Use "Mark" rather than "Make" in the objcopy docs for consistency (#90080)

llvm-objcopy --help uses the term "Mark" rather than "Make".
e.g. "Mark all symbols local"
Change

[llvm-objcopy][docs] Use "Mark" rather than "Make" in the objcopy docs for consistency (#90080)

llvm-objcopy --help uses the term "Mark" rather than "Make".
e.g. "Mark all symbols local"
Change llvm/docs to align.

show more ...


Revision tags: llvmorg-18.1.4
# 07942987 15-Apr-2024 Fangrui Song <i@maskray.me>

[llvm-objcopy] Add --compress-sections

--compress-sections is similar to --compress-debug-sections but applies
to arbitrary sections.

* `--compress-sections <section>=none`: decompress sections
* `

[llvm-objcopy] Add --compress-sections

--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

show more ...


# be8bc3cf 05-Apr-2024 Mitch Phillips <mitchp@google.com>

Revert "[llvm-objcopy] Add --compress-sections"

This reverts commit 9e3b64b9f95aadf57568576712902a272fe66503.

Reason: Broke the UBSan buildbot. See the comments in the pull request
(https://github.

Revert "[llvm-objcopy] Add --compress-sections"

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.

show more ...


# 9e3b64b9 04-Apr-2024 Fangrui Song <i@maskray.me>

[llvm-objcopy] Add --compress-sections

--compress-sections is similar to --compress-debug-sections but applies
to arbitrary sections.

* `--compress-sections <section>=none`: decompress sections
* `

[llvm-objcopy] Add --compress-sections

--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

show more ...


Revision tags: llvmorg-18.1.3
# 4946cc37 21-Mar-2024 Ilia Kuklin <ikuklin@accesssoftek.com>

[llvm-objcopy] Add --skip-symbol and --skip-symbols options (#80873)

Add --skip-symbol and --skip-symbols options that allow to skip symbols
when executing other options that can change the symbol'

[llvm-objcopy] Add --skip-symbol and --skip-symbols options (#80873)

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.

show more ...


Revision tags: llvmorg-18.1.2, llvmorg-18.1.1
# 07d8a457 28-Feb-2024 Ilia Kuklin <ikuklin@accesssoftek.com>

[llvm-objcopy] Add --set-symbol-visibility and --set-symbols-visibility options (#80872)

Add options --set-symbol-visibility and --set-symbols-visibility to
manually change the visibility of symbol

[llvm-objcopy] Add --set-symbol-visibility and --set-symbols-visibility 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.

show more ...


Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4
# 8b56d9ef 27-Feb-2024 Fangrui Song <i@maskray.me>

[llvm-objcopy] Improve help messages (#82830)

https://reviews.llvm.org/D63820 added
llvm/docs/CommandGuide/llvm-objcopy.rst with clearer semantics, e.g.

```
Read a list of names from the file <

[llvm-objcopy] Improve help messages (#82830)

https://reviews.llvm.org/D63820 added
llvm/docs/CommandGuide/llvm-objcopy.rst with clearer semantics, e.g.

```
Read a list of names from the file <filename> and mark defined symbols with those names as global in the output

instead of the help message
Read a list of symbols from <filename> and marks them global" (omits "defined")

Rename sections called <old> to <new> in the output

instead of the help message
Rename a section from old to new (multiple sections may be named <old>
```

Sync the help messages to incorporate the CommandGuide improvement.

While here, switch to the conventional imperative sentences for a few
options. Additionally, mark some options as grp_coff or grp_macho.

show more ...


Revision tags: llvmorg-18.1.0-rc3
# bf471c91 16-Feb-2024 Ulrich Weigand <ulrich.weigand@de.ibm.com>

[docs][llvm-objcopy] Add missing formats (#81981)

Bring list of supported formats in docs back in sync with the code.


# 7ddc3205 09-Feb-2024 quic-areg <aregmi@quicinc.com>

[llvm-objcopy] Support SREC output format (#75874)

Adds a new output target "srec" to write SREC files from ELF inputs.

https://en.wikipedia.org/wiki/SREC_(file_format)


# 1b87ebce 07-Feb-2024 Yi Kong <yikong@google.com>

[llvm-objcopy] Add --remove-symbol-prefix (#79415)


Revision tags: llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init
# 4070dffd 14-Dec-2023 quic-akaryaki <123192073+quic-akaryaki@users.noreply.github.com>

[llvm-objcopy] Add --gap-fill and --pad-to options (#65815)

`--gap-fill <value>` fills the gaps between sections with a specified
8-bit value, instead of zero.
`--pad-to <address>` pads the output

[llvm-objcopy] Add --gap-fill and --pad-to options (#65815)

`--gap-fill <value>` fills the gaps between sections with a specified
8-bit value, instead of zero.
`--pad-to <address>` pads the output binary up to the specified load
address, using the 8-bit value from `--gap-fill` or zero.

These options are only supported for ELF input and binary output.

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1
# 6f1395a1 25-Jul-2023 Thomas Köppe <tkoeppe@google.com>

[llvm-objcopy] --set-section-flags: allow "large" to add SHF_X86_64_LARGE

Currently, objcopy cannot set the new flag SHF_X86_64_LARGE. This change introduces the named flag "large" which translates

[llvm-objcopy] --set-section-flags: allow "large" to add SHF_X86_64_LARGE

Currently, objcopy cannot set the new flag SHF_X86_64_LARGE. This change introduces the named flag "large" which translates to that section flag.

An "invalid argument" error is produced if a user attempts to set the flag on an architecture other than X86_64.

Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D153262

show more ...


Revision tags: llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1
# b6e1fd76 08-Sep-2022 Fangrui Song <i@maskray.me>

[llvm-objcopy] Support --{,de}compress-debug-sections for zstd

Also, add ELFCOMPRESS_ZSTD (2) from the approved generic-abi proposal:
https://groups.google.com/g/generic-abi/c/satyPkuMisk
("Add new

[llvm-objcopy] Support --{,de}compress-debug-sections for zstd

Also, add ELFCOMPRESS_ZSTD (2) from the approved generic-abi proposal:
https://groups.google.com/g/generic-abi/c/satyPkuMisk
("Add new ch_type value: ELFCOMPRESS_ZSTD")

Link: https://discourse.llvm.org/t/rfc-zstandard-as-a-second-compression-method-to-llvm/63399
("[RFC] Zstandard as a second compression method to LLVM")

Reviewed By: jhenderson, dblaikie

Differential Revision: https://reviews.llvm.org/D130458

show more ...


# 0444b40e 08-Sep-2022 Nikita Popov <npopov@redhat.com>

Revert "[Support] Add llvm::compression::{getReasonIfUnsupported,compress,decompress}"

This reverts commit 19dc3cff0f771bb8933136ef68e782553e920d04.
This reverts commit 5b19a1f8e88da9ec92b995bfee900

Revert "[Support] Add llvm::compression::{getReasonIfUnsupported,compress,decompress}"

This reverts commit 19dc3cff0f771bb8933136ef68e782553e920d04.
This reverts commit 5b19a1f8e88da9ec92b995bfee90043795c2c252.
This reverts commit 9397648ac8ad192f7e6e6a8e6894c27bf7e024e9.
This reverts commit 10842b44759f987777b08e7714ef77da2526473a.

Breaks the GCC build, as reported here:
https://reviews.llvm.org/D130506#3776415

show more ...


# 5b19a1f8 08-Sep-2022 Fangrui Song <i@maskray.me>

[llvm-objcopy] Support --{,de}compress-debug-sections for zstd

Also, add ELFCOMPRESS_ZSTD (2) from the approved generic-abi proposal:
https://groups.google.com/g/generic-abi/c/satyPkuMisk
("Add new

[llvm-objcopy] Support --{,de}compress-debug-sections for zstd

Also, add ELFCOMPRESS_ZSTD (2) from the approved generic-abi proposal:
https://groups.google.com/g/generic-abi/c/satyPkuMisk
("Add new ch_type value: ELFCOMPRESS_ZSTD")

Link: https://discourse.llvm.org/t/rfc-zstandard-as-a-second-compression-method-to-llvm/63399
("[RFC] Zstandard as a second compression method to LLVM")

Reviewed By: jhenderson, dblaikie

Differential Revision: https://reviews.llvm.org/D130458

show more ...


Revision tags: llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1
# ce6dd4e8 29-Jul-2022 Fangrui Song <i@maskray.me>

Revert D130458 "[llvm-objcopy] Support --{,de}compress-debug-sections for zstd"

This reverts commit c26dc2904b95b3685d883e760e84046ea6c33d7f.

The new Zstd dispatch has an ongoing design discussion

Revert D130458 "[llvm-objcopy] Support --{,de}compress-debug-sections for zstd"

This reverts commit c26dc2904b95b3685d883e760e84046ea6c33d7f.

The new Zstd dispatch has an ongoing design discussion related to https://reviews.llvm.org/D130516#3688123 .
Revert for now before it is resolved.

show more ...


# c26dc290 28-Jul-2022 Fangrui Song <i@maskray.me>

[llvm-objcopy] Support --{,de}compress-debug-sections for zstd

Also, add ELFCOMPRESS_ZSTD (2) from the approved generic-abi proposal:
https://groups.google.com/g/generic-abi/c/satyPkuMisk
("Add new

[llvm-objcopy] Support --{,de}compress-debug-sections for zstd

Also, add ELFCOMPRESS_ZSTD (2) from the approved generic-abi proposal:
https://groups.google.com/g/generic-abi/c/satyPkuMisk
("Add new ch_type value: ELFCOMPRESS_ZSTD")

Link: https://discourse.llvm.org/t/rfc-zstandard-as-a-second-compression-method-to-llvm/63399
("[RFC] Zstandard as a second compression method to LLVM")

Differential Revision: https://reviews.llvm.org/D130458

show more ...


123