+
+/* Fill in the counts in the first entry in a .stabs section. */
+
+static void
+adjust_stab_sections (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
+{
+ asection *strsec;
+ char *p;
+ int strsz, nsyms;
+
+ if (strcmp ("$GDB_SYMBOLS$", sec->name))
+ return;
+
+ strsec = bfd_get_section_by_name (abfd, "$GDB_STRINGS$");
+ if (strsec)
+ strsz = bfd_section_size (strsec);
+ else
+ strsz = 0;
+ nsyms = bfd_section_size (sec) / 12 - 1;
+
+ p = seg_info (sec)->stabu.p;
+ gas_assert (p != 0);
+
+ bfd_h_put_16 (abfd, (bfd_vma) nsyms, (bfd_byte *) p + 6);
+ bfd_h_put_32 (abfd, (bfd_vma) strsz, (bfd_byte *) p + 8);
+}
+
+/* Called late in the assembly phase to adjust the special
+ stab entry and to set the starting address for each code subspace. */
+
+void
+som_frob_file (void)
+{
+ bfd_map_over_sections (stdoutput, adjust_stab_sections, (void *) 0);
+}
+
+static void
+obj_som_weak (int ignore ATTRIBUTE_UNUSED)
+{
+ char *name;
+ int c;
+ symbolS *symbolP;
+
+ do
+ {
+ c = get_symbol_name (&name);
+ symbolP = symbol_find_or_make (name);
+ *input_line_pointer = c;
+ SKIP_WHITESPACE_AFTER_NAME ();
+ S_SET_WEAK (symbolP);
+ if (c == ',')
+ {
+ input_line_pointer++;
+ SKIP_WHITESPACE ();
+ if (*input_line_pointer == '\n')
+ c = '\n';
+ }
+ }
+ while (c == ',');
+ demand_empty_rest_of_line ();
+}
+
+const pseudo_typeS obj_pseudo_table[] =
+{
+ {"weak", obj_som_weak, 0},
+ {NULL, NULL, 0}
+};