| 1 |
205 |
julius |
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
|
| 2 |
|
|
.\"
|
| 3 |
|
|
.\" Standard preamble:
|
| 4 |
|
|
.\" ========================================================================
|
| 5 |
|
|
.de Sh \" Subsection heading
|
| 6 |
|
|
.br
|
| 7 |
|
|
.if t .Sp
|
| 8 |
|
|
.ne 5
|
| 9 |
|
|
.PP
|
| 10 |
|
|
\fB\\$1\fR
|
| 11 |
|
|
.PP
|
| 12 |
|
|
..
|
| 13 |
|
|
.de Sp \" Vertical space (when we can't use .PP)
|
| 14 |
|
|
.if t .sp .5v
|
| 15 |
|
|
.if n .sp
|
| 16 |
|
|
..
|
| 17 |
|
|
.de Vb \" Begin verbatim text
|
| 18 |
|
|
.ft CW
|
| 19 |
|
|
.nf
|
| 20 |
|
|
.ne \\$1
|
| 21 |
|
|
..
|
| 22 |
|
|
.de Ve \" End verbatim text
|
| 23 |
|
|
.ft R
|
| 24 |
|
|
.fi
|
| 25 |
|
|
..
|
| 26 |
|
|
.\" Set up some character translations and predefined strings. \*(-- will
|
| 27 |
|
|
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
| 28 |
|
|
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
|
| 29 |
|
|
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
|
| 30 |
|
|
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
|
| 31 |
|
|
.\" nothing in troff, for use with C<>.
|
| 32 |
|
|
.tr \(*W-
|
| 33 |
|
|
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
| 34 |
|
|
.ie n \{\
|
| 35 |
|
|
. ds -- \(*W-
|
| 36 |
|
|
. ds PI pi
|
| 37 |
|
|
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
| 38 |
|
|
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
| 39 |
|
|
. ds L" ""
|
| 40 |
|
|
. ds R" ""
|
| 41 |
|
|
. ds C` ""
|
| 42 |
|
|
. ds C' ""
|
| 43 |
|
|
'br\}
|
| 44 |
|
|
.el\{\
|
| 45 |
|
|
. ds -- \|\(em\|
|
| 46 |
|
|
. ds PI \(*p
|
| 47 |
|
|
. ds L" ``
|
| 48 |
|
|
. ds R" ''
|
| 49 |
|
|
'br\}
|
| 50 |
|
|
.\"
|
| 51 |
|
|
.\" Escape single quotes in literal strings from groff's Unicode transform.
|
| 52 |
|
|
.ie \n(.g .ds Aq \(aq
|
| 53 |
|
|
.el .ds Aq '
|
| 54 |
|
|
.\"
|
| 55 |
|
|
.\" If the F register is turned on, we'll generate index entries on stderr for
|
| 56 |
|
|
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
| 57 |
|
|
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
| 58 |
|
|
.\" output yourself in some meaningful fashion.
|
| 59 |
|
|
.ie \nF \{\
|
| 60 |
|
|
. de IX
|
| 61 |
|
|
. tm Index:\\$1\t\\n%\t"\\$2"
|
| 62 |
|
|
..
|
| 63 |
|
|
. nr % 0
|
| 64 |
|
|
. rr F
|
| 65 |
|
|
.\}
|
| 66 |
|
|
.el \{\
|
| 67 |
|
|
. de IX
|
| 68 |
|
|
..
|
| 69 |
|
|
.\}
|
| 70 |
|
|
.\"
|
| 71 |
|
|
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
| 72 |
|
|
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
| 73 |
|
|
. \" fudge factors for nroff and troff
|
| 74 |
|
|
.if n \{\
|
| 75 |
|
|
. ds #H 0
|
| 76 |
|
|
. ds #V .8m
|
| 77 |
|
|
. ds #F .3m
|
| 78 |
|
|
. ds #[ \f1
|
| 79 |
|
|
. ds #] \fP
|
| 80 |
|
|
.\}
|
| 81 |
|
|
.if t \{\
|
| 82 |
|
|
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
| 83 |
|
|
. ds #V .6m
|
| 84 |
|
|
. ds #F 0
|
| 85 |
|
|
. ds #[ \&
|
| 86 |
|
|
. ds #] \&
|
| 87 |
|
|
.\}
|
| 88 |
|
|
. \" simple accents for nroff and troff
|
| 89 |
|
|
.if n \{\
|
| 90 |
|
|
. ds ' \&
|
| 91 |
|
|
. ds ` \&
|
| 92 |
|
|
. ds ^ \&
|
| 93 |
|
|
. ds , \&
|
| 94 |
|
|
. ds ~ ~
|
| 95 |
|
|
. ds /
|
| 96 |
|
|
.\}
|
| 97 |
|
|
.if t \{\
|
| 98 |
|
|
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
| 99 |
|
|
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
| 100 |
|
|
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
| 101 |
|
|
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
| 102 |
|
|
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
| 103 |
|
|
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
| 104 |
|
|
.\}
|
| 105 |
|
|
. \" troff and (daisy-wheel) nroff accents
|
| 106 |
|
|
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
| 107 |
|
|
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
| 108 |
|
|
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
| 109 |
|
|
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
| 110 |
|
|
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
| 111 |
|
|
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
| 112 |
|
|
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
| 113 |
|
|
.ds ae a\h'-(\w'a'u*4/10)'e
|
| 114 |
|
|
.ds Ae A\h'-(\w'A'u*4/10)'E
|
| 115 |
|
|
. \" corrections for vroff
|
| 116 |
|
|
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
| 117 |
|
|
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
| 118 |
|
|
. \" for low resolution devices (crt and lpr)
|
| 119 |
|
|
.if \n(.H>23 .if \n(.V>19 \
|
| 120 |
|
|
\{\
|
| 121 |
|
|
. ds : e
|
| 122 |
|
|
. ds 8 ss
|
| 123 |
|
|
. ds o a
|
| 124 |
|
|
. ds d- d\h'-1'\(ga
|
| 125 |
|
|
. ds D- D\h'-1'\(hy
|
| 126 |
|
|
. ds th \o'bp'
|
| 127 |
|
|
. ds Th \o'LP'
|
| 128 |
|
|
. ds ae ae
|
| 129 |
|
|
. ds Ae AE
|
| 130 |
|
|
.\}
|
| 131 |
|
|
.rm #[ #] #H #V #F C
|
| 132 |
|
|
.\" ========================================================================
|
| 133 |
|
|
.\"
|
| 134 |
|
|
.IX Title "OBJCOPY 1"
|
| 135 |
|
|
.TH OBJCOPY 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
|
| 136 |
|
|
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
| 137 |
|
|
.\" way too many mistakes in technical documents.
|
| 138 |
|
|
.if n .ad l
|
| 139 |
|
|
.nh
|
| 140 |
|
|
.SH "NAME"
|
| 141 |
|
|
objcopy \- copy and translate object files
|
| 142 |
|
|
.SH "SYNOPSIS"
|
| 143 |
|
|
.IX Header "SYNOPSIS"
|
| 144 |
|
|
objcopy [\fB\-F\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR]
|
| 145 |
|
|
[\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR]
|
| 146 |
|
|
[\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR]
|
| 147 |
|
|
[\fB\-B\fR \fIbfdarch\fR|\fB\-\-binary\-architecture=\fR\fIbfdarch\fR]
|
| 148 |
|
|
[\fB\-S\fR|\fB\-\-strip\-all\fR]
|
| 149 |
|
|
[\fB\-g\fR|\fB\-\-strip\-debug\fR]
|
| 150 |
|
|
[\fB\-K\fR \fIsymbolname\fR|\fB\-\-keep\-symbol=\fR\fIsymbolname\fR]
|
| 151 |
|
|
[\fB\-N\fR \fIsymbolname\fR|\fB\-\-strip\-symbol=\fR\fIsymbolname\fR]
|
| 152 |
|
|
[\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR]
|
| 153 |
|
|
[\fB\-G\fR \fIsymbolname\fR|\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR]
|
| 154 |
|
|
[\fB\-\-localize\-hidden\fR]
|
| 155 |
|
|
[\fB\-L\fR \fIsymbolname\fR|\fB\-\-localize\-symbol=\fR\fIsymbolname\fR]
|
| 156 |
|
|
[\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR]
|
| 157 |
|
|
[\fB\-W\fR \fIsymbolname\fR|\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR]
|
| 158 |
|
|
[\fB\-w\fR|\fB\-\-wildcard\fR]
|
| 159 |
|
|
[\fB\-x\fR|\fB\-\-discard\-all\fR]
|
| 160 |
|
|
[\fB\-X\fR|\fB\-\-discard\-locals\fR]
|
| 161 |
|
|
[\fB\-b\fR \fIbyte\fR|\fB\-\-byte=\fR\fIbyte\fR]
|
| 162 |
|
|
[\fB\-i\fR \fIinterleave\fR|\fB\-\-interleave=\fR\fIinterleave\fR]
|
| 163 |
|
|
[\fB\-j\fR \fIsectionname\fR|\fB\-\-only\-section=\fR\fIsectionname\fR]
|
| 164 |
|
|
[\fB\-R\fR \fIsectionname\fR|\fB\-\-remove\-section=\fR\fIsectionname\fR]
|
| 165 |
|
|
[\fB\-p\fR|\fB\-\-preserve\-dates\fR]
|
| 166 |
|
|
[\fB\-\-debugging\fR]
|
| 167 |
|
|
[\fB\-\-gap\-fill=\fR\fIval\fR]
|
| 168 |
|
|
[\fB\-\-pad\-to=\fR\fIaddress\fR]
|
| 169 |
|
|
[\fB\-\-set\-start=\fR\fIval\fR]
|
| 170 |
|
|
[\fB\-\-adjust\-start=\fR\fIincr\fR]
|
| 171 |
|
|
[\fB\-\-change\-addresses=\fR\fIincr\fR]
|
| 172 |
|
|
[\fB\-\-change\-section\-address\fR \fIsection\fR{=,+,\-}\fIval\fR]
|
| 173 |
|
|
[\fB\-\-change\-section\-lma\fR \fIsection\fR{=,+,\-}\fIval\fR]
|
| 174 |
|
|
[\fB\-\-change\-section\-vma\fR \fIsection\fR{=,+,\-}\fIval\fR]
|
| 175 |
|
|
[\fB\-\-change\-warnings\fR] [\fB\-\-no\-change\-warnings\fR]
|
| 176 |
|
|
[\fB\-\-set\-section\-flags\fR \fIsection\fR=\fIflags\fR]
|
| 177 |
|
|
[\fB\-\-add\-section\fR \fIsectionname\fR=\fIfilename\fR]
|
| 178 |
|
|
[\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR[,\fIflags\fR]]
|
| 179 |
|
|
[\fB\-\-long\-section\-names\fR {enable,disable,keep}]
|
| 180 |
|
|
[\fB\-\-change\-leading\-char\fR] [\fB\-\-remove\-leading\-char\fR]
|
| 181 |
|
|
[\fB\-\-reverse\-bytes=\fR\fInum\fR]
|
| 182 |
|
|
[\fB\-\-srec\-len=\fR\fIival\fR] [\fB\-\-srec\-forceS3\fR]
|
| 183 |
|
|
[\fB\-\-redefine\-sym\fR \fIold\fR=\fInew\fR]
|
| 184 |
|
|
[\fB\-\-redefine\-syms=\fR\fIfilename\fR]
|
| 185 |
|
|
[\fB\-\-weaken\fR]
|
| 186 |
|
|
[\fB\-\-keep\-symbols=\fR\fIfilename\fR]
|
| 187 |
|
|
[\fB\-\-strip\-symbols=\fR\fIfilename\fR]
|
| 188 |
|
|
[\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR]
|
| 189 |
|
|
[\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR]
|
| 190 |
|
|
[\fB\-\-localize\-symbols=\fR\fIfilename\fR]
|
| 191 |
|
|
[\fB\-\-globalize\-symbols=\fR\fIfilename\fR]
|
| 192 |
|
|
[\fB\-\-weaken\-symbols=\fR\fIfilename\fR]
|
| 193 |
|
|
[\fB\-\-alt\-machine\-code=\fR\fIindex\fR]
|
| 194 |
|
|
[\fB\-\-prefix\-symbols=\fR\fIstring\fR]
|
| 195 |
|
|
[\fB\-\-prefix\-sections=\fR\fIstring\fR]
|
| 196 |
|
|
[\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR]
|
| 197 |
|
|
[\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR]
|
| 198 |
|
|
[\fB\-\-keep\-file\-symbols\fR]
|
| 199 |
|
|
[\fB\-\-only\-keep\-debug\fR]
|
| 200 |
|
|
[\fB\-\-extract\-symbol\fR]
|
| 201 |
|
|
[\fB\-\-writable\-text\fR]
|
| 202 |
|
|
[\fB\-\-readonly\-text\fR]
|
| 203 |
|
|
[\fB\-\-pure\fR]
|
| 204 |
|
|
[\fB\-\-impure\fR]
|
| 205 |
|
|
[\fB\-\-file\-alignment=\fR\fInum\fR]
|
| 206 |
|
|
[\fB\-\-heap=\fR\fIsize\fR]
|
| 207 |
|
|
[\fB\-\-image\-base=\fR\fIaddress\fR]
|
| 208 |
|
|
[\fB\-\-section\-alignment=\fR\fInum\fR]
|
| 209 |
|
|
[\fB\-\-stack=\fR\fIsize\fR]
|
| 210 |
|
|
[\fB\-\-subsystem=\fR\fIwhich\fR:\fImajor\fR.\fIminor\fR]
|
| 211 |
|
|
[\fB\-v\fR|\fB\-\-verbose\fR]
|
| 212 |
|
|
[\fB\-V\fR|\fB\-\-version\fR]
|
| 213 |
|
|
[\fB\-\-help\fR] [\fB\-\-info\fR]
|
| 214 |
|
|
\fIinfile\fR [\fIoutfile\fR]
|
| 215 |
|
|
.SH "DESCRIPTION"
|
| 216 |
|
|
.IX Header "DESCRIPTION"
|
| 217 |
|
|
The \s-1GNU\s0 \fBobjcopy\fR utility copies the contents of an object
|
| 218 |
|
|
file to another. \fBobjcopy\fR uses the \s-1GNU\s0 \s-1BFD\s0 Library to
|
| 219 |
|
|
read and write the object files. It can write the destination object
|
| 220 |
|
|
file in a format different from that of the source object file. The
|
| 221 |
|
|
exact behavior of \fBobjcopy\fR is controlled by command-line options.
|
| 222 |
|
|
Note that \fBobjcopy\fR should be able to copy a fully linked file
|
| 223 |
|
|
between any two formats. However, copying a relocatable object file
|
| 224 |
|
|
between any two formats may not work as expected.
|
| 225 |
|
|
.PP
|
| 226 |
|
|
\&\fBobjcopy\fR creates temporary files to do its translations and
|
| 227 |
|
|
deletes them afterward. \fBobjcopy\fR uses \s-1BFD\s0 to do all its
|
| 228 |
|
|
translation work; it has access to all the formats described in \s-1BFD\s0
|
| 229 |
|
|
and thus is able to recognize most formats without being told
|
| 230 |
|
|
explicitly.
|
| 231 |
|
|
.PP
|
| 232 |
|
|
\&\fBobjcopy\fR can be used to generate S\-records by using an output
|
| 233 |
|
|
target of \fBsrec\fR (e.g., use \fB\-O srec\fR).
|
| 234 |
|
|
.PP
|
| 235 |
|
|
\&\fBobjcopy\fR can be used to generate a raw binary file by using an
|
| 236 |
|
|
output target of \fBbinary\fR (e.g., use \fB\-O binary\fR). When
|
| 237 |
|
|
\&\fBobjcopy\fR generates a raw binary file, it will essentially produce
|
| 238 |
|
|
a memory dump of the contents of the input object file. All symbols and
|
| 239 |
|
|
relocation information will be discarded. The memory dump will start at
|
| 240 |
|
|
the load address of the lowest section copied into the output file.
|
| 241 |
|
|
.PP
|
| 242 |
|
|
When generating an S\-record or a raw binary file, it may be helpful to
|
| 243 |
|
|
use \fB\-S\fR to remove sections containing debugging information. In
|
| 244 |
|
|
some cases \fB\-R\fR will be useful to remove sections which contain
|
| 245 |
|
|
information that is not needed by the binary file.
|
| 246 |
|
|
.PP
|
| 247 |
|
|
Note\-\-\-\fBobjcopy\fR is not able to change the endianness of its input
|
| 248 |
|
|
files. If the input format has an endianness (some formats do not),
|
| 249 |
|
|
\&\fBobjcopy\fR can only copy the inputs into file formats that have the
|
| 250 |
|
|
same endianness or which have no endianness (e.g., \fBsrec\fR).
|
| 251 |
|
|
(However, see the \fB\-\-reverse\-bytes\fR option.)
|
| 252 |
|
|
.SH "OPTIONS"
|
| 253 |
|
|
.IX Header "OPTIONS"
|
| 254 |
|
|
.IP "\fIinfile\fR" 4
|
| 255 |
|
|
.IX Item "infile"
|
| 256 |
|
|
.PD 0
|
| 257 |
|
|
.IP "\fIoutfile\fR" 4
|
| 258 |
|
|
.IX Item "outfile"
|
| 259 |
|
|
.PD
|
| 260 |
|
|
The input and output files, respectively.
|
| 261 |
|
|
If you do not specify \fIoutfile\fR, \fBobjcopy\fR creates a
|
| 262 |
|
|
temporary file and destructively renames the result with
|
| 263 |
|
|
the name of \fIinfile\fR.
|
| 264 |
|
|
.IP "\fB\-I\fR \fIbfdname\fR" 4
|
| 265 |
|
|
.IX Item "-I bfdname"
|
| 266 |
|
|
.PD 0
|
| 267 |
|
|
.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4
|
| 268 |
|
|
.IX Item "--input-target=bfdname"
|
| 269 |
|
|
.PD
|
| 270 |
|
|
Consider the source file's object format to be \fIbfdname\fR, rather than
|
| 271 |
|
|
attempting to deduce it.
|
| 272 |
|
|
.IP "\fB\-O\fR \fIbfdname\fR" 4
|
| 273 |
|
|
.IX Item "-O bfdname"
|
| 274 |
|
|
.PD 0
|
| 275 |
|
|
.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4
|
| 276 |
|
|
.IX Item "--output-target=bfdname"
|
| 277 |
|
|
.PD
|
| 278 |
|
|
Write the output file using the object format \fIbfdname\fR.
|
| 279 |
|
|
.IP "\fB\-F\fR \fIbfdname\fR" 4
|
| 280 |
|
|
.IX Item "-F bfdname"
|
| 281 |
|
|
.PD 0
|
| 282 |
|
|
.IP "\fB\-\-target=\fR\fIbfdname\fR" 4
|
| 283 |
|
|
.IX Item "--target=bfdname"
|
| 284 |
|
|
.PD
|
| 285 |
|
|
Use \fIbfdname\fR as the object format for both the input and the output
|
| 286 |
|
|
file; i.e., simply transfer data from source to destination with no
|
| 287 |
|
|
translation.
|
| 288 |
|
|
.IP "\fB\-B\fR \fIbfdarch\fR" 4
|
| 289 |
|
|
.IX Item "-B bfdarch"
|
| 290 |
|
|
.PD 0
|
| 291 |
|
|
.IP "\fB\-\-binary\-architecture=\fR\fIbfdarch\fR" 4
|
| 292 |
|
|
.IX Item "--binary-architecture=bfdarch"
|
| 293 |
|
|
.PD
|
| 294 |
|
|
Useful when transforming a raw binary input file into an object file.
|
| 295 |
|
|
In this case the output architecture can be set to \fIbfdarch\fR. This
|
| 296 |
|
|
option will be ignored if the input file has a known \fIbfdarch\fR. You
|
| 297 |
|
|
can access this binary data inside a program by referencing the special
|
| 298 |
|
|
symbols that are created by the conversion process. These symbols are
|
| 299 |
|
|
called _binary_\fIobjfile\fR_start, _binary_\fIobjfile\fR_end and
|
| 300 |
|
|
_binary_\fIobjfile\fR_size. e.g. you can transform a picture file into
|
| 301 |
|
|
an object file and then access it in your code using these symbols.
|
| 302 |
|
|
.IP "\fB\-j\fR \fIsectionname\fR" 4
|
| 303 |
|
|
.IX Item "-j sectionname"
|
| 304 |
|
|
.PD 0
|
| 305 |
|
|
.IP "\fB\-\-only\-section=\fR\fIsectionname\fR" 4
|
| 306 |
|
|
.IX Item "--only-section=sectionname"
|
| 307 |
|
|
.PD
|
| 308 |
|
|
Copy only the named section from the input file to the output file.
|
| 309 |
|
|
This option may be given more than once. Note that using this option
|
| 310 |
|
|
inappropriately may make the output file unusable.
|
| 311 |
|
|
.IP "\fB\-R\fR \fIsectionname\fR" 4
|
| 312 |
|
|
.IX Item "-R sectionname"
|
| 313 |
|
|
.PD 0
|
| 314 |
|
|
.IP "\fB\-\-remove\-section=\fR\fIsectionname\fR" 4
|
| 315 |
|
|
.IX Item "--remove-section=sectionname"
|
| 316 |
|
|
.PD
|
| 317 |
|
|
Remove any section named \fIsectionname\fR from the output file. This
|
| 318 |
|
|
option may be given more than once. Note that using this option
|
| 319 |
|
|
inappropriately may make the output file unusable.
|
| 320 |
|
|
.IP "\fB\-S\fR" 4
|
| 321 |
|
|
.IX Item "-S"
|
| 322 |
|
|
.PD 0
|
| 323 |
|
|
.IP "\fB\-\-strip\-all\fR" 4
|
| 324 |
|
|
.IX Item "--strip-all"
|
| 325 |
|
|
.PD
|
| 326 |
|
|
Do not copy relocation and symbol information from the source file.
|
| 327 |
|
|
.IP "\fB\-g\fR" 4
|
| 328 |
|
|
.IX Item "-g"
|
| 329 |
|
|
.PD 0
|
| 330 |
|
|
.IP "\fB\-\-strip\-debug\fR" 4
|
| 331 |
|
|
.IX Item "--strip-debug"
|
| 332 |
|
|
.PD
|
| 333 |
|
|
Do not copy debugging symbols or sections from the source file.
|
| 334 |
|
|
.IP "\fB\-\-strip\-unneeded\fR" 4
|
| 335 |
|
|
.IX Item "--strip-unneeded"
|
| 336 |
|
|
Strip all symbols that are not needed for relocation processing.
|
| 337 |
|
|
.IP "\fB\-K\fR \fIsymbolname\fR" 4
|
| 338 |
|
|
.IX Item "-K symbolname"
|
| 339 |
|
|
.PD 0
|
| 340 |
|
|
.IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4
|
| 341 |
|
|
.IX Item "--keep-symbol=symbolname"
|
| 342 |
|
|
.PD
|
| 343 |
|
|
When stripping symbols, keep symbol \fIsymbolname\fR even if it would
|
| 344 |
|
|
normally be stripped. This option may be given more than once.
|
| 345 |
|
|
.IP "\fB\-N\fR \fIsymbolname\fR" 4
|
| 346 |
|
|
.IX Item "-N symbolname"
|
| 347 |
|
|
.PD 0
|
| 348 |
|
|
.IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4
|
| 349 |
|
|
.IX Item "--strip-symbol=symbolname"
|
| 350 |
|
|
.PD
|
| 351 |
|
|
Do not copy symbol \fIsymbolname\fR from the source file. This option
|
| 352 |
|
|
may be given more than once.
|
| 353 |
|
|
.IP "\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR" 4
|
| 354 |
|
|
.IX Item "--strip-unneeded-symbol=symbolname"
|
| 355 |
|
|
Do not copy symbol \fIsymbolname\fR from the source file unless it is needed
|
| 356 |
|
|
by a relocation. This option may be given more than once.
|
| 357 |
|
|
.IP "\fB\-G\fR \fIsymbolname\fR" 4
|
| 358 |
|
|
.IX Item "-G symbolname"
|
| 359 |
|
|
.PD 0
|
| 360 |
|
|
.IP "\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR" 4
|
| 361 |
|
|
.IX Item "--keep-global-symbol=symbolname"
|
| 362 |
|
|
.PD
|
| 363 |
|
|
Keep only symbol \fIsymbolname\fR global. Make all other symbols local
|
| 364 |
|
|
to the file, so that they are not visible externally. This option may
|
| 365 |
|
|
be given more than once.
|
| 366 |
|
|
.IP "\fB\-\-localize\-hidden\fR" 4
|
| 367 |
|
|
.IX Item "--localize-hidden"
|
| 368 |
|
|
In an \s-1ELF\s0 object, mark all symbols that have hidden or internal visibility
|
| 369 |
|
|
as local. This option applies on top of symbol-specific localization options
|
| 370 |
|
|
such as \fB\-L\fR.
|
| 371 |
|
|
.IP "\fB\-L\fR \fIsymbolname\fR" 4
|
| 372 |
|
|
.IX Item "-L symbolname"
|
| 373 |
|
|
.PD 0
|
| 374 |
|
|
.IP "\fB\-\-localize\-symbol=\fR\fIsymbolname\fR" 4
|
| 375 |
|
|
.IX Item "--localize-symbol=symbolname"
|
| 376 |
|
|
.PD
|
| 377 |
|
|
Make symbol \fIsymbolname\fR local to the file, so that it is not
|
| 378 |
|
|
visible externally. This option may be given more than once.
|
| 379 |
|
|
.IP "\fB\-W\fR \fIsymbolname\fR" 4
|
| 380 |
|
|
.IX Item "-W symbolname"
|
| 381 |
|
|
.PD 0
|
| 382 |
|
|
.IP "\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR" 4
|
| 383 |
|
|
.IX Item "--weaken-symbol=symbolname"
|
| 384 |
|
|
.PD
|
| 385 |
|
|
Make symbol \fIsymbolname\fR weak. This option may be given more than once.
|
| 386 |
|
|
.IP "\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR" 4
|
| 387 |
|
|
.IX Item "--globalize-symbol=symbolname"
|
| 388 |
|
|
Give symbol \fIsymbolname\fR global scoping so that it is visible
|
| 389 |
|
|
outside of the file in which it is defined. This option may be given
|
| 390 |
|
|
more than once.
|
| 391 |
|
|
.IP "\fB\-w\fR" 4
|
| 392 |
|
|
.IX Item "-w"
|
| 393 |
|
|
.PD 0
|
| 394 |
|
|
.IP "\fB\-\-wildcard\fR" 4
|
| 395 |
|
|
.IX Item "--wildcard"
|
| 396 |
|
|
.PD
|
| 397 |
|
|
Permit regular expressions in \fIsymbolname\fRs used in other command
|
| 398 |
|
|
line options. The question mark (?), asterisk (*), backslash (\e) and
|
| 399 |
|
|
square brackets ([]) operators can be used anywhere in the symbol
|
| 400 |
|
|
name. If the first character of the symbol name is the exclamation
|
| 401 |
|
|
point (!) then the sense of the switch is reversed for that symbol.
|
| 402 |
|
|
For example:
|
| 403 |
|
|
.Sp
|
| 404 |
|
|
.Vb 1
|
| 405 |
|
|
\& \-w \-W !foo \-W fo*
|
| 406 |
|
|
.Ve
|
| 407 |
|
|
.Sp
|
| 408 |
|
|
would cause objcopy to weaken all symbols that start with \*(L"fo\*(R"
|
| 409 |
|
|
except for the symbol \*(L"foo\*(R".
|
| 410 |
|
|
.IP "\fB\-x\fR" 4
|
| 411 |
|
|
.IX Item "-x"
|
| 412 |
|
|
.PD 0
|
| 413 |
|
|
.IP "\fB\-\-discard\-all\fR" 4
|
| 414 |
|
|
.IX Item "--discard-all"
|
| 415 |
|
|
.PD
|
| 416 |
|
|
Do not copy non-global symbols from the source file.
|
| 417 |
|
|
.IP "\fB\-X\fR" 4
|
| 418 |
|
|
.IX Item "-X"
|
| 419 |
|
|
.PD 0
|
| 420 |
|
|
.IP "\fB\-\-discard\-locals\fR" 4
|
| 421 |
|
|
.IX Item "--discard-locals"
|
| 422 |
|
|
.PD
|
| 423 |
|
|
Do not copy compiler-generated local symbols.
|
| 424 |
|
|
(These usually start with \fBL\fR or \fB.\fR.)
|
| 425 |
|
|
.IP "\fB\-b\fR \fIbyte\fR" 4
|
| 426 |
|
|
.IX Item "-b byte"
|
| 427 |
|
|
.PD 0
|
| 428 |
|
|
.IP "\fB\-\-byte=\fR\fIbyte\fR" 4
|
| 429 |
|
|
.IX Item "--byte=byte"
|
| 430 |
|
|
.PD
|
| 431 |
|
|
Keep only every \fIbyte\fRth byte of the input file (header data is not
|
| 432 |
|
|
affected). \fIbyte\fR can be in the range from 0 to \fIinterleave\fR\-1,
|
| 433 |
|
|
where \fIinterleave\fR is given by the \fB\-i\fR or \fB\-\-interleave\fR
|
| 434 |
|
|
option, or the default of 4. This option is useful for creating files
|
| 435 |
|
|
to program \s-1ROM\s0. It is typically used with an \f(CW\*(C`srec\*(C'\fR output
|
| 436 |
|
|
target.
|
| 437 |
|
|
.IP "\fB\-i\fR \fIinterleave\fR" 4
|
| 438 |
|
|
.IX Item "-i interleave"
|
| 439 |
|
|
.PD 0
|
| 440 |
|
|
.IP "\fB\-\-interleave=\fR\fIinterleave\fR" 4
|
| 441 |
|
|
.IX Item "--interleave=interleave"
|
| 442 |
|
|
.PD
|
| 443 |
|
|
Only copy one out of every \fIinterleave\fR bytes. Select which byte to
|
| 444 |
|
|
copy with the \fB\-b\fR or \fB\-\-byte\fR option. The default is 4.
|
| 445 |
|
|
\&\fBobjcopy\fR ignores this option if you do not specify either \fB\-b\fR or
|
| 446 |
|
|
\&\fB\-\-byte\fR.
|
| 447 |
|
|
.IP "\fB\-p\fR" 4
|
| 448 |
|
|
.IX Item "-p"
|
| 449 |
|
|
.PD 0
|
| 450 |
|
|
.IP "\fB\-\-preserve\-dates\fR" 4
|
| 451 |
|
|
.IX Item "--preserve-dates"
|
| 452 |
|
|
.PD
|
| 453 |
|
|
Set the access and modification dates of the output file to be the same
|
| 454 |
|
|
as those of the input file.
|
| 455 |
|
|
.IP "\fB\-\-debugging\fR" 4
|
| 456 |
|
|
.IX Item "--debugging"
|
| 457 |
|
|
Convert debugging information, if possible. This is not the default
|
| 458 |
|
|
because only certain debugging formats are supported, and the
|
| 459 |
|
|
conversion process can be time consuming.
|
| 460 |
|
|
.IP "\fB\-\-gap\-fill\fR \fIval\fR" 4
|
| 461 |
|
|
.IX Item "--gap-fill val"
|
| 462 |
|
|
Fill gaps between sections with \fIval\fR. This operation applies to
|
| 463 |
|
|
the \fIload address\fR (\s-1LMA\s0) of the sections. It is done by increasing
|
| 464 |
|
|
the size of the section with the lower address, and filling in the extra
|
| 465 |
|
|
space created with \fIval\fR.
|
| 466 |
|
|
.IP "\fB\-\-pad\-to\fR \fIaddress\fR" 4
|
| 467 |
|
|
.IX Item "--pad-to address"
|
| 468 |
|
|
Pad the output file up to the load address \fIaddress\fR. This is
|
| 469 |
|
|
done by increasing the size of the last section. The extra space is
|
| 470 |
|
|
filled in with the value specified by \fB\-\-gap\-fill\fR (default zero).
|
| 471 |
|
|
.IP "\fB\-\-set\-start\fR \fIval\fR" 4
|
| 472 |
|
|
.IX Item "--set-start val"
|
| 473 |
|
|
Set the start address of the new file to \fIval\fR. Not all object file
|
| 474 |
|
|
formats support setting the start address.
|
| 475 |
|
|
.IP "\fB\-\-change\-start\fR \fIincr\fR" 4
|
| 476 |
|
|
.IX Item "--change-start incr"
|
| 477 |
|
|
.PD 0
|
| 478 |
|
|
.IP "\fB\-\-adjust\-start\fR \fIincr\fR" 4
|
| 479 |
|
|
.IX Item "--adjust-start incr"
|
| 480 |
|
|
.PD
|
| 481 |
|
|
Change the start address by adding \fIincr\fR. Not all object file
|
| 482 |
|
|
formats support setting the start address.
|
| 483 |
|
|
.IP "\fB\-\-change\-addresses\fR \fIincr\fR" 4
|
| 484 |
|
|
.IX Item "--change-addresses incr"
|
| 485 |
|
|
.PD 0
|
| 486 |
|
|
.IP "\fB\-\-adjust\-vma\fR \fIincr\fR" 4
|
| 487 |
|
|
.IX Item "--adjust-vma incr"
|
| 488 |
|
|
.PD
|
| 489 |
|
|
Change the \s-1VMA\s0 and \s-1LMA\s0 addresses of all sections, as well as the start
|
| 490 |
|
|
address, by adding \fIincr\fR. Some object file formats do not permit
|
| 491 |
|
|
section addresses to be changed arbitrarily. Note that this does not
|
| 492 |
|
|
relocate the sections; if the program expects sections to be loaded at a
|
| 493 |
|
|
certain address, and this option is used to change the sections such
|
| 494 |
|
|
that they are loaded at a different address, the program may fail.
|
| 495 |
|
|
.IP "\fB\-\-change\-section\-address\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4
|
| 496 |
|
|
.IX Item "--change-section-address section{=,+,-}val"
|
| 497 |
|
|
.PD 0
|
| 498 |
|
|
.IP "\fB\-\-adjust\-section\-vma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4
|
| 499 |
|
|
.IX Item "--adjust-section-vma section{=,+,-}val"
|
| 500 |
|
|
.PD
|
| 501 |
|
|
Set or change both the \s-1VMA\s0 address and the \s-1LMA\s0 address of the named
|
| 502 |
|
|
\&\fIsection\fR. If \fB=\fR is used, the section address is set to
|
| 503 |
|
|
\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the
|
| 504 |
|
|
section address. See the comments under \fB\-\-change\-addresses\fR,
|
| 505 |
|
|
above. If \fIsection\fR does not exist in the input file, a warning will
|
| 506 |
|
|
be issued, unless \fB\-\-no\-change\-warnings\fR is used.
|
| 507 |
|
|
.IP "\fB\-\-change\-section\-lma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4
|
| 508 |
|
|
.IX Item "--change-section-lma section{=,+,-}val"
|
| 509 |
|
|
Set or change the \s-1LMA\s0 address of the named \fIsection\fR. The \s-1LMA\s0
|
| 510 |
|
|
address is the address where the section will be loaded into memory at
|
| 511 |
|
|
program load time. Normally this is the same as the \s-1VMA\s0 address, which
|
| 512 |
|
|
is the address of the section at program run time, but on some systems,
|
| 513 |
|
|
especially those where a program is held in \s-1ROM\s0, the two can be
|
| 514 |
|
|
different. If \fB=\fR is used, the section address is set to
|
| 515 |
|
|
\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the
|
| 516 |
|
|
section address. See the comments under \fB\-\-change\-addresses\fR,
|
| 517 |
|
|
above. If \fIsection\fR does not exist in the input file, a warning
|
| 518 |
|
|
will be issued, unless \fB\-\-no\-change\-warnings\fR is used.
|
| 519 |
|
|
.IP "\fB\-\-change\-section\-vma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4
|
| 520 |
|
|
.IX Item "--change-section-vma section{=,+,-}val"
|
| 521 |
|
|
Set or change the \s-1VMA\s0 address of the named \fIsection\fR. The \s-1VMA\s0
|
| 522 |
|
|
address is the address where the section will be located once the
|
| 523 |
|
|
program has started executing. Normally this is the same as the \s-1LMA\s0
|
| 524 |
|
|
address, which is the address where the section will be loaded into
|
| 525 |
|
|
memory, but on some systems, especially those where a program is held in
|
| 526 |
|
|
\&\s-1ROM\s0, the two can be different. If \fB=\fR is used, the section address
|
| 527 |
|
|
is set to \fIval\fR. Otherwise, \fIval\fR is added to or subtracted
|
| 528 |
|
|
from the section address. See the comments under
|
| 529 |
|
|
\&\fB\-\-change\-addresses\fR, above. If \fIsection\fR does not exist in
|
| 530 |
|
|
the input file, a warning will be issued, unless
|
| 531 |
|
|
\&\fB\-\-no\-change\-warnings\fR is used.
|
| 532 |
|
|
.IP "\fB\-\-change\-warnings\fR" 4
|
| 533 |
|
|
.IX Item "--change-warnings"
|
| 534 |
|
|
.PD 0
|
| 535 |
|
|
.IP "\fB\-\-adjust\-warnings\fR" 4
|
| 536 |
|
|
.IX Item "--adjust-warnings"
|
| 537 |
|
|
.PD
|
| 538 |
|
|
If \fB\-\-change\-section\-address\fR or \fB\-\-change\-section\-lma\fR or
|
| 539 |
|
|
\&\fB\-\-change\-section\-vma\fR is used, and the named section does not
|
| 540 |
|
|
exist, issue a warning. This is the default.
|
| 541 |
|
|
.IP "\fB\-\-no\-change\-warnings\fR" 4
|
| 542 |
|
|
.IX Item "--no-change-warnings"
|
| 543 |
|
|
.PD 0
|
| 544 |
|
|
.IP "\fB\-\-no\-adjust\-warnings\fR" 4
|
| 545 |
|
|
.IX Item "--no-adjust-warnings"
|
| 546 |
|
|
.PD
|
| 547 |
|
|
Do not issue a warning if \fB\-\-change\-section\-address\fR or
|
| 548 |
|
|
\&\fB\-\-adjust\-section\-lma\fR or \fB\-\-adjust\-section\-vma\fR is used, even
|
| 549 |
|
|
if the named section does not exist.
|
| 550 |
|
|
.IP "\fB\-\-set\-section\-flags\fR \fIsection\fR\fB=\fR\fIflags\fR" 4
|
| 551 |
|
|
.IX Item "--set-section-flags section=flags"
|
| 552 |
|
|
Set the flags for the named section. The \fIflags\fR argument is a
|
| 553 |
|
|
comma separated string of flag names. The recognized names are
|
| 554 |
|
|
\&\fBalloc\fR, \fBcontents\fR, \fBload\fR, \fBnoload\fR,
|
| 555 |
|
|
\&\fBreadonly\fR, \fBcode\fR, \fBdata\fR, \fBrom\fR, \fBshare\fR, and
|
| 556 |
|
|
\&\fBdebug\fR. You can set the \fBcontents\fR flag for a section which
|
| 557 |
|
|
does not have contents, but it is not meaningful to clear the
|
| 558 |
|
|
\&\fBcontents\fR flag of a section which does have contents\*(--just remove
|
| 559 |
|
|
the section instead. Not all flags are meaningful for all object file
|
| 560 |
|
|
formats.
|
| 561 |
|
|
.IP "\fB\-\-add\-section\fR \fIsectionname\fR\fB=\fR\fIfilename\fR" 4
|
| 562 |
|
|
.IX Item "--add-section sectionname=filename"
|
| 563 |
|
|
Add a new section named \fIsectionname\fR while copying the file. The
|
| 564 |
|
|
contents of the new section are taken from the file \fIfilename\fR. The
|
| 565 |
|
|
size of the section will be the size of the file. This option only
|
| 566 |
|
|
works on file formats which can support sections with arbitrary names.
|
| 567 |
|
|
.IP "\fB\-\-rename\-section\fR \fIoldname\fR\fB=\fR\fInewname\fR\fB[,\fR\fIflags\fR\fB]\fR" 4
|
| 568 |
|
|
.IX Item "--rename-section oldname=newname[,flags]"
|
| 569 |
|
|
Rename a section from \fIoldname\fR to \fInewname\fR, optionally
|
| 570 |
|
|
changing the section's flags to \fIflags\fR in the process. This has
|
| 571 |
|
|
the advantage over usng a linker script to perform the rename in that
|
| 572 |
|
|
the output stays as an object file and does not become a linked
|
| 573 |
|
|
executable.
|
| 574 |
|
|
.Sp
|
| 575 |
|
|
This option is particularly helpful when the input format is binary,
|
| 576 |
|
|
since this will always create a section called .data. If for example,
|
| 577 |
|
|
you wanted instead to create a section called .rodata containing binary
|
| 578 |
|
|
data you could use the following command line to achieve it:
|
| 579 |
|
|
.Sp
|
| 580 |
|
|
.Vb 3
|
| 581 |
|
|
\& objcopy \-I binary \-O \-B \e
|
| 582 |
|
|
\& \-\-rename\-section .data=.rodata,alloc,load,readonly,data,contents \e
|
| 583 |
|
|
\&
|
| 584 |
|
|
.Ve
|
| 585 |
|
|
.IP "\fB\-\-long\-section\-names {enable,disable,keep}\fR" 4
|
| 586 |
|
|
.IX Item "--long-section-names {enable,disable,keep}"
|
| 587 |
|
|
Controls the handling of long section names when processing \f(CW\*(C`COFF\*(C'\fR
|
| 588 |
|
|
and \f(CW\*(C`PE\-COFF\*(C'\fR object formats. The default behaviour, \fBkeep\fR,
|
| 589 |
|
|
is to preserve long section names if any are present in the input file.
|
| 590 |
|
|
The \fBenable\fR and \fBdisable\fR options forcibly enable or disable
|
| 591 |
|
|
the use of long section names in the output object; when \fBdisable\fR
|
| 592 |
|
|
is in effect, any long section names in the input object will be truncated.
|
| 593 |
|
|
The \fBenable\fR option will only emit long section names if any are
|
| 594 |
|
|
present in the inputs; this is mostly the same as \fBkeep\fR, but it
|
| 595 |
|
|
is left undefined whether the \fBenable\fR option might force the
|
| 596 |
|
|
creation of an empty string table in the output file.
|
| 597 |
|
|
.IP "\fB\-\-change\-leading\-char\fR" 4
|
| 598 |
|
|
.IX Item "--change-leading-char"
|
| 599 |
|
|
Some object file formats use special characters at the start of
|
| 600 |
|
|
symbols. The most common such character is underscore, which compilers
|
| 601 |
|
|
often add before every symbol. This option tells \fBobjcopy\fR to
|
| 602 |
|
|
change the leading character of every symbol when it converts between
|
| 603 |
|
|
object file formats. If the object file formats use the same leading
|
| 604 |
|
|
character, this option has no effect. Otherwise, it will add a
|
| 605 |
|
|
character, or remove a character, or change a character, as
|
| 606 |
|
|
appropriate.
|
| 607 |
|
|
.IP "\fB\-\-remove\-leading\-char\fR" 4
|
| 608 |
|
|
.IX Item "--remove-leading-char"
|
| 609 |
|
|
If the first character of a global symbol is a special symbol leading
|
| 610 |
|
|
character used by the object file format, remove the character. The
|
| 611 |
|
|
most common symbol leading character is underscore. This option will
|
| 612 |
|
|
remove a leading underscore from all global symbols. This can be useful
|
| 613 |
|
|
if you want to link together objects of different file formats with
|
| 614 |
|
|
different conventions for symbol names. This is different from
|
| 615 |
|
|
\&\fB\-\-change\-leading\-char\fR because it always changes the symbol name
|
| 616 |
|
|
when appropriate, regardless of the object file format of the output
|
| 617 |
|
|
file.
|
| 618 |
|
|
.IP "\fB\-\-reverse\-bytes=\fR\fInum\fR" 4
|
| 619 |
|
|
.IX Item "--reverse-bytes=num"
|
| 620 |
|
|
Reverse the bytes in a section with output contents. A section length must
|
| 621 |
|
|
be evenly divisible by the value given in order for the swap to be able to
|
| 622 |
|
|
take place. Reversing takes place before the interleaving is performed.
|
| 623 |
|
|
.Sp
|
| 624 |
|
|
This option is used typically in generating \s-1ROM\s0 images for problematic
|
| 625 |
|
|
target systems. For example, on some target boards, the 32\-bit words
|
| 626 |
|
|
fetched from 8\-bit ROMs are re-assembled in little-endian byte order
|
| 627 |
|
|
regardless of the \s-1CPU\s0 byte order. Depending on the programming model, the
|
| 628 |
|
|
endianness of the \s-1ROM\s0 may need to be modified.
|
| 629 |
|
|
.Sp
|
| 630 |
|
|
Consider a simple file with a section containing the following eight
|
| 631 |
|
|
bytes: \f(CW12345678\fR.
|
| 632 |
|
|
.Sp
|
| 633 |
|
|
Using \fB\-\-reverse\-bytes=2\fR for the above example, the bytes in the
|
| 634 |
|
|
output file would be ordered \f(CW21436587\fR.
|
| 635 |
|
|
.Sp
|
| 636 |
|
|
Using \fB\-\-reverse\-bytes=4\fR for the above example, the bytes in the
|
| 637 |
|
|
output file would be ordered \f(CW43218765\fR.
|
| 638 |
|
|
.Sp
|
| 639 |
|
|
By using \fB\-\-reverse\-bytes=2\fR for the above example, followed by
|
| 640 |
|
|
\&\fB\-\-reverse\-bytes=4\fR on the output file, the bytes in the second
|
| 641 |
|
|
output file would be ordered \f(CW34127856\fR.
|
| 642 |
|
|
.IP "\fB\-\-srec\-len=\fR\fIival\fR" 4
|
| 643 |
|
|
.IX Item "--srec-len=ival"
|
| 644 |
|
|
Meaningful only for srec output. Set the maximum length of the Srecords
|
| 645 |
|
|
being produced to \fIival\fR. This length covers both address, data and
|
| 646 |
|
|
crc fields.
|
| 647 |
|
|
.IP "\fB\-\-srec\-forceS3\fR" 4
|
| 648 |
|
|
.IX Item "--srec-forceS3"
|
| 649 |
|
|
Meaningful only for srec output. Avoid generation of S1/S2 records,
|
| 650 |
|
|
creating S3\-only record format.
|
| 651 |
|
|
.IP "\fB\-\-redefine\-sym\fR \fIold\fR\fB=\fR\fInew\fR" 4
|
| 652 |
|
|
.IX Item "--redefine-sym old=new"
|
| 653 |
|
|
Change the name of a symbol \fIold\fR, to \fInew\fR. This can be useful
|
| 654 |
|
|
when one is trying link two things together for which you have no
|
| 655 |
|
|
source, and there are name collisions.
|
| 656 |
|
|
.IP "\fB\-\-redefine\-syms=\fR\fIfilename\fR" 4
|
| 657 |
|
|
.IX Item "--redefine-syms=filename"
|
| 658 |
|
|
Apply \fB\-\-redefine\-sym\fR to each symbol pair "\fIold\fR \fInew\fR"
|
| 659 |
|
|
listed in the file \fIfilename\fR. \fIfilename\fR is simply a flat file,
|
| 660 |
|
|
with one symbol pair per line. Line comments may be introduced by the hash
|
| 661 |
|
|
character. This option may be given more than once.
|
| 662 |
|
|
.IP "\fB\-\-weaken\fR" 4
|
| 663 |
|
|
.IX Item "--weaken"
|
| 664 |
|
|
Change all global symbols in the file to be weak. This can be useful
|
| 665 |
|
|
when building an object which will be linked against other objects using
|
| 666 |
|
|
the \fB\-R\fR option to the linker. This option is only effective when
|
| 667 |
|
|
using an object file format which supports weak symbols.
|
| 668 |
|
|
.IP "\fB\-\-keep\-symbols=\fR\fIfilename\fR" 4
|
| 669 |
|
|
.IX Item "--keep-symbols=filename"
|
| 670 |
|
|
Apply \fB\-\-keep\-symbol\fR option to each symbol listed in the file
|
| 671 |
|
|
\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
|
| 672 |
|
|
name per line. Line comments may be introduced by the hash character.
|
| 673 |
|
|
This option may be given more than once.
|
| 674 |
|
|
.IP "\fB\-\-strip\-symbols=\fR\fIfilename\fR" 4
|
| 675 |
|
|
.IX Item "--strip-symbols=filename"
|
| 676 |
|
|
Apply \fB\-\-strip\-symbol\fR option to each symbol listed in the file
|
| 677 |
|
|
\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
|
| 678 |
|
|
name per line. Line comments may be introduced by the hash character.
|
| 679 |
|
|
This option may be given more than once.
|
| 680 |
|
|
.IP "\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR" 4
|
| 681 |
|
|
.IX Item "--strip-unneeded-symbols=filename"
|
| 682 |
|
|
Apply \fB\-\-strip\-unneeded\-symbol\fR option to each symbol listed in
|
| 683 |
|
|
the file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one
|
| 684 |
|
|
symbol name per line. Line comments may be introduced by the hash
|
| 685 |
|
|
character. This option may be given more than once.
|
| 686 |
|
|
.IP "\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR" 4
|
| 687 |
|
|
.IX Item "--keep-global-symbols=filename"
|
| 688 |
|
|
Apply \fB\-\-keep\-global\-symbol\fR option to each symbol listed in the
|
| 689 |
|
|
file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one
|
| 690 |
|
|
symbol name per line. Line comments may be introduced by the hash
|
| 691 |
|
|
character. This option may be given more than once.
|
| 692 |
|
|
.IP "\fB\-\-localize\-symbols=\fR\fIfilename\fR" 4
|
| 693 |
|
|
.IX Item "--localize-symbols=filename"
|
| 694 |
|
|
Apply \fB\-\-localize\-symbol\fR option to each symbol listed in the file
|
| 695 |
|
|
\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
|
| 696 |
|
|
name per line. Line comments may be introduced by the hash character.
|
| 697 |
|
|
This option may be given more than once.
|
| 698 |
|
|
.IP "\fB\-\-globalize\-symbols=\fR\fIfilename\fR" 4
|
| 699 |
|
|
.IX Item "--globalize-symbols=filename"
|
| 700 |
|
|
Apply \fB\-\-globalize\-symbol\fR option to each symbol listed in the file
|
| 701 |
|
|
\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
|
| 702 |
|
|
name per line. Line comments may be introduced by the hash character.
|
| 703 |
|
|
This option may be given more than once.
|
| 704 |
|
|
.IP "\fB\-\-weaken\-symbols=\fR\fIfilename\fR" 4
|
| 705 |
|
|
.IX Item "--weaken-symbols=filename"
|
| 706 |
|
|
Apply \fB\-\-weaken\-symbol\fR option to each symbol listed in the file
|
| 707 |
|
|
\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
|
| 708 |
|
|
name per line. Line comments may be introduced by the hash character.
|
| 709 |
|
|
This option may be given more than once.
|
| 710 |
|
|
.IP "\fB\-\-alt\-machine\-code=\fR\fIindex\fR" 4
|
| 711 |
|
|
.IX Item "--alt-machine-code=index"
|
| 712 |
|
|
If the output architecture has alternate machine codes, use the
|
| 713 |
|
|
\&\fIindex\fRth code instead of the default one. This is useful in case
|
| 714 |
|
|
a machine is assigned an official code and the tool-chain adopts the
|
| 715 |
|
|
new code, but other applications still depend on the original code
|
| 716 |
|
|
being used. For \s-1ELF\s0 based architectures if the \fIindex\fR
|
| 717 |
|
|
alternative does not exist then the value is treated as an absolute
|
| 718 |
|
|
number to be stored in the e_machine field of the \s-1ELF\s0 header.
|
| 719 |
|
|
.IP "\fB\-\-writable\-text\fR" 4
|
| 720 |
|
|
.IX Item "--writable-text"
|
| 721 |
|
|
Mark the output text as writable. This option isn't meaningful for all
|
| 722 |
|
|
object file formats.
|
| 723 |
|
|
.IP "\fB\-\-readonly\-text\fR" 4
|
| 724 |
|
|
.IX Item "--readonly-text"
|
| 725 |
|
|
Make the output text write protected. This option isn't meaningful for all
|
| 726 |
|
|
object file formats.
|
| 727 |
|
|
.IP "\fB\-\-pure\fR" 4
|
| 728 |
|
|
.IX Item "--pure"
|
| 729 |
|
|
Mark the output file as demand paged. This option isn't meaningful for all
|
| 730 |
|
|
object file formats.
|
| 731 |
|
|
.IP "\fB\-\-impure\fR" 4
|
| 732 |
|
|
.IX Item "--impure"
|
| 733 |
|
|
Mark the output file as impure. This option isn't meaningful for all
|
| 734 |
|
|
object file formats.
|
| 735 |
|
|
.IP "\fB\-\-prefix\-symbols=\fR\fIstring\fR" 4
|
| 736 |
|
|
.IX Item "--prefix-symbols=string"
|
| 737 |
|
|
Prefix all symbols in the output file with \fIstring\fR.
|
| 738 |
|
|
.IP "\fB\-\-prefix\-sections=\fR\fIstring\fR" 4
|
| 739 |
|
|
.IX Item "--prefix-sections=string"
|
| 740 |
|
|
Prefix all section names in the output file with \fIstring\fR.
|
| 741 |
|
|
.IP "\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR" 4
|
| 742 |
|
|
.IX Item "--prefix-alloc-sections=string"
|
| 743 |
|
|
Prefix all the names of all allocated sections in the output file with
|
| 744 |
|
|
\&\fIstring\fR.
|
| 745 |
|
|
.IP "\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR" 4
|
| 746 |
|
|
.IX Item "--add-gnu-debuglink=path-to-file"
|
| 747 |
|
|
Creates a .gnu_debuglink section which contains a reference to \fIpath-to-file\fR
|
| 748 |
|
|
and adds it to the output file.
|
| 749 |
|
|
.IP "\fB\-\-keep\-file\-symbols\fR" 4
|
| 750 |
|
|
.IX Item "--keep-file-symbols"
|
| 751 |
|
|
When stripping a file, perhaps with \fB\-\-strip\-debug\fR or
|
| 752 |
|
|
\&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names,
|
| 753 |
|
|
which would otherwise get stripped.
|
| 754 |
|
|
.IP "\fB\-\-only\-keep\-debug\fR" 4
|
| 755 |
|
|
.IX Item "--only-keep-debug"
|
| 756 |
|
|
Strip a file, removing contents of any sections that would not be
|
| 757 |
|
|
stripped by \fB\-\-strip\-debug\fR and leaving the debugging sections
|
| 758 |
|
|
intact. In \s-1ELF\s0 files, this preserves all note sections in the output.
|
| 759 |
|
|
.Sp
|
| 760 |
|
|
The intention is that this option will be used in conjunction with
|
| 761 |
|
|
\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a
|
| 762 |
|
|
stripped binary which will occupy less space in \s-1RAM\s0 and in a
|
| 763 |
|
|
distribution and the second a debugging information file which is only
|
| 764 |
|
|
needed if debugging abilities are required. The suggested procedure
|
| 765 |
|
|
to create these files is as follows:
|
| 766 |
|
|
.RS 4
|
| 767 |
|
|
.IP "1." 4
|
| 768 |
|
|
.IX Item "1."
|
| 769 |
|
|
\&\f(CW\*(C`foo\*(C'\fR then...
|
| 770 |
|
|
.ie n .IP "1." 4
|
| 771 |
|
|
.el .IP "1." 4
|
| 772 |
|
|
.IX Item "1."
|
| 773 |
|
|
create a file containing the debugging info.
|
| 774 |
|
|
.ie n .IP "1." 4
|
| 775 |
|
|
.el .IP "1." 4
|
| 776 |
|
|
.IX Item "1."
|
| 777 |
|
|
stripped executable.
|
| 778 |
|
|
.ie n .IP "1." 4
|
| 779 |
|
|
.el .IP "1." 4
|
| 780 |
|
|
.IX Item "1."
|
| 781 |
|
|
to add a link to the debugging info into the stripped executable.
|
| 782 |
|
|
.RE
|
| 783 |
|
|
.RS 4
|
| 784 |
|
|
.Sp
|
| 785 |
|
|
Note\-\-\-the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info
|
| 786 |
|
|
file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is
|
| 787 |
|
|
optional. You could instead do this:
|
| 788 |
|
|
.IP "1." 4
|
| 789 |
|
|
.IX Item "1."
|
| 790 |
|
|
.PD 0
|
| 791 |
|
|
.ie n .IP "1." 4
|
| 792 |
|
|
.el .IP "1." 4
|
| 793 |
|
|
.IX Item "1."
|
| 794 |
|
|
.ie n .IP "1." 4
|
| 795 |
|
|
.el .IP "1." 4
|
| 796 |
|
|
.IX Item "1."
|
| 797 |
|
|
.ie n .IP "1." 4
|
| 798 |
|
|
.el .IP "1." 4
|
| 799 |
|
|
.IX Item "1."
|
| 800 |
|
|
.RE
|
| 801 |
|
|
.RS 4
|
| 802 |
|
|
.PD
|
| 803 |
|
|
.Sp
|
| 804 |
|
|
i.e., the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the
|
| 805 |
|
|
full executable. It does not have to be a file created by the
|
| 806 |
|
|
\&\fB\-\-only\-keep\-debug\fR switch.
|
| 807 |
|
|
.Sp
|
| 808 |
|
|
Note\-\-\-this switch is only intended for use on fully linked files. It
|
| 809 |
|
|
does not make sense to use it on object files where the debugging
|
| 810 |
|
|
information may be incomplete. Besides the gnu_debuglink feature
|
| 811 |
|
|
currently only supports the presence of one filename containing
|
| 812 |
|
|
debugging information, not multiple filenames on a one-per-object-file
|
| 813 |
|
|
basis.
|
| 814 |
|
|
.RE
|
| 815 |
|
|
.IP "\fB\-\-file\-alignment\fR \fInum\fR" 4
|
| 816 |
|
|
.IX Item "--file-alignment num"
|
| 817 |
|
|
Specify the file alignment. Sections in the file will always begin at
|
| 818 |
|
|
file offsets which are multiples of this number. This defaults to
|
| 819 |
|
|
512.
|
| 820 |
|
|
[This option is specific to \s-1PE\s0 targets.]
|
| 821 |
|
|
.IP "\fB\-\-heap\fR \fIreserve\fR" 4
|
| 822 |
|
|
.IX Item "--heap reserve"
|
| 823 |
|
|
.PD 0
|
| 824 |
|
|
.IP "\fB\-\-heap\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4
|
| 825 |
|
|
.IX Item "--heap reserve,commit"
|
| 826 |
|
|
.PD
|
| 827 |
|
|
Specify the number of bytes of memory to reserve (and optionally commit)
|
| 828 |
|
|
to be used as heap for this program.
|
| 829 |
|
|
[This option is specific to \s-1PE\s0 targets.]
|
| 830 |
|
|
.IP "\fB\-\-image\-base\fR \fIvalue\fR" 4
|
| 831 |
|
|
.IX Item "--image-base value"
|
| 832 |
|
|
Use \fIvalue\fR as the base address of your program or dll. This is
|
| 833 |
|
|
the lowest memory location that will be used when your program or dll
|
| 834 |
|
|
is loaded. To reduce the need to relocate and improve performance of
|
| 835 |
|
|
your dlls, each should have a unique base address and not overlap any
|
| 836 |
|
|
other dlls. The default is 0x400000 for executables, and 0x10000000
|
| 837 |
|
|
for dlls.
|
| 838 |
|
|
[This option is specific to \s-1PE\s0 targets.]
|
| 839 |
|
|
.IP "\fB\-\-section\-alignment\fR \fInum\fR" 4
|
| 840 |
|
|
.IX Item "--section-alignment num"
|
| 841 |
|
|
Sets the section alignment. Sections in memory will always begin at
|
| 842 |
|
|
addresses which are a multiple of this number. Defaults to 0x1000.
|
| 843 |
|
|
[This option is specific to \s-1PE\s0 targets.]
|
| 844 |
|
|
.IP "\fB\-\-stack\fR \fIreserve\fR" 4
|
| 845 |
|
|
.IX Item "--stack reserve"
|
| 846 |
|
|
.PD 0
|
| 847 |
|
|
.IP "\fB\-\-stack\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4
|
| 848 |
|
|
.IX Item "--stack reserve,commit"
|
| 849 |
|
|
.PD
|
| 850 |
|
|
Specify the number of bytes of memory to reserve (and optionally commit)
|
| 851 |
|
|
to be used as stack for this program.
|
| 852 |
|
|
[This option is specific to \s-1PE\s0 targets.]
|
| 853 |
|
|
.IP "\fB\-\-subsystem\fR \fIwhich\fR" 4
|
| 854 |
|
|
.IX Item "--subsystem which"
|
| 855 |
|
|
.PD 0
|
| 856 |
|
|
.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR" 4
|
| 857 |
|
|
.IX Item "--subsystem which:major"
|
| 858 |
|
|
.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR\fB.\fR\fIminor\fR" 4
|
| 859 |
|
|
.IX Item "--subsystem which:major.minor"
|
| 860 |
|
|
.PD
|
| 861 |
|
|
Specifies the subsystem under which your program will execute. The
|
| 862 |
|
|
legal values for \fIwhich\fR are \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`windows\*(C'\fR,
|
| 863 |
|
|
\&\f(CW\*(C`console\*(C'\fR, \f(CW\*(C`posix\*(C'\fR, \f(CW\*(C`efi\-app\*(C'\fR, \f(CW\*(C`efi\-bsd\*(C'\fR,
|
| 864 |
|
|
\&\f(CW\*(C`efi\-rtd\*(C'\fR, \f(CW\*(C`sal\-rtd\*(C'\fR, and \f(CW\*(C`xbox\*(C'\fR. You may optionally set
|
| 865 |
|
|
the subsystem version also. Numeric values are also accepted for
|
| 866 |
|
|
\&\fIwhich\fR.
|
| 867 |
|
|
[This option is specific to \s-1PE\s0 targets.]
|
| 868 |
|
|
.IP "\fB\-\-extract\-symbol\fR" 4
|
| 869 |
|
|
.IX Item "--extract-symbol"
|
| 870 |
|
|
Keep the file's section flags and symbols but remove all section data.
|
| 871 |
|
|
Specifically, the option:
|
| 872 |
|
|
.RS 4
|
| 873 |
|
|
.IP "*" 4
|
| 874 |
|
|
.IX Item "*"
|
| 875 |
|
|
.PD 0
|
| 876 |
|
|
.IP "*" 4
|
| 877 |
|
|
.IX Item "*"
|
| 878 |
|
|
.IP "*" 4
|
| 879 |
|
|
.IX Item "*"
|
| 880 |
|
|
.RE
|
| 881 |
|
|
.RS 4
|
| 882 |
|
|
.PD
|
| 883 |
|
|
.Sp
|
| 884 |
|
|
This option is used to build a \fI.sym\fR file for a VxWorks kernel.
|
| 885 |
|
|
It can also be a useful way of reducing the size of a \fB\-\-just\-symbols\fR
|
| 886 |
|
|
linker input file.
|
| 887 |
|
|
.RE
|
| 888 |
|
|
.IP "\fB\-V\fR" 4
|
| 889 |
|
|
.IX Item "-V"
|
| 890 |
|
|
.PD 0
|
| 891 |
|
|
.IP "\fB\-\-version\fR" 4
|
| 892 |
|
|
.IX Item "--version"
|
| 893 |
|
|
.PD
|
| 894 |
|
|
Show the version number of \fBobjcopy\fR.
|
| 895 |
|
|
.IP "\fB\-v\fR" 4
|
| 896 |
|
|
.IX Item "-v"
|
| 897 |
|
|
.PD 0
|
| 898 |
|
|
.IP "\fB\-\-verbose\fR" 4
|
| 899 |
|
|
.IX Item "--verbose"
|
| 900 |
|
|
.PD
|
| 901 |
|
|
Verbose output: list all object files modified. In the case of
|
| 902 |
|
|
archives, \fBobjcopy \-V\fR lists all members of the archive.
|
| 903 |
|
|
.IP "\fB\-\-help\fR" 4
|
| 904 |
|
|
.IX Item "--help"
|
| 905 |
|
|
Show a summary of the options to \fBobjcopy\fR.
|
| 906 |
|
|
.IP "\fB\-\-info\fR" 4
|
| 907 |
|
|
.IX Item "--info"
|
| 908 |
|
|
Display a list showing all architectures and object formats available.
|
| 909 |
|
|
.IP "\fB@\fR\fIfile\fR" 4
|
| 910 |
|
|
.IX Item "@file"
|
| 911 |
|
|
Read command-line options from \fIfile\fR. The options read are
|
| 912 |
|
|
inserted in place of the original @\fIfile\fR option. If \fIfile\fR
|
| 913 |
|
|
does not exist, or cannot be read, then the option will be treated
|
| 914 |
|
|
literally, and not removed.
|
| 915 |
|
|
.Sp
|
| 916 |
|
|
Options in \fIfile\fR are separated by whitespace. A whitespace
|
| 917 |
|
|
character may be included in an option by surrounding the entire
|
| 918 |
|
|
option in either single or double quotes. Any character (including a
|
| 919 |
|
|
backslash) may be included by prefixing the character to be included
|
| 920 |
|
|
with a backslash. The \fIfile\fR may itself contain additional
|
| 921 |
|
|
@\fIfile\fR options; any such options will be processed recursively.
|
| 922 |
|
|
.SH "SEE ALSO"
|
| 923 |
|
|
.IX Header "SEE ALSO"
|
| 924 |
|
|
\&\fIld\fR\|(1), \fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR.
|
| 925 |
|
|
.SH "COPYRIGHT"
|
| 926 |
|
|
.IX Header "COPYRIGHT"
|
| 927 |
|
|
Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
| 928 |
|
|
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
| 929 |
|
|
.PP
|
| 930 |
|
|
Permission is granted to copy, distribute and/or modify this document
|
| 931 |
|
|
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
|
| 932 |
|
|
or any later version published by the Free Software Foundation;
|
| 933 |
|
|
with no Invariant Sections, with no Front-Cover Texts, and with no
|
| 934 |
|
|
Back-Cover Texts. A copy of the license is included in the
|
| 935 |
|
|
section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
|