* objcopy.c (copy_object): If the output file format is `binary',
and the start address was not set using --set-start, default the start address to zero. This hack is because the `binary' output file format uses the start address to set the virtual address of the first byte in the file. * binutils.texi, objcopy.1: Add some notes on generating S-records and binary files.
This commit is contained in:
parent
c768bd3f2d
commit
67f67ed998
4 changed files with 67 additions and 3 deletions
|
@ -316,7 +316,15 @@ copy_object (ibfd, obfd)
|
|||
if (set_start_set)
|
||||
start = set_start;
|
||||
else
|
||||
start = bfd_get_start_address (ibfd);
|
||||
{
|
||||
/* 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 += adjust_start;
|
||||
|
||||
if (!bfd_set_start_address (obfd, start)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue