+
+#ifndef EMIT_SECTION_SYMBOLS
+#define EMIT_SECTION_SYMBOLS 1
+#endif
+
+ if (! EMIT_SECTION_SYMBOLS || symbol_table_frozen)
+ {
+ /* Here we know it won't be going into the symbol table. */
+ s = symbol_create (sec->symbol->name, sec, 0, &zero_address_frag);
+ }
+ else
+ {
+ segT seg;
+ s = symbol_find (sec->symbol->name);
+ /* We have to make sure it is the right symbol when we
+ have multiple sections with the same section name. */
+ if (s == NULL
+ || ((seg = S_GET_SEGMENT (s)) != sec
+ && seg != undefined_section))
+ s = symbol_new (sec->symbol->name, sec, 0, &zero_address_frag);
+ else if (seg == undefined_section)
+ {
+ S_SET_SEGMENT (s, sec);
+ symbol_set_frag (s, &zero_address_frag);
+ }
+ }
+
+ S_CLEAR_EXTERNAL (s);
+
+ /* Use the BFD section symbol, if possible. */
+ if (obj_sec_sym_ok_for_reloc (sec))
+ symbol_set_bfdsym (s, sec->symbol);
+ else
+ symbol_get_bfdsym (s)->flags |= BSF_SECTION_SYM;
+
+ seginfo->sym = s;
+ return s;
+}
+
+/* Return whether the specified segment is thought to hold text. */
+
+int
+subseg_text_p (segT sec)
+{
+ return (bfd_get_section_flags (stdoutput, sec) & SEC_CODE) != 0;
+}
+
+/* Return non zero if SEC has at least one byte of data. It is
+ possible that we'll return zero even on a non-empty section because
+ we don't know all the fragment types, and it is possible that an
+ fr_fix == 0 one still contributes data. Think of this as
+ seg_definitely_not_empty_p. */
+
+int
+seg_not_empty_p (segT sec ATTRIBUTE_UNUSED)
+{
+ segment_info_type *seginfo = seg_info (sec);
+ frchainS *chain;
+ fragS *frag;
+
+ if (!seginfo)
+ return 0;
+
+ for (chain = seginfo->frchainP; chain; chain = chain->frch_next)