mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-06 23:50:09 +08:00
Remove use of a GCC extension when allocating local arrays.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2000-01-24 Robert Lipe (robertl@sco.com)
|
||||||
|
|
||||||
|
* coffcode.h (coff_write_object_contents): Get buff via bfd_malloc
|
||||||
|
instead of using GNU C extension.
|
||||||
|
|
||||||
2000-01-21 Nick Clifton <nickc@cygnus.com>
|
2000-01-21 Nick Clifton <nickc@cygnus.com>
|
||||||
|
|
||||||
* libbfd.c (bfd_read): Do not attempt to get a negativly sized
|
* libbfd.c (bfd_read): Do not attempt to get a negativly sized
|
||||||
|
@ -3680,20 +3680,41 @@ coff_write_object_contents (abfd)
|
|||||||
/* now write them */
|
/* now write them */
|
||||||
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
|
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
{
|
{
|
||||||
char buff[bfd_coff_filhsz (abfd)];
|
char * buff;
|
||||||
|
bfd_size_type amount;
|
||||||
|
|
||||||
|
buff = bfd_malloc (bfd_coff_filhsz (abfd));
|
||||||
|
if (buff == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
coff_swap_filehdr_out (abfd, (PTR) & internal_f, (PTR) buff);
|
coff_swap_filehdr_out (abfd, (PTR) & internal_f, (PTR) buff);
|
||||||
if (bfd_write ((PTR) buff, 1, bfd_coff_filhsz (abfd), abfd)
|
amount = bfd_write ((PTR) buff, 1, bfd_coff_filhsz (abfd), abfd);
|
||||||
!= bfd_coff_filhsz (abfd))
|
|
||||||
|
free (buff);
|
||||||
|
|
||||||
|
if (amount != bfd_coff_filhsz (abfd))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abfd->flags & EXEC_P)
|
if (abfd->flags & EXEC_P)
|
||||||
{
|
{
|
||||||
/* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR.
|
/* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR.
|
||||||
include/coff/pe.h sets AOUTSZ == sizeof(PEAOUTHDR)) */
|
include/coff/pe.h sets AOUTSZ == sizeof(PEAOUTHDR)) */
|
||||||
char buff[bfd_coff_aoutsz (abfd)];
|
char * buff;
|
||||||
|
bfd_size_type amount;
|
||||||
|
|
||||||
|
buff = bfd_malloc (bfd_coff_aoutsz (abfd));
|
||||||
|
if (buff == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
coff_swap_aouthdr_out (abfd, (PTR) & internal_a, (PTR) buff);
|
coff_swap_aouthdr_out (abfd, (PTR) & internal_a, (PTR) buff);
|
||||||
if (bfd_write ((PTR) buff, 1, bfd_coff_aoutsz (abfd), abfd) != bfd_coff_aoutsz (abfd))
|
amount = bfd_write ((PTR) buff, 1, bfd_coff_aoutsz (abfd), abfd);
|
||||||
|
|
||||||
|
free (buff);
|
||||||
|
|
||||||
|
if (amount != bfd_coff_aoutsz (abfd))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#ifdef RS6000COFF_C
|
#ifdef RS6000COFF_C
|
||||||
|
Reference in New Issue
Block a user