]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/clang/llvm-objcopy/llvm-objcopy.1
contrib/tzdata: import tzdata 2021d
[FreeBSD/FreeBSD.git] / usr.bin / clang / llvm-objcopy / llvm-objcopy.1
1 .\" $FreeBSD$
2 .\" Man page generated from reStructuredText.
3 .
4 .
5 .nr rst2man-indent-level 0
6 .
7 .de1 rstReportMargin
8 \\$1 \\n[an-margin]
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
11 -
12 \\n[rst2man-indent0]
13 \\n[rst2man-indent1]
14 \\n[rst2man-indent2]
15 ..
16 .de1 INDENT
17 .\" .rstReportMargin pre:
18 . RS \\$1
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
22 ..
23 .de UNINDENT
24 . RE
25 .\" indent \\n[an-margin]
26 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27 .nr rst2man-indent-level -1
28 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
30 ..
31 .TH "LLVM-OBJCOPY" "1" "2021-06-07" "12" "LLVM"
32 .SH NAME
33 llvm-objcopy \- object copying and editing tool
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 \-\-set\-section\-flags <section>=<flag>[,<flag>,...]
173 Set section properties in the output of section \fB<section>\fP based on the
174 specified \fB<flag>\fP values. Can be specified multiple times to update multiple
175 sections.
176 .sp
177 Supported flag names are \fIalloc\fP, \fIload\fP, \fInoload\fP, \fIreadonly\fP, \fIexclude\fP,
178 \fIdebug\fP, \fIcode\fP, \fIdata\fP, \fIrom\fP, \fIshare\fP, \fIcontents\fP, \fImerge\fP and \fIstrings\fP\&. Not
179 all flags are meaningful for all object file formats.
180 .sp
181 For ELF objects, the flags have the following effects:
182 .INDENT 7.0
183 .IP \(bu 2
184 \fIalloc\fP = add the \fISHF_ALLOC\fP flag.
185 .IP \(bu 2
186 \fIload\fP = if the section has \fISHT_NOBITS\fP type, mark it as a \fISHT_PROGBITS\fP
187 section.
188 .IP \(bu 2
189 \fIreadonly\fP = if this flag is not specified, add the \fISHF_WRITE\fP flag.
190 .IP \(bu 2
191 \fIexclude\fP = add the \fISHF_EXCLUDE\fP flag.
192 .IP \(bu 2
193 \fIcode\fP = add the \fISHF_EXECINSTR\fP flag.
194 .IP \(bu 2
195 \fImerge\fP = add the \fISHF_MERGE\fP flag.
196 .IP \(bu 2
197 \fIstrings\fP = add the \fISHF_STRINGS\fP flag.
198 .IP \(bu 2
199 \fIcontents\fP = if the section has \fISHT_NOBITS\fP type, mark it as a \fISHT_PROGBITS\fP
200 section.
201 .UNINDENT
202 .sp
203 For COFF objects, the flags have the following effects:
204 .INDENT 7.0
205 .IP \(bu 2
206 \fIalloc\fP = add the \fIIMAGE_SCN_CNT_UNINITIALIZED_DATA\fP and \fIIMAGE_SCN_MEM_READ\fP
207 flags, unless the \fIload\fP flag is specified.
208 .IP \(bu 2
209 \fInoload\fP = add the \fIIMAGE_SCN_LNK_REMOVE\fP and \fIIMAGE_SCN_MEM_READ\fP flags.
210 .IP \(bu 2
211 \fIreadonly\fP = if this flag is not specified, add the \fIIMAGE_SCN_MEM_WRITE\fP
212 flag.
213 .IP \(bu 2
214 \fIexclude\fP = add the \fIIMAGE_SCN_LNK_REMOVE\fP and \fIIMAGE_SCN_MEM_READ\fP flags.
215 .IP \(bu 2
216 \fIdebug\fP = add the \fIIMAGE_SCN_CNT_INITIALIZED_DATA\fP,
217 \fIIMAGE_SCN_MEM_DISCARDABLE\fP and  \fIIMAGE_SCN_MEM_READ\fP flags.
218 .IP \(bu 2
219 \fIcode\fP = add the \fIIMAGE_SCN_CNT_CODE\fP, \fIIMAGE_SCN_MEM_EXECUTE\fP and
220 \fIIMAGE_SCN_MEM_READ\fP flags.
221 .IP \(bu 2
222 \fIdata\fP = add the \fIIMAGE_SCN_CNT_INITIALIZED_DATA\fP and \fIIMAGE_SCN_MEM_READ\fP
223 flags.
224 .IP \(bu 2
225 \fIshare\fP = add the \fIIMAGE_SCN_MEM_SHARED\fP and \fIIMAGE_SCN_MEM_READ\fP flags.
226 .UNINDENT
227 .UNINDENT
228 .INDENT 0.0
229 .TP
230 .B \-\-strip\-all\-gnu
231 Remove all symbols, debug sections and relocations from the output. This option
232 is equivalent to GNU \fBobjcopy\fP\(aqs \fB\-\-strip\-all\fP switch.
233 .UNINDENT
234 .INDENT 0.0
235 .TP
236 .B \-\-strip\-all, \-S
237 For ELF objects, remove from the output all symbols and non\-alloc sections not
238 within segments, except for .gnu.warning, .ARM.attribute sections and the
239 section name table.
240 .sp
241 For COFF and Mach\-O objects, remove all symbols, debug sections, and
242 relocations from the output.
243 .UNINDENT
244 .INDENT 0.0
245 .TP
246 .B \-\-strip\-debug, \-g
247 Remove all debug sections from the output.
248 .UNINDENT
249 .INDENT 0.0
250 .TP
251 .B \-\-strip\-symbol <symbol>, \-N
252 Remove all symbols named \fB<symbol>\fP from the output. Can be specified
253 multiple times to remove multiple symbols.
254 .UNINDENT
255 .INDENT 0.0
256 .TP
257 .B \-\-strip\-symbols <filename>
258 Remove all symbols whose names appear in the file \fB<filename>\fP, from the
259 output. In the file, each line represents a single symbol name, with leading
260 and trailing whitespace ignored, as is anything following a \(aq#\(aq. Can be
261 specified multiple times to read names from multiple files.
262 .UNINDENT
263 .INDENT 0.0
264 .TP
265 .B \-\-strip\-unneeded\-symbol <symbol>
266 Remove from the output all symbols named \fB<symbol>\fP that are local or
267 undefined and are not required by any relocation.
268 .UNINDENT
269 .INDENT 0.0
270 .TP
271 .B \-\-strip\-unneeded\-symbols <filename>
272 Remove all symbols whose names appear in the file \fB<filename>\fP, from the
273 output, if they are local or undefined and are not required by any relocation.
274 In the file, each line represents a single symbol name, with leading and
275 trailing whitespace ignored, as is anything following a \(aq#\(aq. Can be specified
276 multiple times to read names from multiple files.
277 .UNINDENT
278 .INDENT 0.0
279 .TP
280 .B \-\-strip\-unneeded
281 Remove from the output all local or undefined symbols that are not required by
282 relocations. Also remove all debug sections.
283 .UNINDENT
284 .INDENT 0.0
285 .TP
286 .B \-\-version, \-V
287 Display the version of the \fBllvm\-objcopy\fP executable.
288 .UNINDENT
289 .INDENT 0.0
290 .TP
291 .B \-\-wildcard, \-w
292 Allow wildcard syntax for symbol\-related flags. On by default for
293 section\-related flags. Incompatible with \-\-regex.
294 .sp
295 Wildcard syntax allows the following special symbols:
296 .TS
297 center;
298 |l|l|l|.
299 _
300 T{
301 Character
302 T}      T{
303 Meaning
304 T}      T{
305 Equivalent
306 T}
307 _
308 T{
309 \fB*\fP
310 T}      T{
311 Any number of characters
312 T}      T{
313 \fB\&.*\fP
314 T}
315 _
316 T{
317 \fB?\fP
318 T}      T{
319 Any single character
320 T}      T{
321 \fB\&.\fP
322 T}
323 _
324 T{
325 \fB\e\fP
326 T}      T{
327 Escape the next character
328 T}      T{
329 \fB\e\fP
330 T}
331 _
332 T{
333 \fB[a\-z]\fP
334 T}      T{
335 Character class
336 T}      T{
337 \fB[a\-z]\fP
338 T}
339 _
340 T{
341 \fB[!a\-z]\fP, \fB[^a\-z]\fP
342 T}      T{
343 Negated character class
344 T}      T{
345 \fB[^a\-z]\fP
346 T}
347 _
348 .TE
349 .sp
350 Additionally, starting a wildcard with \(aq!\(aq will prevent a match, even if
351 another flag matches. For example \fB\-w \-N \(aq*\(aq \-N \(aq!x\(aq\fP will strip all symbols
352 except for \fBx\fP\&.
353 .sp
354 The order of wildcards does not matter. For example, \fB\-w \-N \(aq*\(aq \-N \(aq!x\(aq\fP is
355 the same as \fB\-w \-N \(aq!x\(aq \-N \(aq*\(aq\fP\&.
356 .UNINDENT
357 .INDENT 0.0
358 .TP
359 .B @<FILE>
360 Read command\-line options and commands from response file \fI<FILE>\fP\&.
361 .UNINDENT
362 .SH ELF-SPECIFIC OPTIONS
363 .sp
364 The following options are implemented only for ELF objects. If used with other
365 objects, \fBllvm\-objcopy\fP will either emit an error or silently ignore
366 them.
367 .INDENT 0.0
368 .TP
369 .B \-\-add\-symbol <name>=[<section>:]<value>[,<flags>]
370 Add a new symbol called \fB<name>\fP to the output symbol table, in the section
371 named \fB<section>\fP, with value \fB<value>\fP\&. If \fB<section>\fP is not specified,
372 the symbol is added as an absolute symbol. The \fB<flags>\fP affect the symbol
373 properties. Accepted values are:
374 .INDENT 7.0
375 .IP \(bu 2
376 \fIglobal\fP = the symbol will have global binding.
377 .IP \(bu 2
378 \fIlocal\fP = the symbol will have local binding.
379 .IP \(bu 2
380 \fIweak\fP = the symbol will have weak binding.
381 .IP \(bu 2
382 \fIdefault\fP = the symbol will have default visibility.
383 .IP \(bu 2
384 \fIhidden\fP = the symbol will have hidden visibility.
385 .IP \(bu 2
386 \fIprotected\fP = the symbol will have protected visibility.
387 .IP \(bu 2
388 \fIfile\fP = the symbol will be an \fISTT_FILE\fP symbol.
389 .IP \(bu 2
390 \fIsection\fP = the symbol will be an \fISTT_SECTION\fP symbol.
391 .IP \(bu 2
392 \fIobject\fP = the symbol will be an \fISTT_OBJECT\fP symbol.
393 .IP \(bu 2
394 \fIfunction\fP = the symbol will be an \fISTT_FUNC\fP symbol.
395 .IP \(bu 2
396 \fIindirect\-function\fP = the symbol will be an \fISTT_GNU_IFUNC\fP symbol.
397 .UNINDENT
398 .sp
399 Additionally, the following flags are accepted but ignored: \fIdebug\fP,
400 \fIconstructor\fP, \fIwarning\fP, \fIindirect\fP, \fIsynthetic\fP, \fIunique\-object\fP, \fIbefore\fP\&.
401 .sp
402 Can be specified multiple times to add multiple symbols.
403 .UNINDENT
404 .INDENT 0.0
405 .TP
406 .B \-\-allow\-broken\-links
407 Allow \fBllvm\-objcopy\fP to remove sections even if it would leave invalid
408 section references. Any invalid sh_link fields will be set to zero.
409 .UNINDENT
410 .INDENT 0.0
411 .TP
412 .B \-\-build\-id\-link\-dir <dir>
413 Set the directory used by \fI\%\-\-build\-id\-link\-input\fP and
414 \fI\%\-\-build\-id\-link\-output\fP\&.
415 .UNINDENT
416 .INDENT 0.0
417 .TP
418 .B \-\-build\-id\-link\-input <suffix>
419 Hard\-link the input to \fB<dir>/xx/xxx<suffix>\fP, where \fB<dir>\fP is the directory
420 specified by \fI\%\-\-build\-id\-link\-dir\fP\&. The path used is derived from the
421 hex build ID.
422 .UNINDENT
423 .INDENT 0.0
424 .TP
425 .B \-\-build\-id\-link\-output <suffix>
426 Hard\-link the output to \fB<dir>/xx/xxx<suffix>\fP, where \fB<dir>\fP is the directory
427 specified by \fI\%\-\-build\-id\-link\-dir\fP\&. The path used is derived from the
428 hex build ID.
429 .UNINDENT
430 .INDENT 0.0
431 .TP
432 .B \-\-change\-start <incr>, \-\-adjust\-start
433 Add \fB<incr>\fP to the program\(aqs start address. Can be specified multiple
434 times, in which case the values will be applied cumulatively.
435 .UNINDENT
436 .INDENT 0.0
437 .TP
438 .B \-\-compress\-debug\-sections [<style>]
439 Compress DWARF debug sections in the output, using the specified style.
440 Supported styles are \fIzlib\-gnu\fP and \fIzlib\fP\&. Defaults to \fIzlib\fP if no style is
441 specified.
442 .UNINDENT
443 .INDENT 0.0
444 .TP
445 .B \-\-decompress\-debug\-sections
446 Decompress any compressed DWARF debug sections in the output.
447 .UNINDENT
448 .INDENT 0.0
449 .TP
450 .B \-\-discard\-locals, \-X
451 Remove local symbols starting with ".L" from the output.
452 .UNINDENT
453 .INDENT 0.0
454 .TP
455 .B \-\-extract\-dwo
456 Remove all sections that are not DWARF .dwo sections from the output.
457 .UNINDENT
458 .INDENT 0.0
459 .TP
460 .B \-\-extract\-main\-partition
461 Extract the main partition from the output.
462 .UNINDENT
463 .INDENT 0.0
464 .TP
465 .B \-\-extract\-partition <name>
466 Extract the named partition from the output.
467 .UNINDENT
468 .INDENT 0.0
469 .TP
470 .B \-\-globalize\-symbol <symbol>
471 Mark any defined symbols named \fB<symbol>\fP as global symbols in the output.
472 Can be specified multiple times to mark multiple symbols.
473 .UNINDENT
474 .INDENT 0.0
475 .TP
476 .B \-\-globalize\-symbols <filename>
477 Read a list of names from the file \fB<filename>\fP and mark defined symbols with
478 those names as global in the output. In the file, each line represents a single
479 symbol, with leading and trailing whitespace ignored, as is anything following
480 a \(aq#\(aq. Can be specified multiple times to read names from multiple files.
481 .UNINDENT
482 .INDENT 0.0
483 .TP
484 .B \-\-input\-target <format>, \-I
485 Read the input as the specified format. See \fI\%SUPPORTED FORMATS\fP for a list of
486 valid \fB<format>\fP values. If unspecified, \fBllvm\-objcopy\fP will attempt
487 to determine the format automatically.
488 .UNINDENT
489 .INDENT 0.0
490 .TP
491 .B \-\-keep\-file\-symbols
492 Keep symbols of type \fISTT_FILE\fP, even if they would otherwise be stripped.
493 .UNINDENT
494 .INDENT 0.0
495 .TP
496 .B \-\-keep\-global\-symbol <symbol>
497 Make all symbols local in the output, except for symbols with the name
498 \fB<symbol>\fP\&. Can be specified multiple times to ignore multiple symbols.
499 .UNINDENT
500 .INDENT 0.0
501 .TP
502 .B \-\-keep\-global\-symbols <filename>
503 Make all symbols local in the output, except for symbols named in the file
504 \fB<filename>\fP\&. In the file, each line represents a single symbol, with leading
505 and trailing whitespace ignored, as is anything following a \(aq#\(aq. Can be
506 specified multiple times to read names from multiple files.
507 .UNINDENT
508 .INDENT 0.0
509 .TP
510 .B \-\-keep\-section <section>
511 When removing sections from the output, do not remove sections named
512 \fB<section>\fP\&. Can be specified multiple times to keep multiple sections.
513 .UNINDENT
514 .INDENT 0.0
515 .TP
516 .B \-\-keep\-symbol <symbol>, \-K
517 When removing symbols from the output, do not remove symbols named
518 \fB<symbol>\fP\&. Can be specified multiple times to keep multiple symbols.
519 .UNINDENT
520 .INDENT 0.0
521 .TP
522 .B \-\-keep\-symbols <filename>
523 When removing symbols from the output do not remove symbols named in the file
524 \fB<filename>\fP\&. In the file, each line represents a single symbol, with leading
525 and trailing whitespace ignored, as is anything following a \(aq#\(aq. Can be
526 specified multiple times to read names from multiple files.
527 .UNINDENT
528 .INDENT 0.0
529 .TP
530 .B \-\-localize\-hidden
531 Make all symbols with hidden or internal visibility local in the output.
532 .UNINDENT
533 .INDENT 0.0
534 .TP
535 .B \-\-localize\-symbol <symbol>, \-L
536 Mark any defined non\-common symbol named \fB<symbol>\fP as a local symbol in the
537 output. Can be specified multiple times to mark multiple symbols as local.
538 .UNINDENT
539 .INDENT 0.0
540 .TP
541 .B \-\-localize\-symbols <filename>
542 Read a list of names from the file \fB<filename>\fP and mark defined non\-common
543 symbols with those names as local in the output. In the file, each line
544 represents a single symbol, with leading and trailing whitespace ignored, as is
545 anything following a \(aq#\(aq. Can be specified multiple times to read names from
546 multiple files.
547 .UNINDENT
548 .INDENT 0.0
549 .TP
550 .B \-\-new\-symbol\-visibility <visibility>
551 Specify the visibility of the symbols automatically created when using binary
552 input or \fI\%\-\-add\-symbol\fP\&. Valid options are:
553 .INDENT 7.0
554 .IP \(bu 2
555 \fIdefault\fP
556 .IP \(bu 2
557 \fIhidden\fP
558 .IP \(bu 2
559 \fIinternal\fP
560 .IP \(bu 2
561 \fIprotected\fP
562 .UNINDENT
563 .sp
564 The default is \fIdefault\fP\&.
565 .UNINDENT
566 .INDENT 0.0
567 .TP
568 .B \-\-output\-target <format>, \-O
569 Write the output as the specified format. See \fI\%SUPPORTED FORMATS\fP for a list
570 of valid \fB<format>\fP values. If unspecified, the output format is assumed to
571 be the same as the value specified for \fI\%\-\-input\-target\fP or the input
572 file\(aqs format if that option is also unspecified.
573 .UNINDENT
574 .INDENT 0.0
575 .TP
576 .B \-\-prefix\-alloc\-sections <prefix>
577 Add \fB<prefix>\fP to the front of the names of all allocatable sections in the
578 output.
579 .UNINDENT
580 .INDENT 0.0
581 .TP
582 .B \-\-prefix\-symbols <prefix>
583 Add \fB<prefix>\fP to the front of every symbol name in the output.
584 .UNINDENT
585 .INDENT 0.0
586 .TP
587 .B \-\-preserve\-dates, \-p
588 Preserve access and modification timestamps in the output.
589 .UNINDENT
590 .INDENT 0.0
591 .TP
592 .B \-\-rename\-section <old>=<new>[,<flag>,...]
593 Rename sections called \fB<old>\fP to \fB<new>\fP in the output, and apply any
594 specified \fB<flag>\fP values. See \fI\%\-\-set\-section\-flags\fP for a list of
595 supported flags. Can be specified multiple times to rename multiple sections.
596 .UNINDENT
597 .INDENT 0.0
598 .TP
599 .B \-\-set\-start\-addr <addr>
600 Set the start address of the output to \fB<addr>\fP\&. Overrides any previously
601 specified \fI\%\-\-change\-start\fP or \fI\%\-\-adjust\-start\fP options.
602 .UNINDENT
603 .INDENT 0.0
604 .TP
605 .B \-\-split\-dwo <dwo\-file>
606 Equivalent to running \fBllvm\-objcopy\fP with \fI\%\-\-extract\-dwo\fP and
607 \fB<dwo\-file>\fP as the output file and no other options, and then with
608 \fI\%\-\-strip\-dwo\fP on the input file.
609 .UNINDENT
610 .INDENT 0.0
611 .TP
612 .B \-\-strip\-dwo
613 Remove all DWARF .dwo sections from the output.
614 .UNINDENT
615 .INDENT 0.0
616 .TP
617 .B \-\-strip\-non\-alloc
618 Remove from the output all non\-allocatable sections that are not within
619 segments.
620 .UNINDENT
621 .INDENT 0.0
622 .TP
623 .B \-\-strip\-sections
624 Remove from the output all section headers and all section data not within
625 segments. Note that many tools will not be able to use an object without
626 section headers.
627 .UNINDENT
628 .INDENT 0.0
629 .TP
630 .B \-\-target <format>, \-F
631 Equivalent to \fI\%\-\-input\-target\fP and \fI\%\-\-output\-target\fP for the
632 specified format. See \fI\%SUPPORTED FORMATS\fP for a list of valid \fB<format>\fP
633 values.
634 .UNINDENT
635 .INDENT 0.0
636 .TP
637 .B \-\-weaken\-symbol <symbol>, \-W
638 Mark any global symbol named \fB<symbol>\fP as a weak symbol in the output. Can
639 be specified multiple times to mark multiple symbols as weak.
640 .UNINDENT
641 .INDENT 0.0
642 .TP
643 .B \-\-weaken\-symbols <filename>
644 Read a list of names from the file \fB<filename>\fP and mark global symbols with
645 those names as weak in the output. In the file, each line represents a single
646 symbol, with leading and trailing whitespace ignored, as is anything following
647 a \(aq#\(aq. Can be specified multiple times to read names from multiple files.
648 .UNINDENT
649 .INDENT 0.0
650 .TP
651 .B \-\-weaken
652 Mark all defined global symbols as weak in the output.
653 .UNINDENT
654 .SH SUPPORTED FORMATS
655 .sp
656 The following values are currently supported by \fBllvm\-objcopy\fP for the
657 \fI\%\-\-input\-target\fP, \fI\%\-\-output\-target\fP, and \fI\%\-\-target\fP
658 options. For GNU \fBobjcopy\fP compatibility, the values are all bfdnames.
659 .INDENT 0.0
660 .IP \(bu 2
661 \fIbinary\fP
662 .IP \(bu 2
663 \fIihex\fP
664 .IP \(bu 2
665 \fIelf32\-i386\fP
666 .IP \(bu 2
667 \fIelf32\-x86\-64\fP
668 .IP \(bu 2
669 \fIelf64\-x86\-64\fP
670 .IP \(bu 2
671 \fIelf32\-iamcu\fP
672 .IP \(bu 2
673 \fIelf32\-littlearm\fP
674 .IP \(bu 2
675 \fIelf64\-aarch64\fP
676 .IP \(bu 2
677 \fIelf64\-littleaarch64\fP
678 .IP \(bu 2
679 \fIelf32\-littleriscv\fP
680 .IP \(bu 2
681 \fIelf64\-littleriscv\fP
682 .IP \(bu 2
683 \fIelf32\-powerpc\fP
684 .IP \(bu 2
685 \fIelf32\-powerpcle\fP
686 .IP \(bu 2
687 \fIelf64\-powerpc\fP
688 .IP \(bu 2
689 \fIelf64\-powerpcle\fP
690 .IP \(bu 2
691 \fIelf32\-bigmips\fP
692 .IP \(bu 2
693 \fIelf32\-ntradbigmips\fP
694 .IP \(bu 2
695 \fIelf32\-ntradlittlemips\fP
696 .IP \(bu 2
697 \fIelf32\-tradbigmips\fP
698 .IP \(bu 2
699 \fIelf32\-tradlittlemips\fP
700 .IP \(bu 2
701 \fIelf64\-tradbigmips\fP
702 .IP \(bu 2
703 \fIelf64\-tradlittlemips\fP
704 .IP \(bu 2
705 \fIelf32\-sparc\fP
706 .IP \(bu 2
707 \fIelf32\-sparcel\fP
708 .UNINDENT
709 .sp
710 Additionally, all targets except \fIbinary\fP and \fIihex\fP can have \fI\-freebsd\fP as a
711 suffix.
712 .SH BINARY INPUT AND OUTPUT
713 .sp
714 If \fIbinary\fP is used as the value for \fI\%\-\-input\-target\fP, the input file
715 will be embedded as a data section in an ELF relocatable object, with symbols
716 \fB_binary_<file_name>_start\fP, \fB_binary_<file_name>_end\fP, and
717 \fB_binary_<file_name>_size\fP representing the start, end and size of the data,
718 where \fB<file_name>\fP is the path of the input file as specified on the command
719 line with non\-alphanumeric characters converted to \fB_\fP\&.
720 .sp
721 If \fIbinary\fP is used as the value for \fI\%\-\-output\-target\fP, the output file
722 will be a raw binary file, containing the memory image of the input file.
723 Symbols and relocation information will be discarded. The image will start at
724 the address of the first loadable section in the output.
725 .SH EXIT STATUS
726 .sp
727 \fBllvm\-objcopy\fP exits with a non\-zero exit code if there is an error.
728 Otherwise, it exits with code 0.
729 .SH BUGS
730 .sp
731 To report bugs, please visit <\fI\%https://bugs.llvm.org/\fP>.
732 .sp
733 There is a known issue with \fI\%\-\-input\-target\fP and \fI\%\-\-target\fP
734 causing only \fBbinary\fP and \fBihex\fP formats to have any effect. Other values
735 will be ignored and \fBllvm\-objcopy\fP will attempt to guess the input
736 format.
737 .SH SEE ALSO
738 .sp
739 \fBllvm\-strip(1)\fP
740 .SH AUTHOR
741 Maintained by the LLVM Team (https://llvm.org/).
742 .SH COPYRIGHT
743 2003-2021, LLVM Project
744 .\" Generated by docutils manpage writer.
745 .