1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730
|
.\" Man page generated from reStructuredText.
.
.TH "LLVM-OBJCOPY" "1" "2021-09-18" "13" "LLVM"
.SH NAME
llvm-objcopy \- object copying and editing tool
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBllvm\-objcopy\fP [\fIoptions\fP] \fIinput\fP [\fIoutput\fP]
.SH DESCRIPTION
.sp
\fBllvm\-objcopy\fP is a tool to copy and manipulate objects. In basic
usage, it makes a semantic copy of the input to the output. If any options are
specified, the output may be modified along the way, e.g. by removing sections.
.sp
If no output file is specified, the input file is modified in\-place. If “\-” is
specified for the input file, the input is read from the program’s standard
input stream. If “\-” is specified for the output file, the output is written to
the standard output stream of the program.
.sp
If the input is an archive, any requested operations will be applied to each
archive member individually.
.sp
The tool is still in active development, but in most scenarios it works as a
drop\-in replacement for GNU’s \fBobjcopy\fP\&.
.SH GENERIC AND CROSS-PLATFORM OPTIONS
.sp
The following options are either agnostic of the file format, or apply to
multiple file formats.
.INDENT 0.0
.TP
.B \-\-add\-gnu\-debuglink <debug\-file>
Add a .gnu_debuglink section for \fB<debug\-file>\fP to the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-add\-section <section=file>
Add a section named \fB<section>\fP with the contents of \fB<file>\fP to the
output. For ELF objects the section will be of type \fISHT_NOTE\fP, if the name
starts with “.note”. Otherwise, it will have type \fISHT_PROGBITS\fP\&. Can be
specified multiple times to add multiple sections.
.sp
For MachO objects, \fB<section>\fP must be formatted as
\fB<segment name>,<section name>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-binary\-architecture <arch>, \-B
Ignored for compatibility.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-disable\-deterministic\-archives, \-U
Use real values for UIDs, GIDs and timestamps when updating archive member
headers.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-discard\-all, \-x
Remove most local symbols from the output. Different file formats may limit
this to a subset of the local symbols. For example, file and section symbols in
ELF objects will not be discarded. Additionally, remove all debug sections.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-dump\-section <section>=<file>
Dump the contents of section \fB<section>\fP into the file \fB<file>\fP\&. Can be
specified multiple times to dump multiple sections to different files.
\fB<file>\fP is unrelated to the input and output files provided to
\fBllvm\-objcopy\fP and as such the normal copying and editing
operations will still be performed. No operations are performed on the sections
prior to dumping them.
.sp
For MachO objects, \fB<section>\fP must be formatted as
\fB<segment name>,<section name>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-enable\-deterministic\-archives, \-D
Enable deterministic mode when copying archives, i.e. use 0 for archive member
header UIDs, GIDs and timestamp fields. On by default.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-help, \-h
Print a summary of command line options.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-only\-keep\-debug
Produce a debug file as the output that only preserves contents of sections
useful for debugging purposes.
.sp
For ELF objects, this removes the contents of \fISHF_ALLOC\fP sections that are not
\fISHT_NOTE\fP by making them \fISHT_NOBITS\fP and shrinking the program headers where
possible.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-only\-section <section>, \-j
Remove all sections from the output, except for sections named \fB<section>\fP\&.
Can be specified multiple times to keep multiple sections.
.sp
For MachO objects, \fB<section>\fP must be formatted as
\fB<segment name>,<section name>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-redefine\-sym <old>=<new>
Rename symbols called \fB<old>\fP to \fB<new>\fP in the output. Can be specified
multiple times to rename multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-redefine\-syms <filename>
Rename symbols in the output as described in the file \fB<filename>\fP\&. In the
file, each line represents a single symbol to rename, with the old name and new
name separated by whitespace. Leading and trailing whitespace is ignored, as is
anything following a ‘#’. Can be specified multiple times to read names from
multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-regex
If specified, symbol and section names specified by other switches are treated
as extended POSIX regular expression patterns.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-remove\-section <section>, \-R
Remove the specified section from the output. Can be specified multiple times
to remove multiple sections simultaneously.
.sp
For MachO objects, \fB<section>\fP must be formatted as
\fB<segment name>,<section name>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-set\-section\-alignment <section>=<align>
Set the alignment of section \fB<section>\fP to \fI<align>\(ga\fP\&. Can be specified
multiple times to update multiple sections.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-set\-section\-flags <section>=<flag>[,<flag>,...]
Set section properties in the output of section \fB<section>\fP based on the
specified \fB<flag>\fP values. Can be specified multiple times to update multiple
sections.
.sp
Supported flag names are \fIalloc\fP, \fIload\fP, \fInoload\fP, \fIreadonly\fP, \fIexclude\fP,
\fIdebug\fP, \fIcode\fP, \fIdata\fP, \fIrom\fP, \fIshare\fP, \fIcontents\fP, \fImerge\fP and \fIstrings\fP\&. Not
all flags are meaningful for all object file formats.
.sp
For ELF objects, the flags have the following effects:
.INDENT 7.0
.IP \(bu 2
\fIalloc\fP = add the \fISHF_ALLOC\fP flag.
.IP \(bu 2
\fIload\fP = if the section has \fISHT_NOBITS\fP type, mark it as a \fISHT_PROGBITS\fP
section.
.IP \(bu 2
\fIreadonly\fP = if this flag is not specified, add the \fISHF_WRITE\fP flag.
.IP \(bu 2
\fIexclude\fP = add the \fISHF_EXCLUDE\fP flag.
.IP \(bu 2
\fIcode\fP = add the \fISHF_EXECINSTR\fP flag.
.IP \(bu 2
\fImerge\fP = add the \fISHF_MERGE\fP flag.
.IP \(bu 2
\fIstrings\fP = add the \fISHF_STRINGS\fP flag.
.IP \(bu 2
\fIcontents\fP = if the section has \fISHT_NOBITS\fP type, mark it as a \fISHT_PROGBITS\fP
section.
.UNINDENT
.sp
For COFF objects, the flags have the following effects:
.INDENT 7.0
.IP \(bu 2
\fIalloc\fP = add the \fIIMAGE_SCN_CNT_UNINITIALIZED_DATA\fP and \fIIMAGE_SCN_MEM_READ\fP
flags, unless the \fIload\fP flag is specified.
.IP \(bu 2
\fInoload\fP = add the \fIIMAGE_SCN_LNK_REMOVE\fP and \fIIMAGE_SCN_MEM_READ\fP flags.
.IP \(bu 2
\fIreadonly\fP = if this flag is not specified, add the \fIIMAGE_SCN_MEM_WRITE\fP
flag.
.IP \(bu 2
\fIexclude\fP = add the \fIIMAGE_SCN_LNK_REMOVE\fP and \fIIMAGE_SCN_MEM_READ\fP flags.
.IP \(bu 2
\fIdebug\fP = add the \fIIMAGE_SCN_CNT_INITIALIZED_DATA\fP,
\fIIMAGE_SCN_MEM_DISCARDABLE\fP and \fIIMAGE_SCN_MEM_READ\fP flags.
.IP \(bu 2
\fIcode\fP = add the \fIIMAGE_SCN_CNT_CODE\fP, \fIIMAGE_SCN_MEM_EXECUTE\fP and
\fIIMAGE_SCN_MEM_READ\fP flags.
.IP \(bu 2
\fIdata\fP = add the \fIIMAGE_SCN_CNT_INITIALIZED_DATA\fP and \fIIMAGE_SCN_MEM_READ\fP
flags.
.IP \(bu 2
\fIshare\fP = add the \fIIMAGE_SCN_MEM_SHARED\fP and \fIIMAGE_SCN_MEM_READ\fP flags.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-all\-gnu
Remove all symbols, debug sections and relocations from the output. This option
is equivalent to GNU \fBobjcopy\fP’s \fB\-\-strip\-all\fP switch.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-all, \-S
For ELF objects, remove from the output all symbols and non\-alloc sections not
within segments, except for .gnu.warning, .ARM.attribute sections and the
section name table.
.sp
For COFF and Mach\-O objects, remove all symbols, debug sections, and
relocations from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-debug, \-g
Remove all debug sections from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-symbol <symbol>, \-N
Remove all symbols named \fB<symbol>\fP from the output. Can be specified
multiple times to remove multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-symbols <filename>
Remove all symbols whose names appear in the file \fB<filename>\fP, from the
output. In the file, each line represents a single symbol name, with leading
and trailing whitespace ignored, as is anything following a ‘#’. Can be
specified multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-unneeded\-symbol <symbol>
Remove from the output all symbols named \fB<symbol>\fP that are local or
undefined and are not required by any relocation.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-unneeded\-symbols <filename>
Remove all symbols whose names appear in the file \fB<filename>\fP, from the
output, if they are local or undefined and are not required by any relocation.
In the file, each line represents a single symbol name, with leading and
trailing whitespace ignored, as is anything following a ‘#’. Can be specified
multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-unneeded
Remove from the output all local or undefined symbols that are not required by
relocations. Also remove all debug sections.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-version, \-V
Display the version of the \fBllvm\-objcopy\fP executable.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-wildcard, \-w
Allow wildcard syntax for symbol\-related flags. On by default for
section\-related flags. Incompatible with –regex.
.sp
Wildcard syntax allows the following special symbols:
.TS
center;
|l|l|l|.
_
T{
Character
T} T{
Meaning
T} T{
Equivalent
T}
_
T{
\fB*\fP
T} T{
Any number of characters
T} T{
\fB\&.*\fP
T}
_
T{
\fB?\fP
T} T{
Any single character
T} T{
\fB\&.\fP
T}
_
T{
\fB\e\fP
T} T{
Escape the next character
T} T{
\fB\e\fP
T}
_
T{
\fB[a\-z]\fP
T} T{
Character class
T} T{
\fB[a\-z]\fP
T}
_
T{
\fB[!a\-z]\fP, \fB[^a\-z]\fP
T} T{
Negated character class
T} T{
\fB[^a\-z]\fP
T}
_
.TE
.sp
Additionally, starting a wildcard with ‘!’ will prevent a match, even if
another flag matches. For example \fB\-w \-N \(aq*\(aq \-N \(aq!x\(aq\fP will strip all symbols
except for \fBx\fP\&.
.sp
The order of wildcards does not matter. For example, \fB\-w \-N \(aq*\(aq \-N \(aq!x\(aq\fP is
the same as \fB\-w \-N \(aq!x\(aq \-N \(aq*\(aq\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B @<FILE>
Read command\-line options and commands from response file \fI<FILE>\fP\&.
.UNINDENT
.SH ELF-SPECIFIC OPTIONS
.sp
The following options are implemented only for ELF objects. If used with other
objects, \fBllvm\-objcopy\fP will either emit an error or silently ignore
them.
.INDENT 0.0
.TP
.B \-\-add\-symbol <name>=[<section>:]<value>[,<flags>]
Add a new symbol called \fB<name>\fP to the output symbol table, in the section
named \fB<section>\fP, with value \fB<value>\fP\&. If \fB<section>\fP is not specified,
the symbol is added as an absolute symbol. The \fB<flags>\fP affect the symbol
properties. Accepted values are:
.INDENT 7.0
.IP \(bu 2
\fIglobal\fP = the symbol will have global binding.
.IP \(bu 2
\fIlocal\fP = the symbol will have local binding.
.IP \(bu 2
\fIweak\fP = the symbol will have weak binding.
.IP \(bu 2
\fIdefault\fP = the symbol will have default visibility.
.IP \(bu 2
\fIhidden\fP = the symbol will have hidden visibility.
.IP \(bu 2
\fIprotected\fP = the symbol will have protected visibility.
.IP \(bu 2
\fIfile\fP = the symbol will be an \fISTT_FILE\fP symbol.
.IP \(bu 2
\fIsection\fP = the symbol will be an \fISTT_SECTION\fP symbol.
.IP \(bu 2
\fIobject\fP = the symbol will be an \fISTT_OBJECT\fP symbol.
.IP \(bu 2
\fIfunction\fP = the symbol will be an \fISTT_FUNC\fP symbol.
.IP \(bu 2
\fIindirect\-function\fP = the symbol will be an \fISTT_GNU_IFUNC\fP symbol.
.UNINDENT
.sp
Additionally, the following flags are accepted but ignored: \fIdebug\fP,
\fIconstructor\fP, \fIwarning\fP, \fIindirect\fP, \fIsynthetic\fP, \fIunique\-object\fP, \fIbefore\fP\&.
.sp
Can be specified multiple times to add multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-allow\-broken\-links
Allow \fBllvm\-objcopy\fP to remove sections even if it would leave invalid
section references. Any invalid sh_link fields will be set to zero.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-change\-start <incr>, \-\-adjust\-start
Add \fB<incr>\fP to the program’s start address. Can be specified multiple
times, in which case the values will be applied cumulatively.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-compress\-debug\-sections [<style>]
Compress DWARF debug sections in the output, using the specified style.
Supported styles are \fIzlib\-gnu\fP and \fIzlib\fP\&. Defaults to \fIzlib\fP if no style is
specified.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-decompress\-debug\-sections
Decompress any compressed DWARF debug sections in the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-discard\-locals, \-X
Remove local symbols starting with “.L” from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-extract\-dwo
Remove all sections that are not DWARF .dwo sections from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-extract\-main\-partition
Extract the main partition from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-extract\-partition <name>
Extract the named partition from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-globalize\-symbol <symbol>
Mark any defined symbols named \fB<symbol>\fP as global symbols in the output.
Can be specified multiple times to mark multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-globalize\-symbols <filename>
Read a list of names from the file \fB<filename>\fP and mark defined symbols with
those names as global in the output. In the file, each line represents a single
symbol, with leading and trailing whitespace ignored, as is anything following
a ‘#’. Can be specified multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-input\-target <format>, \-I
Read the input as the specified format. See \fI\%SUPPORTED FORMATS\fP for a list of
valid \fB<format>\fP values. If unspecified, \fBllvm\-objcopy\fP will attempt
to determine the format automatically.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-file\-symbols
Keep symbols of type \fISTT_FILE\fP, even if they would otherwise be stripped.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-global\-symbol <symbol>
Make all symbols local in the output, except for symbols with the name
\fB<symbol>\fP\&. Can be specified multiple times to ignore multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-global\-symbols <filename>
Make all symbols local in the output, except for symbols named in the file
\fB<filename>\fP\&. In the file, each line represents a single symbol, with leading
and trailing whitespace ignored, as is anything following a ‘#’. Can be
specified multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-section <section>
When removing sections from the output, do not remove sections named
\fB<section>\fP\&. Can be specified multiple times to keep multiple sections.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-symbol <symbol>, \-K
When removing symbols from the output, do not remove symbols named
\fB<symbol>\fP\&. Can be specified multiple times to keep multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-symbols <filename>
When removing symbols from the output do not remove symbols named in the file
\fB<filename>\fP\&. In the file, each line represents a single symbol, with leading
and trailing whitespace ignored, as is anything following a ‘#’. Can be
specified multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-localize\-hidden
Make all symbols with hidden or internal visibility local in the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-localize\-symbol <symbol>, \-L
Mark any defined non\-common symbol named \fB<symbol>\fP as a local symbol in the
output. Can be specified multiple times to mark multiple symbols as local.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-localize\-symbols <filename>
Read a list of names from the file \fB<filename>\fP and mark defined non\-common
symbols with those names as local in the output. In the file, each line
represents a single symbol, with leading and trailing whitespace ignored, as is
anything following a ‘#’. Can be specified multiple times to read names from
multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-new\-symbol\-visibility <visibility>
Specify the visibility of the symbols automatically created when using binary
input or \fI\%\-\-add\-symbol\fP\&. Valid options are:
.INDENT 7.0
.IP \(bu 2
\fIdefault\fP
.IP \(bu 2
\fIhidden\fP
.IP \(bu 2
\fIinternal\fP
.IP \(bu 2
\fIprotected\fP
.UNINDENT
.sp
The default is \fIdefault\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-output\-target <format>, \-O
Write the output as the specified format. See \fI\%SUPPORTED FORMATS\fP for a list
of valid \fB<format>\fP values. If unspecified, the output format is assumed to
be the same as the value specified for \fI\%\-\-input\-target\fP or the input
file’s format if that option is also unspecified.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-prefix\-alloc\-sections <prefix>
Add \fB<prefix>\fP to the front of the names of all allocatable sections in the
output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-prefix\-symbols <prefix>
Add \fB<prefix>\fP to the front of every symbol name in the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-preserve\-dates, \-p
Preserve access and modification timestamps in the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-rename\-section <old>=<new>[,<flag>,...]
Rename sections called \fB<old>\fP to \fB<new>\fP in the output, and apply any
specified \fB<flag>\fP values. See \fI\%\-\-set\-section\-flags\fP for a list of
supported flags. Can be specified multiple times to rename multiple sections.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-set\-start\-addr <addr>
Set the start address of the output to \fB<addr>\fP\&. Overrides any previously
specified \fI\%\-\-change\-start\fP or \fI\%\-\-adjust\-start\fP options.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-split\-dwo <dwo\-file>
Equivalent to running \fBllvm\-objcopy\fP with \fI\%\-\-extract\-dwo\fP and
\fB<dwo\-file>\fP as the output file and no other options, and then with
\fI\%\-\-strip\-dwo\fP on the input file.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-dwo
Remove all DWARF .dwo sections from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-non\-alloc
Remove from the output all non\-allocatable sections that are not within
segments.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-sections
Remove from the output all section headers and all section data not within
segments. Note that many tools will not be able to use an object without
section headers.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-target <format>, \-F
Equivalent to \fI\%\-\-input\-target\fP and \fI\%\-\-output\-target\fP for the
specified format. See \fI\%SUPPORTED FORMATS\fP for a list of valid \fB<format>\fP
values.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-weaken\-symbol <symbol>, \-W
Mark any global symbol named \fB<symbol>\fP as a weak symbol in the output. Can
be specified multiple times to mark multiple symbols as weak.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-weaken\-symbols <filename>
Read a list of names from the file \fB<filename>\fP and mark global symbols with
those names as weak in the output. In the file, each line represents a single
symbol, with leading and trailing whitespace ignored, as is anything following
a ‘#’. Can be specified multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-weaken
Mark all defined global symbols as weak in the output.
.UNINDENT
.SH MACH-O-SPECIFIC OPTIONS
.INDENT 0.0
.TP
.B \-\-keep\-undefined
Keep undefined symbols, even if they would otherwise be stripped.
.UNINDENT
.SH SUPPORTED FORMATS
.sp
The following values are currently supported by \fBllvm\-objcopy\fP for the
\fI\%\-\-input\-target\fP, \fI\%\-\-output\-target\fP, and \fI\%\-\-target\fP
options. For GNU \fBobjcopy\fP compatibility, the values are all bfdnames.
.INDENT 0.0
.IP \(bu 2
\fIbinary\fP
.IP \(bu 2
\fIihex\fP
.IP \(bu 2
\fIelf32\-i386\fP
.IP \(bu 2
\fIelf32\-x86\-64\fP
.IP \(bu 2
\fIelf64\-x86\-64\fP
.IP \(bu 2
\fIelf32\-iamcu\fP
.IP \(bu 2
\fIelf32\-littlearm\fP
.IP \(bu 2
\fIelf64\-aarch64\fP
.IP \(bu 2
\fIelf64\-littleaarch64\fP
.IP \(bu 2
\fIelf32\-littleriscv\fP
.IP \(bu 2
\fIelf64\-littleriscv\fP
.IP \(bu 2
\fIelf32\-powerpc\fP
.IP \(bu 2
\fIelf32\-powerpcle\fP
.IP \(bu 2
\fIelf64\-powerpc\fP
.IP \(bu 2
\fIelf64\-powerpcle\fP
.IP \(bu 2
\fIelf32\-bigmips\fP
.IP \(bu 2
\fIelf32\-ntradbigmips\fP
.IP \(bu 2
\fIelf32\-ntradlittlemips\fP
.IP \(bu 2
\fIelf32\-tradbigmips\fP
.IP \(bu 2
\fIelf32\-tradlittlemips\fP
.IP \(bu 2
\fIelf64\-tradbigmips\fP
.IP \(bu 2
\fIelf64\-tradlittlemips\fP
.IP \(bu 2
\fIelf32\-sparc\fP
.IP \(bu 2
\fIelf32\-sparcel\fP
.UNINDENT
.sp
Additionally, all targets except \fIbinary\fP and \fIihex\fP can have \fI\-freebsd\fP as a
suffix.
.SH BINARY INPUT AND OUTPUT
.sp
If \fIbinary\fP is used as the value for \fI\%\-\-input\-target\fP, the input file
will be embedded as a data section in an ELF relocatable object, with symbols
\fB_binary_<file_name>_start\fP, \fB_binary_<file_name>_end\fP, and
\fB_binary_<file_name>_size\fP representing the start, end and size of the data,
where \fB<file_name>\fP is the path of the input file as specified on the command
line with non\-alphanumeric characters converted to \fB_\fP\&.
.sp
If \fIbinary\fP is used as the value for \fI\%\-\-output\-target\fP, the output file
will be a raw binary file, containing the memory image of the input file.
Symbols and relocation information will be discarded. The image will start at
the address of the first loadable section in the output.
.SH EXIT STATUS
.sp
\fBllvm\-objcopy\fP exits with a non\-zero exit code if there is an error.
Otherwise, it exits with code 0.
.SH BUGS
.sp
To report bugs, please visit <\fI\%https://bugs.llvm.org/\fP>.
.sp
There is a known issue with \fI\%\-\-input\-target\fP and \fI\%\-\-target\fP
causing only \fBbinary\fP and \fBihex\fP formats to have any effect. Other values
will be ignored and \fBllvm\-objcopy\fP will attempt to guess the input
format.
.SH SEE ALSO
.sp
\fBllvm\-strip(1)\fP
.SH AUTHOR
Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT
2003-2021, LLVM Project
.\" Generated by docutils manpage writer.
.
|