This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

obj_coff vs section_hash



This was causing multiple .stabstr sections, which makes the cygwin
linker core.  Since we have no way of either checking for these cases
in subseg_get or letting the caller say whether the string should be
copied or not, perhaps we should (instead of this patch) be
conservative and pass "true" for the copy parameter in
section_hash_lookup in bfd/section.c?

2002-01-21  DJ Delorie  <dj@redhat.com>

	* config/obj-coff.c (obj_coff_init_stab_section): Make the
	stabstr_name allocation permanent, as it will be referenced from
	the section hash.

Index: config/obj-coff.c
===================================================================
RCS file: /cvs/uberbaum/gas/config/obj-coff.c,v
retrieving revision 1.54
diff -p -3 -r1.54 obj-coff.c
*** obj-coff.c	2001/11/15 21:28:54	1.54
--- obj-coff.c	2002/01/22 00:16:50
*************** obj_coff_init_stab_section (seg)
*** 1631,1637 ****
    /* Zero it out.  */
    memset (p, 0, 12);
    as_where (&file, (unsigned int *) NULL);
!   stabstr_name = (char *) alloca (strlen (seg->name) + 4);
    strcpy (stabstr_name, seg->name);
    strcat (stabstr_name, "str");
    stroff = get_stab_string_offset (file, stabstr_name);
--- 1631,1637 ----
    /* Zero it out.  */
    memset (p, 0, 12);
    as_where (&file, (unsigned int *) NULL);
!   stabstr_name = (char *) xmalloc (strlen (seg->name) + 4);
    strcpy (stabstr_name, seg->name);
    strcat (stabstr_name, "str");
    stroff = get_stab_string_offset (file, stabstr_name);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]