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 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>llvm-objcopy - object copying and editing tool — LLVM 13 documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="llvm-objdump - LLVM’s object file dumper" href="llvm-objdump.html" />
<link rel="prev" title="llvm-nm - list LLVM bitcode and object file’s symbol table" href="llvm-nm.html" />
<style type="text/css">
table.right { float: right; margin-left: 20px; }
table.right td { border: 1px solid #ccc; }
</style>
</head><body>
<div class="logo">
<a href="../index.html">
<img src="../_static/logo.png"
alt="LLVM Logo" width="250" height="88"/></a>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="llvm-objdump.html" title="llvm-objdump - LLVM’s object file dumper"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="llvm-nm.html" title="llvm-nm - list LLVM bitcode and object file’s symbol table"
accesskey="P">previous</a> |</li>
<li><a href="https://llvm.org/">LLVM Home</a> | </li>
<li><a href="../index.html">Documentation</a>»</li>
<li class="nav-item nav-item-1"><a href="../Reference.html" >Reference</a> »</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">LLVM Command Guide</a> »</li>
<li class="nav-item nav-item-this"><a href="">llvm-objcopy - object copying and editing tool</a></li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3>Documentation</h3>
<ul class="want-points">
<li><a href="https://llvm.org/docs/GettingStartedTutorials.html">Getting Started/Tutorials</a></li>
<li><a href="https://llvm.org/docs/UserGuides.html">User Guides</a></li>
<li><a href="https://llvm.org/docs/Reference.html">Reference</a></li>
</ul>
<h3>Getting Involved</h3>
<ul class="want-points">
<li><a href="https://llvm.org/docs/Contributing.html">Contributing to LLVM</a></li>
<li><a href="https://llvm.org/docs/HowToSubmitABug.html">Submitting Bug Reports</a></li>
<li><a href="https://llvm.org/docs/GettingInvolved.html#mailing-lists">Mailing Lists</a></li>
<li><a href="https://llvm.org/docs/GettingInvolved.html#irc">IRC</a></li>
<li><a href="https://llvm.org/docs/GettingInvolved.html#meetups-and-social-events">Meetups and Social Events</a></li>
</ul>
<h3>Additional Links</h3>
<ul class="want-points">
<li><a href="https://llvm.org/docs/FAQ.html">FAQ</a></li>
<li><a href="https://llvm.org/docs/Lexicon.html">Glossary</a></li>
<li><a href="https://llvm.org/pubs">Publications</a></li>
<li><a href="https://github.com/llvm/llvm-project//">Github Repository</a></li>
</ul>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/CommandGuide/llvm-objcopy.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="llvm-objcopy-object-copying-and-editing-tool">
<h1>llvm-objcopy - object copying and editing tool<a class="headerlink" href="#llvm-objcopy-object-copying-and-editing-tool" title="Permalink to this headline">¶</a></h1>
<div class="section" id="synopsis">
<h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">llvm-objcopy</strong> [<em>options</em>] <em>input</em> [<em>output</em>]</p>
</div>
<div class="section" id="description">
<h2>DESCRIPTION<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">llvm-objcopy</strong> 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.</p>
<p>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.</p>
<p>If the input is an archive, any requested operations will be applied to each
archive member individually.</p>
<p>The tool is still in active development, but in most scenarios it works as a
drop-in replacement for GNU’s <strong class="program">objcopy</strong>.</p>
</div>
<div class="section" id="generic-and-cross-platform-options">
<h2>GENERIC AND CROSS-PLATFORM OPTIONS<a class="headerlink" href="#generic-and-cross-platform-options" title="Permalink to this headline">¶</a></h2>
<p>The following options are either agnostic of the file format, or apply to
multiple file formats.</p>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-add-gnu-debuglink">
<code class="sig-name descname"><span class="pre">--add-gnu-debuglink</span></code><code class="sig-prename descclassname"> <span class="pre"><debug-file></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-add-gnu-debuglink" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a .gnu_debuglink section for <code class="docutils literal notranslate"><span class="pre"><debug-file></span></code> to the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-add-section">
<code class="sig-name descname"><span class="pre">--add-section</span></code><code class="sig-prename descclassname"> <span class="pre"><section=file></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-add-section" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a section named <code class="docutils literal notranslate"><span class="pre"><section></span></code> with the contents of <code class="docutils literal notranslate"><span class="pre"><file></span></code> to the
output. For ELF objects the section will be of type <cite>SHT_NOTE</cite>, if the name
starts with “.note”. Otherwise, it will have type <cite>SHT_PROGBITS</cite>. Can be
specified multiple times to add multiple sections.</p>
<p>For MachO objects, <code class="docutils literal notranslate"><span class="pre"><section></span></code> must be formatted as
<code class="docutils literal notranslate"><span class="pre"><segment</span> <span class="pre">name>,<section</span> <span class="pre">name></span></code>.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-binary-architecture">
<span id="cmdoption-llvm-objcopy-B"></span><span id="cmdoption-llvm-objcopy-b"></span><code class="sig-name descname"><span class="pre">--binary-architecture</span></code><code class="sig-prename descclassname"> <span class="pre"><arch></span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-B</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-binary-architecture" title="Permalink to this definition">¶</a></dt>
<dd><p>Ignored for compatibility.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-disable-deterministic-archives">
<span id="cmdoption-llvm-objcopy-U"></span><span id="cmdoption-llvm-objcopy-u"></span><code class="sig-name descname"><span class="pre">--disable-deterministic-archives</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-U</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-disable-deterministic-archives" title="Permalink to this definition">¶</a></dt>
<dd><p>Use real values for UIDs, GIDs and timestamps when updating archive member
headers.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-discard-all">
<span id="cmdoption-llvm-objcopy-x"></span><code class="sig-name descname"><span class="pre">--discard-all</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-x</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-discard-all" title="Permalink to this definition">¶</a></dt>
<dd><p>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.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-dump-section">
<code class="sig-name descname"><span class="pre">--dump-section</span></code><code class="sig-prename descclassname"> <span class="pre"><section>=<file></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-dump-section" title="Permalink to this definition">¶</a></dt>
<dd><p>Dump the contents of section <code class="docutils literal notranslate"><span class="pre"><section></span></code> into the file <code class="docutils literal notranslate"><span class="pre"><file></span></code>. Can be
specified multiple times to dump multiple sections to different files.
<code class="docutils literal notranslate"><span class="pre"><file></span></code> is unrelated to the input and output files provided to
<strong class="program">llvm-objcopy</strong> and as such the normal copying and editing
operations will still be performed. No operations are performed on the sections
prior to dumping them.</p>
<p>For MachO objects, <code class="docutils literal notranslate"><span class="pre"><section></span></code> must be formatted as
<code class="docutils literal notranslate"><span class="pre"><segment</span> <span class="pre">name>,<section</span> <span class="pre">name></span></code>.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-enable-deterministic-archives">
<span id="cmdoption-llvm-objcopy-D"></span><span id="cmdoption-llvm-objcopy-d"></span><code class="sig-name descname"><span class="pre">--enable-deterministic-archives</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-D</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-enable-deterministic-archives" title="Permalink to this definition">¶</a></dt>
<dd><p>Enable deterministic mode when copying archives, i.e. use 0 for archive member
header UIDs, GIDs and timestamp fields. On by default.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-help">
<span id="cmdoption-llvm-objcopy-h"></span><code class="sig-name descname"><span class="pre">--help</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-h</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-help" title="Permalink to this definition">¶</a></dt>
<dd><p>Print a summary of command line options.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-only-keep-debug">
<code class="sig-name descname"><span class="pre">--only-keep-debug</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-only-keep-debug" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce a debug file as the output that only preserves contents of sections
useful for debugging purposes.</p>
<p>For ELF objects, this removes the contents of <cite>SHF_ALLOC</cite> sections that are not
<cite>SHT_NOTE</cite> by making them <cite>SHT_NOBITS</cite> and shrinking the program headers where
possible.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-only-section">
<span id="cmdoption-llvm-objcopy-j"></span><code class="sig-name descname"><span class="pre">--only-section</span></code><code class="sig-prename descclassname"> <span class="pre"><section></span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-j</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-only-section" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all sections from the output, except for sections named <code class="docutils literal notranslate"><span class="pre"><section></span></code>.
Can be specified multiple times to keep multiple sections.</p>
<p>For MachO objects, <code class="docutils literal notranslate"><span class="pre"><section></span></code> must be formatted as
<code class="docutils literal notranslate"><span class="pre"><segment</span> <span class="pre">name>,<section</span> <span class="pre">name></span></code>.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-redefine-sym">
<code class="sig-name descname"><span class="pre">--redefine-sym</span></code><code class="sig-prename descclassname"> <span class="pre"><old>=<new></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-redefine-sym" title="Permalink to this definition">¶</a></dt>
<dd><p>Rename symbols called <code class="docutils literal notranslate"><span class="pre"><old></span></code> to <code class="docutils literal notranslate"><span class="pre"><new></span></code> in the output. Can be specified
multiple times to rename multiple symbols.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-redefine-syms">
<code class="sig-name descname"><span class="pre">--redefine-syms</span></code><code class="sig-prename descclassname"> <span class="pre"><filename></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-redefine-syms" title="Permalink to this definition">¶</a></dt>
<dd><p>Rename symbols in the output as described in the file <code class="docutils literal notranslate"><span class="pre"><filename></span></code>. 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.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-regex">
<code class="sig-name descname"><span class="pre">--regex</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-regex" title="Permalink to this definition">¶</a></dt>
<dd><p>If specified, symbol and section names specified by other switches are treated
as extended POSIX regular expression patterns.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-remove-section">
<span id="cmdoption-llvm-objcopy-R"></span><span id="cmdoption-llvm-objcopy-r"></span><code class="sig-name descname"><span class="pre">--remove-section</span></code><code class="sig-prename descclassname"> <span class="pre"><section></span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-R</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-remove-section" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove the specified section from the output. Can be specified multiple times
to remove multiple sections simultaneously.</p>
<p>For MachO objects, <code class="docutils literal notranslate"><span class="pre"><section></span></code> must be formatted as
<code class="docutils literal notranslate"><span class="pre"><segment</span> <span class="pre">name>,<section</span> <span class="pre">name></span></code>.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-set-section-alignment">
<code class="sig-name descname"><span class="pre">--set-section-alignment</span></code><code class="sig-prename descclassname"> <span class="pre"><section>=<align></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-set-section-alignment" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the alignment of section <code class="docutils literal notranslate"><span class="pre"><section></span></code> to <cite><align>`</cite>. Can be specified
multiple times to update multiple sections.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-set-section-flags">
<code class="sig-name descname"><span class="pre">--set-section-flags</span></code><code class="sig-prename descclassname"> <span class="pre"><section>=<flag>[,<flag>,...]</span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-set-section-flags" title="Permalink to this definition">¶</a></dt>
<dd><p>Set section properties in the output of section <code class="docutils literal notranslate"><span class="pre"><section></span></code> based on the
specified <code class="docutils literal notranslate"><span class="pre"><flag></span></code> values. Can be specified multiple times to update multiple
sections.</p>
<p>Supported flag names are <cite>alloc</cite>, <cite>load</cite>, <cite>noload</cite>, <cite>readonly</cite>, <cite>exclude</cite>,
<cite>debug</cite>, <cite>code</cite>, <cite>data</cite>, <cite>rom</cite>, <cite>share</cite>, <cite>contents</cite>, <cite>merge</cite> and <cite>strings</cite>. Not
all flags are meaningful for all object file formats.</p>
<p>For ELF objects, the flags have the following effects:</p>
<ul class="simple">
<li><p><cite>alloc</cite> = add the <cite>SHF_ALLOC</cite> flag.</p></li>
<li><p><cite>load</cite> = if the section has <cite>SHT_NOBITS</cite> type, mark it as a <cite>SHT_PROGBITS</cite>
section.</p></li>
<li><p><cite>readonly</cite> = if this flag is not specified, add the <cite>SHF_WRITE</cite> flag.</p></li>
<li><p><cite>exclude</cite> = add the <cite>SHF_EXCLUDE</cite> flag.</p></li>
<li><p><cite>code</cite> = add the <cite>SHF_EXECINSTR</cite> flag.</p></li>
<li><p><cite>merge</cite> = add the <cite>SHF_MERGE</cite> flag.</p></li>
<li><p><cite>strings</cite> = add the <cite>SHF_STRINGS</cite> flag.</p></li>
<li><p><cite>contents</cite> = if the section has <cite>SHT_NOBITS</cite> type, mark it as a <cite>SHT_PROGBITS</cite>
section.</p></li>
</ul>
<p>For COFF objects, the flags have the following effects:</p>
<ul class="simple">
<li><p><cite>alloc</cite> = add the <cite>IMAGE_SCN_CNT_UNINITIALIZED_DATA</cite> and <cite>IMAGE_SCN_MEM_READ</cite>
flags, unless the <cite>load</cite> flag is specified.</p></li>
<li><p><cite>noload</cite> = add the <cite>IMAGE_SCN_LNK_REMOVE</cite> and <cite>IMAGE_SCN_MEM_READ</cite> flags.</p></li>
<li><p><cite>readonly</cite> = if this flag is not specified, add the <cite>IMAGE_SCN_MEM_WRITE</cite>
flag.</p></li>
<li><p><cite>exclude</cite> = add the <cite>IMAGE_SCN_LNK_REMOVE</cite> and <cite>IMAGE_SCN_MEM_READ</cite> flags.</p></li>
<li><p><cite>debug</cite> = add the <cite>IMAGE_SCN_CNT_INITIALIZED_DATA</cite>,
<cite>IMAGE_SCN_MEM_DISCARDABLE</cite> and <cite>IMAGE_SCN_MEM_READ</cite> flags.</p></li>
<li><p><cite>code</cite> = add the <cite>IMAGE_SCN_CNT_CODE</cite>, <cite>IMAGE_SCN_MEM_EXECUTE</cite> and
<cite>IMAGE_SCN_MEM_READ</cite> flags.</p></li>
<li><p><cite>data</cite> = add the <cite>IMAGE_SCN_CNT_INITIALIZED_DATA</cite> and <cite>IMAGE_SCN_MEM_READ</cite>
flags.</p></li>
<li><p><cite>share</cite> = add the <cite>IMAGE_SCN_MEM_SHARED</cite> and <cite>IMAGE_SCN_MEM_READ</cite> flags.</p></li>
</ul>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-strip-all-gnu">
<code class="sig-name descname"><span class="pre">--strip-all-gnu</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-strip-all-gnu" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all symbols, debug sections and relocations from the output. This option
is equivalent to GNU <strong class="program">objcopy</strong>’s <code class="docutils literal notranslate"><span class="pre">--strip-all</span></code> switch.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-strip-all">
<span id="cmdoption-llvm-objcopy-S"></span><span id="cmdoption-llvm-objcopy-s"></span><code class="sig-name descname"><span class="pre">--strip-all</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-S</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-strip-all" title="Permalink to this definition">¶</a></dt>
<dd><p>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.</p>
<p>For COFF and Mach-O objects, remove all symbols, debug sections, and
relocations from the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-strip-debug">
<span id="cmdoption-llvm-objcopy-g"></span><code class="sig-name descname"><span class="pre">--strip-debug</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-g</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-strip-debug" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all debug sections from the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-strip-symbol">
<span id="cmdoption-llvm-objcopy-N"></span><span id="cmdoption-llvm-objcopy-n"></span><code class="sig-name descname"><span class="pre">--strip-symbol</span></code><code class="sig-prename descclassname"> <span class="pre"><symbol></span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-N</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-strip-symbol" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all symbols named <code class="docutils literal notranslate"><span class="pre"><symbol></span></code> from the output. Can be specified
multiple times to remove multiple symbols.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-strip-symbols">
<code class="sig-name descname"><span class="pre">--strip-symbols</span></code><code class="sig-prename descclassname"> <span class="pre"><filename></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-strip-symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all symbols whose names appear in the file <code class="docutils literal notranslate"><span class="pre"><filename></span></code>, 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.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-strip-unneeded-symbol">
<code class="sig-name descname"><span class="pre">--strip-unneeded-symbol</span></code><code class="sig-prename descclassname"> <span class="pre"><symbol></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-strip-unneeded-symbol" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove from the output all symbols named <code class="docutils literal notranslate"><span class="pre"><symbol></span></code> that are local or
undefined and are not required by any relocation.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-strip-unneeded-symbols">
<code class="sig-name descname"><span class="pre">--strip-unneeded-symbols</span></code><code class="sig-prename descclassname"> <span class="pre"><filename></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-strip-unneeded-symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all symbols whose names appear in the file <code class="docutils literal notranslate"><span class="pre"><filename></span></code>, 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.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-strip-unneeded">
<code class="sig-name descname"><span class="pre">--strip-unneeded</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-strip-unneeded" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove from the output all local or undefined symbols that are not required by
relocations. Also remove all debug sections.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-version">
<span id="cmdoption-llvm-objcopy-V"></span><span id="cmdoption-llvm-objcopy-v"></span><code class="sig-name descname"><span class="pre">--version</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-V</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-version" title="Permalink to this definition">¶</a></dt>
<dd><p>Display the version of the <strong class="program">llvm-objcopy</strong> executable.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-wildcard">
<span id="cmdoption-llvm-objcopy-w"></span><code class="sig-name descname"><span class="pre">--wildcard</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-w</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-wildcard" title="Permalink to this definition">¶</a></dt>
<dd><p>Allow wildcard syntax for symbol-related flags. On by default for
section-related flags. Incompatible with –regex.</p>
<p>Wildcard syntax allows the following special symbols:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 34%" />
<col style="width: 38%" />
<col style="width: 28%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Character</p></th>
<th class="head"><p>Meaning</p></th>
<th class="head"><p>Equivalent</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">*</span></code></p></td>
<td><p>Any number of characters</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">.*</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">?</span></code></p></td>
<td><p>Any single character</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">.</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\</span></code></p></td>
<td><p>Escape the next character</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">\</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">[a-z]</span></code></p></td>
<td><p>Character class</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">[a-z]</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">[!a-z]</span></code>, <code class="docutils literal notranslate"><span class="pre">[^a-z]</span></code></p></td>
<td><p>Negated character class</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">[^a-z]</span></code></p></td>
</tr>
</tbody>
</table>
<p>Additionally, starting a wildcard with ‘!’ will prevent a match, even if
another flag matches. For example <code class="docutils literal notranslate"><span class="pre">-w</span> <span class="pre">-N</span> <span class="pre">'*'</span> <span class="pre">-N</span> <span class="pre">'!x'</span></code> will strip all symbols
except for <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p>
<p>The order of wildcards does not matter. For example, <code class="docutils literal notranslate"><span class="pre">-w</span> <span class="pre">-N</span> <span class="pre">'*'</span> <span class="pre">-N</span> <span class="pre">'!x'</span></code> is
the same as <code class="docutils literal notranslate"><span class="pre">-w</span> <span class="pre">-N</span> <span class="pre">'!x'</span> <span class="pre">-N</span> <span class="pre">'*'</span></code>.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-arg-FILE">
<span id="cmdoption-llvm-objcopy-arg-file"></span><code class="sig-name descname"><span class="pre">@<FILE></span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-arg-FILE" title="Permalink to this definition">¶</a></dt>
<dd><p>Read command-line options and commands from response file <cite><FILE></cite>.</p>
</dd></dl>
</div>
<div class="section" id="elf-specific-options">
<h2>ELF-SPECIFIC OPTIONS<a class="headerlink" href="#elf-specific-options" title="Permalink to this headline">¶</a></h2>
<p>The following options are implemented only for ELF objects. If used with other
objects, <strong class="program">llvm-objcopy</strong> will either emit an error or silently ignore
them.</p>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-add-symbol">
<code class="sig-name descname"><span class="pre">--add-symbol</span></code><code class="sig-prename descclassname"> <span class="pre"><name>=[<section>:]<value>[,<flags>]</span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-add-symbol" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a new symbol called <code class="docutils literal notranslate"><span class="pre"><name></span></code> to the output symbol table, in the section
named <code class="docutils literal notranslate"><span class="pre"><section></span></code>, with value <code class="docutils literal notranslate"><span class="pre"><value></span></code>. If <code class="docutils literal notranslate"><span class="pre"><section></span></code> is not specified,
the symbol is added as an absolute symbol. The <code class="docutils literal notranslate"><span class="pre"><flags></span></code> affect the symbol
properties. Accepted values are:</p>
<ul class="simple">
<li><p><cite>global</cite> = the symbol will have global binding.</p></li>
<li><p><cite>local</cite> = the symbol will have local binding.</p></li>
<li><p><cite>weak</cite> = the symbol will have weak binding.</p></li>
<li><p><cite>default</cite> = the symbol will have default visibility.</p></li>
<li><p><cite>hidden</cite> = the symbol will have hidden visibility.</p></li>
<li><p><cite>protected</cite> = the symbol will have protected visibility.</p></li>
<li><p><cite>file</cite> = the symbol will be an <cite>STT_FILE</cite> symbol.</p></li>
<li><p><cite>section</cite> = the symbol will be an <cite>STT_SECTION</cite> symbol.</p></li>
<li><p><cite>object</cite> = the symbol will be an <cite>STT_OBJECT</cite> symbol.</p></li>
<li><p><cite>function</cite> = the symbol will be an <cite>STT_FUNC</cite> symbol.</p></li>
<li><p><cite>indirect-function</cite> = the symbol will be an <cite>STT_GNU_IFUNC</cite> symbol.</p></li>
</ul>
<p>Additionally, the following flags are accepted but ignored: <cite>debug</cite>,
<cite>constructor</cite>, <cite>warning</cite>, <cite>indirect</cite>, <cite>synthetic</cite>, <cite>unique-object</cite>, <cite>before</cite>.</p>
<p>Can be specified multiple times to add multiple symbols.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-allow-broken-links">
<code class="sig-name descname"><span class="pre">--allow-broken-links</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-allow-broken-links" title="Permalink to this definition">¶</a></dt>
<dd><p>Allow <strong class="program">llvm-objcopy</strong> to remove sections even if it would leave invalid
section references. Any invalid sh_link fields will be set to zero.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-change-start">
<span id="cmdoption-llvm-objcopy-adjust-start"></span><code class="sig-name descname"><span class="pre">--change-start</span></code><code class="sig-prename descclassname"> <span class="pre"><incr></span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">--adjust-start</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-change-start" title="Permalink to this definition">¶</a></dt>
<dd><p>Add <code class="docutils literal notranslate"><span class="pre"><incr></span></code> to the program’s start address. Can be specified multiple
times, in which case the values will be applied cumulatively.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-compress-debug-sections">
<code class="sig-name descname"><span class="pre">--compress-debug-sections</span></code><code class="sig-prename descclassname"> <span class="pre">[<style>]</span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-compress-debug-sections" title="Permalink to this definition">¶</a></dt>
<dd><p>Compress DWARF debug sections in the output, using the specified style.
Supported styles are <cite>zlib-gnu</cite> and <cite>zlib</cite>. Defaults to <cite>zlib</cite> if no style is
specified.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-decompress-debug-sections">
<code class="sig-name descname"><span class="pre">--decompress-debug-sections</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-decompress-debug-sections" title="Permalink to this definition">¶</a></dt>
<dd><p>Decompress any compressed DWARF debug sections in the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-discard-locals">
<span id="cmdoption-llvm-objcopy-X"></span><code class="sig-name descname"><span class="pre">--discard-locals</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-X</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-discard-locals" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove local symbols starting with “.L” from the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-extract-dwo">
<code class="sig-name descname"><span class="pre">--extract-dwo</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-extract-dwo" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all sections that are not DWARF .dwo sections from the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-extract-main-partition">
<code class="sig-name descname"><span class="pre">--extract-main-partition</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-extract-main-partition" title="Permalink to this definition">¶</a></dt>
<dd><p>Extract the main partition from the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-extract-partition">
<code class="sig-name descname"><span class="pre">--extract-partition</span></code><code class="sig-prename descclassname"> <span class="pre"><name></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-extract-partition" title="Permalink to this definition">¶</a></dt>
<dd><p>Extract the named partition from the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-globalize-symbol">
<code class="sig-name descname"><span class="pre">--globalize-symbol</span></code><code class="sig-prename descclassname"> <span class="pre"><symbol></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-globalize-symbol" title="Permalink to this definition">¶</a></dt>
<dd><p>Mark any defined symbols named <code class="docutils literal notranslate"><span class="pre"><symbol></span></code> as global symbols in the output.
Can be specified multiple times to mark multiple symbols.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-globalize-symbols">
<code class="sig-name descname"><span class="pre">--globalize-symbols</span></code><code class="sig-prename descclassname"> <span class="pre"><filename></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-globalize-symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>Read a list of names from the file <code class="docutils literal notranslate"><span class="pre"><filename></span></code> 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.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-input-target">
<span id="cmdoption-llvm-objcopy-I"></span><span id="cmdoption-llvm-objcopy-i"></span><code class="sig-name descname"><span class="pre">--input-target</span></code><code class="sig-prename descclassname"> <span class="pre"><format></span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-I</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-input-target" title="Permalink to this definition">¶</a></dt>
<dd><p>Read the input as the specified format. See <a class="reference internal" href="#supported-formats">SUPPORTED FORMATS</a> for a list of
valid <code class="docutils literal notranslate"><span class="pre"><format></span></code> values. If unspecified, <strong class="program">llvm-objcopy</strong> will attempt
to determine the format automatically.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-keep-file-symbols">
<code class="sig-name descname"><span class="pre">--keep-file-symbols</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-keep-file-symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>Keep symbols of type <cite>STT_FILE</cite>, even if they would otherwise be stripped.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-keep-global-symbol">
<code class="sig-name descname"><span class="pre">--keep-global-symbol</span></code><code class="sig-prename descclassname"> <span class="pre"><symbol></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-keep-global-symbol" title="Permalink to this definition">¶</a></dt>
<dd><p>Make all symbols local in the output, except for symbols with the name
<code class="docutils literal notranslate"><span class="pre"><symbol></span></code>. Can be specified multiple times to ignore multiple symbols.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-keep-global-symbols">
<code class="sig-name descname"><span class="pre">--keep-global-symbols</span></code><code class="sig-prename descclassname"> <span class="pre"><filename></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-keep-global-symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>Make all symbols local in the output, except for symbols named in the file
<code class="docutils literal notranslate"><span class="pre"><filename></span></code>. 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.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-keep-section">
<code class="sig-name descname"><span class="pre">--keep-section</span></code><code class="sig-prename descclassname"> <span class="pre"><section></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-keep-section" title="Permalink to this definition">¶</a></dt>
<dd><p>When removing sections from the output, do not remove sections named
<code class="docutils literal notranslate"><span class="pre"><section></span></code>. Can be specified multiple times to keep multiple sections.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-keep-symbol">
<span id="cmdoption-llvm-objcopy-K"></span><span id="cmdoption-llvm-objcopy-k"></span><code class="sig-name descname"><span class="pre">--keep-symbol</span></code><code class="sig-prename descclassname"> <span class="pre"><symbol></span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-K</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-keep-symbol" title="Permalink to this definition">¶</a></dt>
<dd><p>When removing symbols from the output, do not remove symbols named
<code class="docutils literal notranslate"><span class="pre"><symbol></span></code>. Can be specified multiple times to keep multiple symbols.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-keep-symbols">
<code class="sig-name descname"><span class="pre">--keep-symbols</span></code><code class="sig-prename descclassname"> <span class="pre"><filename></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-keep-symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>When removing symbols from the output do not remove symbols named in the file
<code class="docutils literal notranslate"><span class="pre"><filename></span></code>. 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.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-localize-hidden">
<code class="sig-name descname"><span class="pre">--localize-hidden</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-localize-hidden" title="Permalink to this definition">¶</a></dt>
<dd><p>Make all symbols with hidden or internal visibility local in the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-localize-symbol">
<span id="cmdoption-llvm-objcopy-L"></span><span id="cmdoption-llvm-objcopy-l"></span><code class="sig-name descname"><span class="pre">--localize-symbol</span></code><code class="sig-prename descclassname"> <span class="pre"><symbol></span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-L</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-localize-symbol" title="Permalink to this definition">¶</a></dt>
<dd><p>Mark any defined non-common symbol named <code class="docutils literal notranslate"><span class="pre"><symbol></span></code> as a local symbol in the
output. Can be specified multiple times to mark multiple symbols as local.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-localize-symbols">
<code class="sig-name descname"><span class="pre">--localize-symbols</span></code><code class="sig-prename descclassname"> <span class="pre"><filename></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-localize-symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>Read a list of names from the file <code class="docutils literal notranslate"><span class="pre"><filename></span></code> 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.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-new-symbol-visibility">
<code class="sig-name descname"><span class="pre">--new-symbol-visibility</span></code><code class="sig-prename descclassname"> <span class="pre"><visibility></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-new-symbol-visibility" title="Permalink to this definition">¶</a></dt>
<dd><p>Specify the visibility of the symbols automatically created when using binary
input or <a class="reference internal" href="#cmdoption-llvm-objcopy-add-symbol"><code class="xref std std-option docutils literal notranslate"><span class="pre">--add-symbol</span></code></a>. Valid options are:</p>
<ul class="simple">
<li><p><cite>default</cite></p></li>
<li><p><cite>hidden</cite></p></li>
<li><p><cite>internal</cite></p></li>
<li><p><cite>protected</cite></p></li>
</ul>
<p>The default is <cite>default</cite>.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-output-target">
<span id="cmdoption-llvm-objcopy-O"></span><span id="cmdoption-llvm-objcopy-o"></span><code class="sig-name descname"><span class="pre">--output-target</span></code><code class="sig-prename descclassname"> <span class="pre"><format></span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-O</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-output-target" title="Permalink to this definition">¶</a></dt>
<dd><p>Write the output as the specified format. See <a class="reference internal" href="#supported-formats">SUPPORTED FORMATS</a> for a list
of valid <code class="docutils literal notranslate"><span class="pre"><format></span></code> values. If unspecified, the output format is assumed to
be the same as the value specified for <a class="reference internal" href="#cmdoption-llvm-objcopy-input-target"><code class="xref std std-option docutils literal notranslate"><span class="pre">--input-target</span></code></a> or the input
file’s format if that option is also unspecified.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-prefix-alloc-sections">
<code class="sig-name descname"><span class="pre">--prefix-alloc-sections</span></code><code class="sig-prename descclassname"> <span class="pre"><prefix></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-prefix-alloc-sections" title="Permalink to this definition">¶</a></dt>
<dd><p>Add <code class="docutils literal notranslate"><span class="pre"><prefix></span></code> to the front of the names of all allocatable sections in the
output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-prefix-symbols">
<code class="sig-name descname"><span class="pre">--prefix-symbols</span></code><code class="sig-prename descclassname"> <span class="pre"><prefix></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-prefix-symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>Add <code class="docutils literal notranslate"><span class="pre"><prefix></span></code> to the front of every symbol name in the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-preserve-dates">
<span id="cmdoption-llvm-objcopy-p"></span><code class="sig-name descname"><span class="pre">--preserve-dates</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-p</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-preserve-dates" title="Permalink to this definition">¶</a></dt>
<dd><p>Preserve access and modification timestamps in the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-rename-section">
<code class="sig-name descname"><span class="pre">--rename-section</span></code><code class="sig-prename descclassname"> <span class="pre"><old>=<new>[,<flag>,...]</span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-rename-section" title="Permalink to this definition">¶</a></dt>
<dd><p>Rename sections called <code class="docutils literal notranslate"><span class="pre"><old></span></code> to <code class="docutils literal notranslate"><span class="pre"><new></span></code> in the output, and apply any
specified <code class="docutils literal notranslate"><span class="pre"><flag></span></code> values. See <a class="reference internal" href="#cmdoption-llvm-objcopy-set-section-flags"><code class="xref std std-option docutils literal notranslate"><span class="pre">--set-section-flags</span></code></a> for a list of
supported flags. Can be specified multiple times to rename multiple sections.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-set-start-addr">
<code class="sig-name descname"><span class="pre">--set-start-addr</span></code><code class="sig-prename descclassname"> <span class="pre"><addr></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-set-start-addr" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the start address of the output to <code class="docutils literal notranslate"><span class="pre"><addr></span></code>. Overrides any previously
specified <a class="reference internal" href="#cmdoption-llvm-objcopy-change-start"><code class="xref std std-option docutils literal notranslate"><span class="pre">--change-start</span></code></a> or <a class="reference internal" href="#cmdoption-llvm-objcopy-change-start"><code class="xref std std-option docutils literal notranslate"><span class="pre">--adjust-start</span></code></a> options.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-split-dwo">
<code class="sig-name descname"><span class="pre">--split-dwo</span></code><code class="sig-prename descclassname"> <span class="pre"><dwo-file></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-split-dwo" title="Permalink to this definition">¶</a></dt>
<dd><p>Equivalent to running <strong class="program">llvm-objcopy</strong> with <a class="reference internal" href="#cmdoption-llvm-objcopy-extract-dwo"><code class="xref std std-option docutils literal notranslate"><span class="pre">--extract-dwo</span></code></a> and
<code class="docutils literal notranslate"><span class="pre"><dwo-file></span></code> as the output file and no other options, and then with
<a class="reference internal" href="#cmdoption-llvm-objcopy-strip-dwo"><code class="xref std std-option docutils literal notranslate"><span class="pre">--strip-dwo</span></code></a> on the input file.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-strip-dwo">
<code class="sig-name descname"><span class="pre">--strip-dwo</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-strip-dwo" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all DWARF .dwo sections from the output.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-strip-non-alloc">
<code class="sig-name descname"><span class="pre">--strip-non-alloc</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-strip-non-alloc" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove from the output all non-allocatable sections that are not within
segments.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-strip-sections">
<code class="sig-name descname"><span class="pre">--strip-sections</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-strip-sections" title="Permalink to this definition">¶</a></dt>
<dd><p>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.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-target">
<span id="cmdoption-llvm-objcopy-F"></span><span id="cmdoption-llvm-objcopy-f"></span><code class="sig-name descname"><span class="pre">--target</span></code><code class="sig-prename descclassname"> <span class="pre"><format></span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-F</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-target" title="Permalink to this definition">¶</a></dt>
<dd><p>Equivalent to <a class="reference internal" href="#cmdoption-llvm-objcopy-input-target"><code class="xref std std-option docutils literal notranslate"><span class="pre">--input-target</span></code></a> and <a class="reference internal" href="#cmdoption-llvm-objcopy-output-target"><code class="xref std std-option docutils literal notranslate"><span class="pre">--output-target</span></code></a> for the
specified format. See <a class="reference internal" href="#supported-formats">SUPPORTED FORMATS</a> for a list of valid <code class="docutils literal notranslate"><span class="pre"><format></span></code>
values.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-weaken-symbol">
<span id="cmdoption-llvm-objcopy-W"></span><code class="sig-name descname"><span class="pre">--weaken-symbol</span></code><code class="sig-prename descclassname"> <span class="pre"><symbol></span></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-W</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-weaken-symbol" title="Permalink to this definition">¶</a></dt>
<dd><p>Mark any global symbol named <code class="docutils literal notranslate"><span class="pre"><symbol></span></code> as a weak symbol in the output. Can
be specified multiple times to mark multiple symbols as weak.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-weaken-symbols">
<code class="sig-name descname"><span class="pre">--weaken-symbols</span></code><code class="sig-prename descclassname"> <span class="pre"><filename></span></code><a class="headerlink" href="#cmdoption-llvm-objcopy-weaken-symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>Read a list of names from the file <code class="docutils literal notranslate"><span class="pre"><filename></span></code> 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.</p>
</dd></dl>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-weaken">
<code class="sig-name descname"><span class="pre">--weaken</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-weaken" title="Permalink to this definition">¶</a></dt>
<dd><p>Mark all defined global symbols as weak in the output.</p>
</dd></dl>
</div>
<div class="section" id="mach-o-specific-options">
<h2>MACH-O-SPECIFIC OPTIONS<a class="headerlink" href="#mach-o-specific-options" title="Permalink to this headline">¶</a></h2>
<dl class="std option">
<dt id="cmdoption-llvm-objcopy-keep-undefined">
<code class="sig-name descname"><span class="pre">--keep-undefined</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-objcopy-keep-undefined" title="Permalink to this definition">¶</a></dt>
<dd><p>Keep undefined symbols, even if they would otherwise be stripped.</p>
</dd></dl>
</div>
<div class="section" id="supported-formats">
<h2>SUPPORTED FORMATS<a class="headerlink" href="#supported-formats" title="Permalink to this headline">¶</a></h2>
<p>The following values are currently supported by <strong class="program">llvm-objcopy</strong> for the
<a class="reference internal" href="#cmdoption-llvm-objcopy-input-target"><code class="xref std std-option docutils literal notranslate"><span class="pre">--input-target</span></code></a>, <a class="reference internal" href="#cmdoption-llvm-objcopy-output-target"><code class="xref std std-option docutils literal notranslate"><span class="pre">--output-target</span></code></a>, and <a class="reference internal" href="#cmdoption-llvm-objcopy-target"><code class="xref std std-option docutils literal notranslate"><span class="pre">--target</span></code></a>
options. For GNU <strong class="program">objcopy</strong> compatibility, the values are all bfdnames.</p>
<ul class="simple">
<li><p><cite>binary</cite></p></li>
<li><p><cite>ihex</cite></p></li>
<li><p><cite>elf32-i386</cite></p></li>
<li><p><cite>elf32-x86-64</cite></p></li>
<li><p><cite>elf64-x86-64</cite></p></li>
<li><p><cite>elf32-iamcu</cite></p></li>
<li><p><cite>elf32-littlearm</cite></p></li>
<li><p><cite>elf64-aarch64</cite></p></li>
<li><p><cite>elf64-littleaarch64</cite></p></li>
<li><p><cite>elf32-littleriscv</cite></p></li>
<li><p><cite>elf64-littleriscv</cite></p></li>
<li><p><cite>elf32-powerpc</cite></p></li>
<li><p><cite>elf32-powerpcle</cite></p></li>
<li><p><cite>elf64-powerpc</cite></p></li>
<li><p><cite>elf64-powerpcle</cite></p></li>
<li><p><cite>elf32-bigmips</cite></p></li>
<li><p><cite>elf32-ntradbigmips</cite></p></li>
<li><p><cite>elf32-ntradlittlemips</cite></p></li>
<li><p><cite>elf32-tradbigmips</cite></p></li>
<li><p><cite>elf32-tradlittlemips</cite></p></li>
<li><p><cite>elf64-tradbigmips</cite></p></li>
<li><p><cite>elf64-tradlittlemips</cite></p></li>
<li><p><cite>elf32-sparc</cite></p></li>
<li><p><cite>elf32-sparcel</cite></p></li>
</ul>
<p>Additionally, all targets except <cite>binary</cite> and <cite>ihex</cite> can have <cite>-freebsd</cite> as a
suffix.</p>
</div>
<div class="section" id="binary-input-and-output">
<h2>BINARY INPUT AND OUTPUT<a class="headerlink" href="#binary-input-and-output" title="Permalink to this headline">¶</a></h2>
<p>If <cite>binary</cite> is used as the value for <a class="reference internal" href="#cmdoption-llvm-objcopy-input-target"><code class="xref std std-option docutils literal notranslate"><span class="pre">--input-target</span></code></a>, the input file
will be embedded as a data section in an ELF relocatable object, with symbols
<code class="docutils literal notranslate"><span class="pre">_binary_<file_name>_start</span></code>, <code class="docutils literal notranslate"><span class="pre">_binary_<file_name>_end</span></code>, and
<code class="docutils literal notranslate"><span class="pre">_binary_<file_name>_size</span></code> representing the start, end and size of the data,
where <code class="docutils literal notranslate"><span class="pre"><file_name></span></code> is the path of the input file as specified on the command
line with non-alphanumeric characters converted to <code class="docutils literal notranslate"><span class="pre">_</span></code>.</p>
<p>If <cite>binary</cite> is used as the value for <a class="reference internal" href="#cmdoption-llvm-objcopy-output-target"><code class="xref std std-option docutils literal notranslate"><span class="pre">--output-target</span></code></a>, 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.</p>
</div>
<div class="section" id="exit-status">
<h2>EXIT STATUS<a class="headerlink" href="#exit-status" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">llvm-objcopy</strong> exits with a non-zero exit code if there is an error.
Otherwise, it exits with code 0.</p>
</div>
<div class="section" id="bugs">
<h2>BUGS<a class="headerlink" href="#bugs" title="Permalink to this headline">¶</a></h2>
<p>To report bugs, please visit <<a class="reference external" href="https://bugs.llvm.org/">https://bugs.llvm.org/</a>>.</p>
<p>There is a known issue with <a class="reference internal" href="#cmdoption-llvm-objcopy-input-target"><code class="xref std std-option docutils literal notranslate"><span class="pre">--input-target</span></code></a> and <a class="reference internal" href="#cmdoption-llvm-objcopy-target"><code class="xref std std-option docutils literal notranslate"><span class="pre">--target</span></code></a>
causing only <code class="docutils literal notranslate"><span class="pre">binary</span></code> and <code class="docutils literal notranslate"><span class="pre">ihex</span></code> formats to have any effect. Other values
will be ignored and <strong class="program">llvm-objcopy</strong> will attempt to guess the input
format.</p>
</div>
<div class="section" id="see-also">
<h2>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline">¶</a></h2>
<p><em class="manpage"><a class="manpage reference external" href="https://llvm.org/docs/CommandGuide/llvm-strip.html">llvm-strip(1)</a></em></p>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="llvm-objdump.html" title="llvm-objdump - LLVM’s object file dumper"
>next</a> |</li>
<li class="right" >
<a href="llvm-nm.html" title="llvm-nm - list LLVM bitcode and object file’s symbol table"
>previous</a> |</li>
<li><a href="https://llvm.org/">LLVM Home</a> | </li>
<li><a href="../index.html">Documentation</a>»</li>
<li class="nav-item nav-item-1"><a href="../Reference.html" >Reference</a> »</li>
<li class="nav-item nav-item-2"><a href="index.html" >LLVM Command Guide</a> »</li>
<li class="nav-item nav-item-this"><a href="">llvm-objcopy - object copying and editing tool</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2003-2021, LLVM Project.
Last updated on 2021-09-18.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.5.4.
</div>
</body>
</html>
|