mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 17:18:24 +08:00
* objcopy.c (struct section_list): Add fields used, adjust, val.
(adjust_start, set_start_set, set_start): New static variables. (adjust_section_vma, adjust_sections): New static variables. (copy_options): Add --adjust-start, --adjust-vma, --adjust-section-vma, --adjust-warnings, --no-adjust-warnings, --set-start. (parse_vma): New static function. (copy_usage): Mention new options. (copy_object): Handle --set-start and --adjust-start. (setup_section): Correct type of last argument to PTR. Set used field if section is removed. Handle --adjust-vma and --adjust-section-vma. (copy_section): Correct type of last argument to PTR. (mark_symbols_used_in_relocations): Likewise. (strip_main): Clear used field when handling -R. (copy_main): Handle new options. * binutils.texi (objcopy): Document new options. * objcopy.1: Document new options.
This commit is contained in:
@ -747,6 +747,10 @@ objcopy [ -F @var{bfdname} | --target=@var{bfdname} ]
|
||||
[ -b @var{byte} | --byte=@var{byte} ]
|
||||
[ -i @var{interleave} | --interleave=@var{interleave} ]
|
||||
[ -R @var{sectionname} | --remove-section=@var{sectionname} ]
|
||||
[ --set-start=@var{val} ] [ --adjust-start=@var{incr} ]
|
||||
[ --adjust-vma=@var{incr} ]
|
||||
[ --adjust-section-vma=@var{section}@{=,+,-@}@var{val} ]
|
||||
[ --adjust-warnings ] [ --no-adjust-warnings ]
|
||||
[ -v | --verbose ] [ -V | --version ] [ --help ]
|
||||
@var{infile} [@var{outfile}]
|
||||
@end smallexample
|
||||
@ -827,6 +831,38 @@ copy with the @var{-b} or @samp{--byte} option. The default is 4.
|
||||
@code{objcopy} ignores this option if you do not specify either @samp{-b} or
|
||||
@samp{--byte}.
|
||||
|
||||
@item --set-start @var{val}
|
||||
Set the address of the new file to @var{val}. Not all object file
|
||||
formats support setting the start address.
|
||||
|
||||
@item --adjust-start @var{incr}
|
||||
Adjust the start address by adding @var{incr}. Not all object file
|
||||
formats support setting the start address.
|
||||
|
||||
@item --adjust-vma @var{incr}
|
||||
Adjust the address of all sections, as well as the start address, by
|
||||
adding @var{incr}. Some object file formats do not permit section
|
||||
addresses to be changed arbitrarily. Note that this does not relocate
|
||||
the sections; if the program expects sections to be loaded at a certain
|
||||
address, and this option is used to change the sections such that they
|
||||
are loaded at a different address, the program may fail.
|
||||
|
||||
@item --adjust-section-vma @var{section}@{=,+,-@}@var{val}
|
||||
Set or adjust the address of the named @var{section}. If @samp{=} is
|
||||
used, the section address is set to @var{val}. Otherwise, @var{val} is
|
||||
added to or subtracted from the section address. See the comments under
|
||||
@samp{--adjust-vma}, above. If @var{section} does not exist in the
|
||||
input file, a warning will be issued, unless @samp{--no-adjust-warnings}
|
||||
is used.
|
||||
|
||||
@item --adjust-warnings
|
||||
If @samp{--adjust-section-vma} is used, and the named section does not
|
||||
exist, issue a warning. This is the default.
|
||||
|
||||
@item --no-adjust-warnings
|
||||
Do not issue a warning if @samp{--adjust-section-vma} is used, even if
|
||||
the named section does not exist.
|
||||
|
||||
@item -V
|
||||
@itemx --version
|
||||
Show the version number of @code{objcopy}.
|
||||
|
Reference in New Issue
Block a user