mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
alpha_ecoff_get_relocated_section_contents
Use bfd_get_full_section_contents and tidy the start of this function to match current generic get_relocated_section_contents. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Use bfd_get_full_section_contents.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2021-02-15 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Use
|
||||||
|
bfd_get_full_section_contents.
|
||||||
|
|
||||||
2021-02-14 Alan Modra <amodra@gmail.com>
|
2021-02-14 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): Apply
|
* elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): Apply
|
||||||
|
@ -732,25 +732,31 @@ alpha_ecoff_get_relocated_section_contents (bfd *abfd,
|
|||||||
{
|
{
|
||||||
bfd *input_bfd = link_order->u.indirect.section->owner;
|
bfd *input_bfd = link_order->u.indirect.section->owner;
|
||||||
asection *input_section = link_order->u.indirect.section;
|
asection *input_section = link_order->u.indirect.section;
|
||||||
long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
|
long reloc_size;
|
||||||
arelent **reloc_vector = NULL;
|
arelent **reloc_vector;
|
||||||
long reloc_count;
|
long reloc_count;
|
||||||
bfd *output_bfd = relocatable ? abfd : (bfd *) NULL;
|
bfd *output_bfd = relocatable ? abfd : (bfd *) NULL;
|
||||||
bfd_vma gp;
|
bfd_vma gp;
|
||||||
bfd_size_type sz;
|
|
||||||
bfd_boolean gp_undefined;
|
bfd_boolean gp_undefined;
|
||||||
bfd_vma stack[RELOC_STACKSIZE];
|
bfd_vma stack[RELOC_STACKSIZE];
|
||||||
int tos = 0;
|
int tos = 0;
|
||||||
|
|
||||||
|
reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
|
||||||
if (reloc_size < 0)
|
if (reloc_size < 0)
|
||||||
goto error_return;
|
return NULL;
|
||||||
reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
|
|
||||||
if (reloc_vector == NULL && reloc_size != 0)
|
|
||||||
goto error_return;
|
|
||||||
|
|
||||||
sz = input_section->rawsize ? input_section->rawsize : input_section->size;
|
if (!bfd_get_full_section_contents (input_bfd, input_section, &data))
|
||||||
if (! bfd_get_section_contents (input_bfd, input_section, data, 0, sz))
|
return NULL;
|
||||||
goto error_return;
|
|
||||||
|
if (data == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (reloc_size == 0)
|
||||||
|
return data;
|
||||||
|
|
||||||
|
reloc_vector = (arelent **) bfd_malloc (reloc_size);
|
||||||
|
if (reloc_vector == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
reloc_count = bfd_canonicalize_reloc (input_bfd, input_section,
|
reloc_count = bfd_canonicalize_reloc (input_bfd, input_section,
|
||||||
reloc_vector, symbols);
|
reloc_vector, symbols);
|
||||||
|
Reference in New Issue
Block a user