* elf.c (elfcore_write_note): Don't use sizeof(Elf_External_note)

since some ABIs round up the size of the struct.
This commit is contained in:
Alan Modra 2003-09-19 02:08:35 +00:00
parent fdeb2c9fb7
commit 5de3bf9096
2 changed files with 11 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2003-09-19 Alan Modra <amodra@bigpond.net.au>
* elf.c (elfcore_write_note): Don't use sizeof(Elf_External_note)
since some ABIs round up the size of the struct.
2003-09-18 H.J. Lu <hongjiu.lu@intel.com> 2003-09-18 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (_bfd_elf_merge_symbol): Allow type change if * elflink.c (_bfd_elf_merge_symbol): Allow type change if
@ -136,7 +141,7 @@
2003-08-23 Jason Eckhardt <jle@rice.edu> 2003-08-23 Jason Eckhardt <jle@rice.edu>
* coff-i860.c (coff_i860_reloc_nyi): New function. * coff-i860.c (coff_i860_reloc_nyi): New function.
(howto_table): Add entries for relocations PAIR, HIGHADJ, HIGH, (howto_table): Add entries for relocations PAIR, HIGHADJ, HIGH,
LOWn, SPLITn, and BRADDR. LOWn, SPLITn, and BRADDR.
(RTYPE2HOWTO): Check that the r_type is within the howto_table (RTYPE2HOWTO): Check that the r_type is within the howto_table

View file

@ -7066,7 +7066,7 @@ elfcore_write_note (bfd *abfd,
pad = -namesz & ((1 << bed->s->log_file_align) - 1); pad = -namesz & ((1 << bed->s->log_file_align) - 1);
} }
newspace = sizeof (Elf_External_Note) - 1 + namesz + pad + size; newspace = 12 + namesz + pad + size;
p = realloc (buf, *bufsiz + newspace); p = realloc (buf, *bufsiz + newspace);
dest = p + *bufsiz; dest = p + *bufsiz;