mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 17:18:24 +08:00
Tue Apr 12 18:25:13 1994 Stan Shebs (shebs@andros.cygnus.com)
* subsegs.c (subsegs_begin): Call memset with args in the correct order. (subseg_get): Clear newly allocated seginfo, set its pointer slots to NULL instead of 0. Fixes a problem observed in sparc-lynx progressive.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
Tue Apr 12 18:25:13 1994 Stan Shebs (shebs@andros.cygnus.com)
|
||||||
|
|
||||||
|
* subsegs.c (subsegs_begin): Call memset with args in the correct
|
||||||
|
order.
|
||||||
|
(subseg_get): Clear newly allocated seginfo, set its pointer slots
|
||||||
|
to NULL instead of 0.
|
||||||
|
|
||||||
Mon Apr 11 09:00:57 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
|
Mon Apr 11 09:00:57 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
|
||||||
|
|
||||||
* config/tc-hppa.c (pa_procend): Handle case where label was
|
* config/tc-hppa.c (pa_procend): Handle case where label was
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/* subsegs.c - subsegments -
|
/* subsegs.c - subsegments -
|
||||||
Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
|
Copyright (C) 1987, 1990, 1991, 1992, 1993, 1994
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GAS, the GNU Assembler.
|
This file is part of GAS, the GNU Assembler.
|
||||||
|
|
||||||
@ -85,7 +86,7 @@ subsegs_begin ()
|
|||||||
/* Fake up 1st frag. It won't be used=> is ok if obstack...
|
/* Fake up 1st frag. It won't be used=> is ok if obstack...
|
||||||
pads the end of it for alignment. */
|
pads the end of it for alignment. */
|
||||||
frag_now = (fragS *) obstack_alloc (&frags, SIZEOF_STRUCT_FRAG);
|
frag_now = (fragS *) obstack_alloc (&frags, SIZEOF_STRUCT_FRAG);
|
||||||
memset (frag_now, SIZEOF_STRUCT_FRAG, 0);
|
memset (frag_now, 0, SIZEOF_STRUCT_FRAG);
|
||||||
|
|
||||||
#ifndef BFD_ASSEMBLER
|
#ifndef BFD_ASSEMBLER
|
||||||
/* This 1st frag will not be in any frchain.
|
/* This 1st frag will not be in any frchain.
|
||||||
@ -140,7 +141,6 @@ subseg_change (seg, subseg)
|
|||||||
if (! seginfo)
|
if (! seginfo)
|
||||||
abort ();
|
abort ();
|
||||||
seginfo->fix_root = 0;
|
seginfo->fix_root = 0;
|
||||||
seginfo->fix_tail = 0;
|
|
||||||
seginfo->bfd_section = seg;
|
seginfo->bfd_section = seg;
|
||||||
seginfo->sym = 0;
|
seginfo->sym = 0;
|
||||||
bfd_set_section_userdata (stdoutput, seg, (char *) seginfo);
|
bfd_set_section_userdata (stdoutput, seg, (char *) seginfo);
|
||||||
@ -249,7 +249,7 @@ subseg_set_rest (seg, subseg)
|
|||||||
* This should be the only code that creates a frchainS.
|
* This should be the only code that creates a frchainS.
|
||||||
*/
|
*/
|
||||||
newP = (frchainS *) obstack_alloc (&frags, sizeof (frchainS));
|
newP = (frchainS *) obstack_alloc (&frags, sizeof (frchainS));
|
||||||
memset (newP, sizeof (frchainS), 0);
|
memset (newP, 0, sizeof (frchainS));
|
||||||
/* This begines on a good boundary because a obstack_done()
|
/* This begines on a good boundary because a obstack_done()
|
||||||
preceeded it. It implies an obstack_done(), so we expect
|
preceeded it. It implies an obstack_done(), so we expect
|
||||||
the next object allocated to begin on a correct boundary. */
|
the next object allocated to begin on a correct boundary. */
|
||||||
@ -258,6 +258,10 @@ subseg_set_rest (seg, subseg)
|
|||||||
(frcP = newP)->frch_subseg = subseg;
|
(frcP = newP)->frch_subseg = subseg;
|
||||||
newP->frch_seg = seg;
|
newP->frch_seg = seg;
|
||||||
newP->frch_last = NULL;
|
newP->frch_last = NULL;
|
||||||
|
#ifdef BFD_ASSEMBLER
|
||||||
|
newP->fix_root = NULL;
|
||||||
|
newP->fix_tail = NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Here with frcP ->ing to the frchainS for subseg.
|
* Here with frcP ->ing to the frchainS for subseg.
|
||||||
@ -400,17 +404,14 @@ subseg_get (segname, force_new)
|
|||||||
{
|
{
|
||||||
secptr->output_section = secptr;
|
secptr->output_section = secptr;
|
||||||
seginfo = (segment_info_type *) xmalloc (sizeof (*seginfo));
|
seginfo = (segment_info_type *) xmalloc (sizeof (*seginfo));
|
||||||
seginfo->fix_root = 0;
|
memset ((char *) seginfo, 0, sizeof(seginfo));
|
||||||
seginfo->fix_tail = 0;
|
seginfo->fix_root = NULL;
|
||||||
seginfo->bfd_section = secptr;
|
seginfo->bfd_section = secptr;
|
||||||
bfd_set_section_userdata (stdoutput, secptr, (char *) seginfo);
|
bfd_set_section_userdata (stdoutput, secptr, (char *) seginfo);
|
||||||
seginfo->frchainP = 0;
|
seginfo->frchainP = NULL;
|
||||||
seginfo->lineno_list_head = seginfo->lineno_list_tail = 0;
|
seginfo->lineno_list_head = seginfo->lineno_list_tail = NULL;
|
||||||
seginfo->sym = 0;
|
seginfo->sym = NULL;
|
||||||
seginfo->dot = 0;
|
seginfo->dot = NULL;
|
||||||
seginfo->hadone = 0;
|
|
||||||
seginfo->user_stuff = 0;
|
|
||||||
seginfo->stabu.stab_string_size = 0;
|
|
||||||
}
|
}
|
||||||
return secptr;
|
return secptr;
|
||||||
}
|
}
|
||||||
@ -458,23 +459,33 @@ subseg_set (secptr, subseg)
|
|||||||
subseg_set_rest (secptr, subseg);
|
subseg_set_rest (secptr, subseg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef obj_sec_sym_ok_for_reloc
|
||||||
|
#define obj_sec_sym_ok_for_reloc(SEC) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
symbolS *
|
symbolS *
|
||||||
section_symbol (sec)
|
section_symbol (sec)
|
||||||
segT sec;
|
segT sec;
|
||||||
{
|
{
|
||||||
segment_info_type *seginfo = seg_info (sec);
|
segment_info_type *seginfo = seg_info (sec);
|
||||||
|
symbolS *s;
|
||||||
|
|
||||||
if (seginfo == 0)
|
if (seginfo == 0)
|
||||||
abort ();
|
abort ();
|
||||||
if (seginfo->sym)
|
if (seginfo->sym)
|
||||||
return seginfo->sym;
|
return seginfo->sym;
|
||||||
seginfo->sym = symbol_find (sec->name);
|
s = symbol_find (sec->name);
|
||||||
if (!seginfo->sym)
|
if (!s)
|
||||||
{
|
{
|
||||||
seginfo->sym = symbol_make (sec->name);
|
s = symbol_new (sec->name, sec, 0, &zero_address_frag);
|
||||||
seginfo->sym->bsym = sec->symbol;
|
S_CLEAR_EXTERNAL (s);
|
||||||
|
|
||||||
|
/* Use the BFD section symbol, if possible. */
|
||||||
|
if (obj_sec_sym_ok_for_reloc (sec))
|
||||||
|
s->bsym = sec->symbol;
|
||||||
}
|
}
|
||||||
return seginfo->sym;
|
seginfo->sym = s;
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* BFD_ASSEMBLER */
|
#endif /* BFD_ASSEMBLER */
|
||||||
|
Reference in New Issue
Block a user