mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 20:28:28 +08:00
aoutx.h (aout_<bits>_swap_exec_header_in): Zero out the internal_exec
structure before initializing the fields that are used, so that the unused fields are in a known state. Two of these structures are memcmp'd so any fields not explicitly initialized must be set to a known state.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Thu Apr 23 18:37:55 1992 Fred Fish (fnf@cygnus.com)
|
||||||
|
|
||||||
|
* aoutx.h (aout_<bits>_swap_exec_header_in): Zero out the
|
||||||
|
internal_exec structure before initializing the fields that
|
||||||
|
are used, so that the unused fields are in a known state.
|
||||||
|
|
||||||
Wed Apr 22 09:36:08 1992 Fred Fish (fnf@cygnus.com)
|
Wed Apr 22 09:36:08 1992 Fred Fish (fnf@cygnus.com)
|
||||||
|
|
||||||
* tekhex.c (struct data_struct): Convert from typedef that
|
* tekhex.c (struct data_struct): Convert from typedef that
|
||||||
|
10
bfd/aoutx.h
10
bfd/aoutx.h
@ -222,6 +222,11 @@ DEFUN(NAME(aout,swap_exec_header_in),(abfd, raw_bytes, execp),
|
|||||||
{
|
{
|
||||||
struct external_exec *bytes = (struct external_exec *)raw_bytes;
|
struct external_exec *bytes = (struct external_exec *)raw_bytes;
|
||||||
|
|
||||||
|
/* The internal_exec structure has some fields that are unused in this
|
||||||
|
configuration (IE for i960), so ensure that all such uninitialized
|
||||||
|
fields are zero'd out. There are places where two of these structs
|
||||||
|
are memcmp'd, and thus the contents do matter. */
|
||||||
|
memset (execp, 0, sizeof (struct internal_exec));
|
||||||
/* Now fill in fields in the execp, from the bytes in the raw data. */
|
/* Now fill in fields in the execp, from the bytes in the raw data. */
|
||||||
execp->a_info = bfd_h_get_32 (abfd, bytes->e_info);
|
execp->a_info = bfd_h_get_32 (abfd, bytes->e_info);
|
||||||
execp->a_text = GET_WORD (abfd, bytes->e_text);
|
execp->a_text = GET_WORD (abfd, bytes->e_text);
|
||||||
@ -677,7 +682,7 @@ boolean
|
|||||||
if (abfd->flags & (D_PAGED|WP_TEXT))
|
if (abfd->flags & (D_PAGED|WP_TEXT))
|
||||||
{
|
{
|
||||||
bfd_size_type text_pad =
|
bfd_size_type text_pad =
|
||||||
BFD_ALIGN(text_size, adata(abfd).segment_size)
|
BFD_ALIGN(text_size, adata(abfd).page_size)
|
||||||
- text_size;
|
- text_size;
|
||||||
text_end += text_pad;
|
text_end += text_pad;
|
||||||
obj_textsec(abfd)->_raw_size += text_pad;
|
obj_textsec(abfd)->_raw_size += text_pad;
|
||||||
@ -1687,7 +1692,8 @@ DEFUN(NAME(aout,print_symbol),(ignore_abfd, afile, symbol, how),
|
|||||||
|
|
||||||
if (section_code == 'U')
|
if (section_code == 'U')
|
||||||
fprintf(file, " ");
|
fprintf(file, " ");
|
||||||
fprintf_vma(file, symbol->value+symbol->section->vma);
|
else
|
||||||
|
fprintf_vma(file, symbol->value+symbol->section->vma);
|
||||||
if (section_code == '?')
|
if (section_code == '?')
|
||||||
{
|
{
|
||||||
int type_code = aout_symbol(symbol)->type & 0xff;
|
int type_code = aout_symbol(symbol)->type & 0xff;
|
||||||
|
Reference in New Issue
Block a user