Skip to content

Commit 8cf99a1

Browse files
committed
[docs][llvm-objcopy] Add description of binary input/output to doc
We briefly referred to being able to specify --target=binary without explaining what binary input/output meant. This change adds a section on this. Reviewed by: MaskRay, abrachet Differential Revision: https://reviews.llvm.org/D64245 llvm-svn: 365312
1 parent 674d8a9 commit 8cf99a1

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

llvm/docs/CommandGuide/llvm-objcopy.rst

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,23 @@ options. For GNU :program:`objcopy` compatibility, the values are all bfdnames.
457457
- `elf32-sparc`
458458
- `elf32-sparcel`
459459

460-
Additionally, all targets except ``binary`` and ``ihex`` can have ``-freebsd``
461-
as a suffix.
460+
Additionally, all targets except `binary` and `ihex` can have `-freebsd` as a
461+
suffix.
462+
463+
BINARY INPUT AND OUTPUT
464+
-----------------------
465+
466+
If `binary` is used as the value for :option:`--input-target`, the input file
467+
will be embedded as a data section in an ELF relocatable object, with symbols
468+
``_binary_<file_name>_start``, ``_binary_<file_name>_end``, and
469+
``_binary_<file_name>_size`` representing the start, end and size of the data,
470+
where ``<file_name>`` is the path of the input file as specified on the command
471+
line with non-alphanumeric characters converted to ``_``.
472+
473+
If `binary` is used as the value for :option:`--output-target`, the output file
474+
will be a raw binary file, containing the memory image of the input file.
475+
Symbols and relocation information will be discarded. The image will start at
476+
the address of the first loadable section in the output.
462477

463478
EXIT STATUS
464479
-----------

0 commit comments

Comments
 (0)