mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-01-27 03:54:29 +00:00
2007-07-18 Roland McGrath <roland@redhat.com>
* emultempl/elf32.em (gld${EMULATION_NAME}_write_build_id_section): Use ASEC->contents for CONTENTS when missing, and allocate ASEC->size if needed.
This commit is contained in:
parent
9bd06a30b3
commit
b2ff8454d8
@ -945,12 +945,12 @@ gld${EMULATION_NAME}_write_build_id_section (bfd *abfd)
|
|||||||
|
|
||||||
if (i_shdr->contents == NULL)
|
if (i_shdr->contents == NULL)
|
||||||
{
|
{
|
||||||
ASSERT (asec->output_offset == 0);
|
if (asec->contents == NULL)
|
||||||
i_shdr->contents = xcalloc (i_shdr->sh_size, 1);
|
asec->contents = xmalloc (asec->size);
|
||||||
if (i_shdr->contents == NULL)
|
contents = asec->contents;
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
contents = i_shdr->contents + asec->output_offset;
|
else
|
||||||
|
contents = i_shdr->contents + asec->output_offset;
|
||||||
|
|
||||||
e_note = (void *) contents;
|
e_note = (void *) contents;
|
||||||
size = offsetof (Elf_External_Note, name[sizeof "GNU"]);
|
size = offsetof (Elf_External_Note, name[sizeof "GNU"]);
|
||||||
@ -1019,9 +1019,10 @@ gld${EMULATION_NAME}_write_build_id_section (bfd *abfd)
|
|||||||
else
|
else
|
||||||
abort (); /* Should have been validated earlier. */
|
abort (); /* Should have been validated earlier. */
|
||||||
|
|
||||||
size = i_shdr->sh_size;
|
size = asec->size;
|
||||||
return (bfd_seek (abfd, i_shdr->sh_offset, SEEK_SET) == 0
|
return (bfd_seek (abfd,
|
||||||
&& bfd_bwrite (i_shdr->contents, size, abfd) == size);
|
i_shdr->sh_offset + asec->output_offset, SEEK_SET) == 0
|
||||||
|
&& bfd_bwrite (contents, size, abfd) == size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user