diff options
| author | Sergey Dmitriev <serguei.n.dmitriev@intel.com> | 2020-01-24 06:36:09 -0800 |
|---|---|---|
| committer | Sergey Dmitriev <serguei.n.dmitriev@intel.com> | 2020-01-24 07:12:55 -0800 |
| commit | f69eba07726a9fe084812aa224309d62c4bdd2e4 (patch) | |
| tree | bf7922639e47595fe65230b9e66def128b969ba8 /llvm/docs/CommandGuide/llvm-objcopy.rst | |
| parent | 76fa5d50f3d18cc159afe3206e4d69721ae7db07 (diff) | |
[llvm-objcopy][COFF] Add support for --set-section-flags
Reviewers: jhenderson, MaskRay, alexshap, rupprecht, mstorsjo
Reviewed By: jhenderson
Subscribers: abrachet, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73107
Diffstat (limited to 'llvm/docs/CommandGuide/llvm-objcopy.rst')
| -rw-r--r-- | llvm/docs/CommandGuide/llvm-objcopy.rst | 61 |
1 files changed, 39 insertions, 22 deletions
diff --git a/llvm/docs/CommandGuide/llvm-objcopy.rst b/llvm/docs/CommandGuide/llvm-objcopy.rst index d5e9987df143..576921435fbd 100644 --- a/llvm/docs/CommandGuide/llvm-objcopy.rst +++ b/llvm/docs/CommandGuide/llvm-objcopy.rst @@ -130,6 +130,45 @@ multiple file formats. Set the alignment of section ``<section>`` to `<align>``. Can be specified multiple times to update multiple sections. +.. option:: --set-section-flags <section>=<flag>[,<flag>,...] + + Set section properties in the output of section ``<section>`` based on the + specified ``<flag>`` values. Can be specified multiple times to update multiple + sections. + + Supported flag names are `alloc`, `load`, `noload`, `readonly`, `exclude`, + `debug`, `code`, `data`, `rom`, `share`, `contents`, `merge` and `strings`. Not + all flags are meaningful for all object file formats. + + For ELF objects, the flags have the following effects: + + - `alloc` = add the `SHF_ALLOC` flag. + - `load` = if the section has `SHT_NOBITS` type, mark it as a `SHT_PROGBITS` + section. + - `readonly` = if this flag is not specified, add the `SHF_WRITE` flag. + - `exclude` = add the `SHF_EXCLUDE` flag. + - `code` = add the `SHF_EXECINSTR` flag. + - `merge` = add the `SHF_MERGE` flag. + - `strings` = add the `SHF_STRINGS` flag. + - `contents` = if the section has `SHT_NOBITS` type, mark it as a `SHT_PROGBITS` + section. + + For COFF objects, the flags have the following effects: + + - `alloc` = add the `IMAGE_SCN_CNT_UNINITIALIZED_DATA` and `IMAGE_SCN_MEM_READ` + flags, unless the `load` flag is specified. + - `noload` = add the `IMAGE_SCN_LNK_REMOVE` and `IMAGE_SCN_MEM_READ` flags. + - `readonly` = if this flag is not specified, add the `IMAGE_SCN_MEM_WRITE` + flag. + - `exclude` = add the `IMAGE_SCN_LNK_REMOVE` and `IMAGE_SCN_MEM_READ` flags. + - `debug` = add the `IMAGE_SCN_CNT_INITIALIZED_DATA`, + `IMAGE_SCN_MEM_DISCARDABLE` and `IMAGE_SCN_MEM_READ` flags. + - `code` = add the `IMAGE_SCN_CNT_CODE`, `IMAGE_SCN_MEM_EXECUTE` and + `IMAGE_SCN_MEM_READ` flags. + - `data` = add the `IMAGE_SCN_CNT_INITIALIZED_DATA` and `IMAGE_SCN_MEM_READ` + flags. + - `share` = add the `IMAGE_SCN_MEM_SHARED` and `IMAGE_SCN_MEM_READ` flags. + .. option:: --strip-all-gnu Remove all symbols, debug sections and relocations from the output. This option @@ -399,28 +438,6 @@ them. specified ``<flag>`` values. See :option:`--set-section-flags` for a list of supported flags. Can be specified multiple times to rename multiple sections. -.. option:: --set-section-flags <section>=<flag>[,<flag>,...] - - Set section properties in the output of section ``<section>`` based on the - specified ``<flag>`` values. Can be specified multiple times to update multiple - sections. - - Following is a list of supported flags and their effects: - - - `alloc` = add the `SHF_ALLOC` flag. - - `load` = if the section has `SHT_NOBITS` type, mark it as a `SHT_PROGBITS` - section. - - `readonly` = if this flag is not specified, add the `SHF_WRITE` flag. - - `exclude` = add the `SHF_EXCLUDE` flag. - - `code` = add the `SHF_EXECINSTR` flag. - - `merge` = add the `SHF_MERGE` flag. - - `strings` = add the `SHF_STRINGS` flag. - - `contents` = if the section has `SHT_NOBITS` type, mark it as a `SHT_PROGBITS` - section. - - The following flags are also accepted, but are ignored for GNU compatibility: - `noload`, `debug`, `data`, `rom`, `share`. - .. option:: --set-start-addr <addr> Set the start address of the output to ``<addr>``. Overrides any previously |
