(laying some groundwork for a fix for PR 8443)

* coffread.c (record_minimal_symbol): Don't presave name string
	on symbol_obstack before passing to prim_record_minimal_symbol.
	It now handles saving the string itself.
	* dbxread.c (read_dbx_dynamic_symtab): Ditto.
	* mipsread.c (read_alphacoff_dynamic_symtab): Ditto.
	* os9kread.c (record_minimal_symbol): Ditto.
	* solib.c (solib_add_common_symbols): Ditto.

	* coffread.c (coff_symtab_read): Don't presave name string on
	symbol_obstack before passing to prim_record_minimal_symbol_and_info.
	It now handles saving the string itself.
	* dbxread.c (record_minimal_symbol): Ditto.
	* elfread.c (record_minimal_symbol_and_info): Ditto.

	* dstread.c (record_minimal_symbol): Remove static function that just
	called prim_record_minimal_symbol with the same args (after change to
 	prim_record_minimal_symbol to do it's own name string saves).
	* nlmread.c (record_minimal_symbol): Ditto.
	* somread.c (record_minimal_symbol): Ditto.

	* hpread.c (hpread_read_enum_type): Save symbol name on symbol obstack.
	(hpread_read_function_type): Ditto.
	(hpread_process_one_debug_symbol): Ditto.
	* mdebugread.c (parse_symbol): Ditto.
	(new_symbol): Ditto.
	* minsyms.c (prim_record_minimal_symbol_and_info): Ditto.

	* coffread.c (process_coff_symbol): Use obsavestring to save
	SYMBOL_NAME, rather than obstack_copy0.
	* dstread.c (create_new_symbol): Ditto
	* symfile.c (obconcat): Ditto.
	* stabsread.c (patch_block_stabs): Ditto.
	* xcoffread.c (SYMNAME_ALLOC): Ditto.

	* symfile.c (obsavestring): Update comments
	* solib.c (solib_add_common_symbols): Remove local var origname.
This commit is contained in:
Fred Fish 1996-07-08 09:05:18 +00:00
parent b7cc3e7530
commit ace4b8d75a
14 changed files with 97 additions and 100 deletions

View file

@ -224,9 +224,10 @@ sort_symtab_syms (s)
}
}
/* Make a copy of the string at PTR with SIZE characters in the symbol obstack
(and add a null character at the end in the copy).
Returns the address of the copy. */
/* Make a null terminated copy of the string at PTR with SIZE characters in
the obstack pointed to by OBSTACKP . Returns the address of the copy.
Note that the string at PTR does not have to be null terminated, I.E. it
may be part of a larger string and we are only saving a substring. */
char *
obsavestring (ptr, size, obstackp)
@ -235,8 +236,9 @@ obsavestring (ptr, size, obstackp)
struct obstack *obstackp;
{
register char *p = (char *) obstack_alloc (obstackp, size + 1);
/* Open-coded memcpy--saves function call time.
These strings are usually short. */
/* Open-coded memcpy--saves function call time. These strings are usually
short. FIXME: Is this really still true with a compiler that can
inline memcpy? */
{
register char *p1 = ptr;
register char *p2 = p;
@ -248,8 +250,8 @@ obsavestring (ptr, size, obstackp)
return p;
}
/* Concatenate strings S1, S2 and S3; return the new string.
Space is found in the symbol_obstack. */
/* Concatenate strings S1, S2 and S3; return the new string. Space is found
in the obstack pointed to by OBSTACKP. */
char *
obconcat (obstackp, s1, s2, s3)