From: Ian Lance Taylor Date: Wed, 19 Oct 1994 18:11:10 +0000 (+0000) Subject: * objcopy.c (copy_object): Revert yesterday's change. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a6afc0907186cf94ec6054d8c210727a3b4733af;p=binutils-gdb.git * objcopy.c (copy_object): Revert yesterday's change. * binutils.texi, objcopy.1: Remove special mention of --set-start and `binary' output format. --- diff --git a/binutils/binutils.texi b/binutils/binutils.texi index 5e2f2c7e4ab..3c078f8e4fd 100644 --- a/binutils/binutils.texi +++ b/binutils/binutils.texi @@ -774,9 +774,8 @@ target of @samp{srec} (e.g., use @samp{-O srec}). output target of @samp{binary} (e.g., use @samp{-O binary}). When @code{objcopy} generates a raw binary file, it will essentially produce a memory dump of the contents of the input object file. All symbols and -relocation information will be discarded. By default, the memory dump -will start at virtual address zero; the @samp{--set-start} option may be -used to specify a different starting point. +relocation information will be discarded. The memory dump will start at +the virtual address of the lowest section copied into the output file. When generating an S-record or a raw binary file, it may be helpful to use @samp{-S} to remove sections containing debugging information. In @@ -849,9 +848,7 @@ copy with the @var{-b} or @samp{--byte} option. The default is 4. @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. When using the @samp{binary} -output file format, the start address sets the virtual address of the -first byte in the binary output file. +formats support setting the start address. @item --adjust-start @var{incr} Adjust the start address by adding @var{incr}. Not all object file diff --git a/binutils/objcopy.1 b/binutils/objcopy.1 index ca863ffd37e..e2876d1a789 100644 --- a/binutils/objcopy.1 +++ b/binutils/objcopy.1 @@ -70,10 +70,8 @@ When .B objcopy generates a raw binary file, it will essentially produce a memory dump of the contents of the input object file. All symbols and relocation -information will be discarded. By default, the memory dump will start -at virtual address zero; the -.B --set-start -option may be used to specify a different starting point. +information will be discarded. The memory dump will start at the +virtual address of the lowest section copied into the output file. .PP When generating an S-record or a raw binary file, it may be helpful to use @@ -140,9 +138,7 @@ The interleave is ignored if neither \fB\-b\fP nor \fB\-\-byte\fP is given. .TP .B \fB\-\-set\-start=\fIval Set the start address of the new file to \fIval\fP. Not all object -file formats support setting the start address. When using the -\fBbinary\fP output file format, the start address sets the virtual -address of the first byte in the binary output file. +file formats support setting the start address. .TP .B \fB\-\-adjust\-start=\fIincr Adjust the start address by adding \fIincr\fP. Not all object file diff --git a/binutils/objcopy.c b/binutils/objcopy.c index eff90c51750..70d118e03c9 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -316,15 +316,7 @@ copy_object (ibfd, obfd) if (set_start_set) start = set_start; else - { - /* As a special hack make it easier to generate a raw binary - file, we default the starting address to zero for the binary - output format. */ - if (strcmp (bfd_get_target (obfd), "binary") == 0) - start = 0; - else - start = bfd_get_start_address (ibfd); - } + start = bfd_get_start_address (ibfd); start += adjust_start; if (!bfd_set_start_address (obfd, start)