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