mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 07:53:51 +08:00
PR 21564, Section start in binary output file incorrect
PR 21564 * binary.c (binary_set_section_contents): Scale lma by octets per byte to set filepos.
This commit is contained in:
@ -230,6 +230,7 @@ binary_set_section_contents (bfd *abfd,
|
||||
|
||||
if (! abfd->output_has_begun)
|
||||
{
|
||||
unsigned int opb;
|
||||
bfd_boolean found_low;
|
||||
bfd_vma low;
|
||||
asection *s;
|
||||
@ -250,9 +251,10 @@ binary_set_section_contents (bfd *abfd,
|
||||
found_low = TRUE;
|
||||
}
|
||||
|
||||
opb = bfd_octets_per_byte (abfd);
|
||||
for (s = abfd->sections; s != NULL; s = s->next)
|
||||
{
|
||||
s->filepos = s->lma - low;
|
||||
s->filepos = (s->lma - low) * opb;
|
||||
|
||||
/* Skip following warning check for sections that will not
|
||||
occupy file space. */
|
||||
|
Reference in New Issue
Block a user