/* ECOFF debugging support.
- Copyright (C) 1993-2020 Free Software Foundation, Inc.
+ Copyright (C) 1993-2022 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file was put together by Ian Lance Taylor <ian@cygnus.com>. A
good deal of it comes directly from mips-tfile.c, by Michael
strcpy (hash_ptr->string, str);
- str_hash_insert (hash_tbl, str, (char *) hash_ptr);
+ if (str_hash_insert (hash_tbl, str, hash_ptr, 0) != NULL)
+ as_fatal (_("duplicate %s"), str);
}
if (ret_hash != (shash_t **) NULL)
perm = xstrdup (tag);
hash_ptr = allocate_shash ();
- str_hash_insert (tag_hash, perm, (char *) hash_ptr);
+ str_hash_insert (tag_hash, perm, hash_ptr, 0);
hash_ptr->string = perm;
}
{
(void) add_ecoff_symbol (file_name, st_Nil, sc_Nil,
symbol_new (FAKE_LABEL_NAME, now_seg,
- (valueT) frag_now_fix (),
- frag_now),
+ frag_now, frag_now_fix ()),
(bfd_vma) 0, 0, ECOFF_MARK_STAB (N_SOL));
return;
}
compiler output, only in hand coded assembler. */
void
-ecoff_new_file (const char *name, int appfile ATTRIBUTE_UNUSED)
+ecoff_new_file (const char *name)
{
if (cur_file_ptr != NULL && filename_cmp (cur_file_ptr->name, name) == 0)
return;
else
(void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text,
symbol_new (FAKE_LABEL_NAME, now_seg,
- (valueT) frag_now_fix (),
- frag_now),
+ frag_now, frag_now_fix ()),
(bfd_vma) 0, (symint_t) 0, (symint_t) 0);
#ifdef md_flush_pending_output
{
(void) add_ecoff_symbol ((char *) NULL, st_Label, sc_Text,
symbol_new (FAKE_LABEL_NAME, now_seg,
- (valueT) frag_now_fix (),
- frag_now),
+ frag_now, frag_now_fix ()),
(bfd_vma) 0, 0, lineno);
return;
}
cur_file_ptr = save_file_ptr;
}
\f
+static asection ecoff_scom_section;
+static const asymbol ecoff_scom_symbol =
+ GLOBAL_SYM_INIT (SCOMMON, &ecoff_scom_section);
+static asection ecoff_scom_section =
+ BFD_FAKE_SECTION (ecoff_scom_section, &ecoff_scom_symbol,
+ SCOMMON, 0, SEC_IS_COMMON | SEC_SMALL_DATA);
+
/* Frob an ECOFF symbol. Small common symbols go into a special
.scommon section rather than bfd_com_section. */
&& S_GET_VALUE (sym) > 0
&& S_GET_VALUE (sym) <= bfd_get_gp_size (stdoutput))
{
- static asection scom_section;
- static asymbol scom_symbol;
-
- /* We must construct a fake section similar to bfd_com_section
- but with the name .scommon. */
- if (scom_section.name == NULL)
- {
- scom_section = *bfd_com_section_ptr;
- scom_section.name = ".scommon";
- scom_section.output_section = &scom_section;
- scom_section.symbol = &scom_symbol;
- scom_section.symbol_ptr_ptr = &scom_section.symbol;
- scom_symbol = *bfd_com_section_ptr->symbol;
- scom_symbol.name = ".scommon";
- scom_symbol.section = &scom_section;
- }
- S_SET_SEGMENT (sym, &scom_section);
+ S_SET_SEGMENT (sym, &ecoff_scom_section);
}
/* Double check weak symbols. */