<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/docs/CommandGuide/llvm-objcopy.rst, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[llvm] Fix typos in documentation (#141078)</title>
<updated>2025-05-22T20:58:42+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-22T20:58:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=19a4e5202db40117265cfd704e7d1b7370045f17'/>
<id>19a4e5202db40117265cfd704e7d1b7370045f17</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm-objcopy,ELF] --discard-locals/--discard-all: allow and keep symbols referenced by relocations</title>
<updated>2025-03-12T04:26:13+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-03-12T04:26:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7a66a26658f40d00ad4c298260d9c3b8f91e1368'/>
<id>7a66a26658f40d00ad4c298260d9c3b8f91e1368</id>
<content type='text'>
In GNU objcopy, symbols referenced by relocations are retained. Our COFF
(https://reviews.llvm.org/D56480) and Mach-O
(https://reviews.llvm.org/D75104) ports port the behavior, but the ELF
port doesn't.

This PR implements the behavior for ELF.
Close #47468 (tcl has a use case that requires `strip -x tclStubLib.o`
to strip local symbols not referenced by relocations.)

Pull Request: https://github.com/llvm/llvm-project/pull/130704
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In GNU objcopy, symbols referenced by relocations are retained. Our COFF
(https://reviews.llvm.org/D56480) and Mach-O
(https://reviews.llvm.org/D75104) ports port the behavior, but the ELF
port doesn't.

This PR implements the behavior for ELF.
Close #47468 (tcl has a use case that requires `strip -x tclStubLib.o`
to strip local symbols not referenced by relocations.)

Pull Request: https://github.com/llvm/llvm-project/pull/130704
</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[llvm-objcopy][ELF] Add an option to remove notes (#118739)"</title>
<updated>2025-01-23T23:22:04+00:00</updated>
<author>
<name>Igor Kudrin</name>
<email>ikudrin@accesssoftek.com</email>
</author>
<published>2025-01-23T22:27:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=10772807ab72ce2b68d76816f8753219b2acbac3'/>
<id>10772807ab72ce2b68d76816f8753219b2acbac3</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[llvm-objcopy][ELF] Add an option to remove notes (#118739)"</title>
<updated>2025-01-23T22:57:29+00:00</updated>
<author>
<name>Igor Kudrin</name>
<email>ikudrin@accesssoftek.com</email>
</author>
<published>2025-01-23T22:57:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=621e5cd8204596874c2ec7c8c169044d8e6865e3'/>
<id>621e5cd8204596874c2ec7c8c169044d8e6865e3</id>
<content type='text'>
This reverts commit 9324e6a7a5c5adc5b5c38c3e3cbecd7e1e98876a.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 9324e6a7a5c5adc5b5c38c3e3cbecd7e1e98876a.
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm-objcopy][ELF] Add an option to remove notes (#118739)</title>
<updated>2025-01-23T22:27:40+00:00</updated>
<author>
<name>Igor Kudrin</name>
<email>ikudrin@accesssoftek.com</email>
</author>
<published>2025-01-23T22:27:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9324e6a7a5c5adc5b5c38c3e3cbecd7e1e98876a'/>
<id>9324e6a7a5c5adc5b5c38c3e3cbecd7e1e98876a</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm-objcopy] Add support of symbol modification flags for MachO (#120895)</title>
<updated>2024-12-24T14:05:10+00:00</updated>
<author>
<name>Richard Dzenis</name>
<email>richard@dzenis.dev</email>
</author>
<published>2024-12-24T14:05:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=334a5766d7591bfaadf6990b3d8568c9688e22a5'/>
<id>334a5766d7591bfaadf6990b3d8568c9688e22a5</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
<entry>
<title>[doc] Fix rendering for objcopy's --remove-symbol-prefix option text (#111131)</title>
<updated>2024-10-04T13:04:24+00:00</updated>
<author>
<name>bd1976bris</name>
<email>bd1976llvm@gmail.com</email>
</author>
<published>2024-10-04T13:04:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=097379ac9b0bd06d2437803fc7b1d00664b21383'/>
<id>097379ac9b0bd06d2437803fc7b1d00664b21383</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm-objcopy] Add --change-section-address (#98664)</title>
<updated>2024-07-30T09:57:57+00:00</updated>
<author>
<name>Eleanor Bonnici</name>
<email>eleanor.bonnici@arm.com</email>
</author>
<published>2024-07-30T09:57:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2b2f4ae0fbe366ebaa8811bed567a6ff76bbe3b1'/>
<id>2b2f4ae0fbe366ebaa8811bed567a6ff76bbe3b1</id>
<content type='text'>
--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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
--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.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm-objcopy] Add verification of added .note section format</title>
<updated>2024-07-11T15:59:19+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2024-04-29T11:27:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fb5a38bb4930736b0aab3ce428b60245921f982f'/>
<id>fb5a38bb4930736b0aab3ce428b60245921f982f</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm-objcopy] Add change-section-lma *+/-offset (#95431)</title>
<updated>2024-07-08T16:17:09+00:00</updated>
<author>
<name>Eleanor Bonnici</name>
<email>eleanor.bonnici@arm.com</email>
</author>
<published>2024-07-08T16:17:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3320036370ba3719471ab243f253237e88996495'/>
<id>3320036370ba3719471ab243f253237e88996495</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
</feed>
