/* subsegs.c - subsegments -
- Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
segment_info_type segment_info[SEG_MAXIMUM_ORDINAL];
#else
-/* Commented in "subsegs.h". */
+/* Commented in "subsegs.h". */
frchainS *data0_frchainP, *bss0_frchainP;
#endif /* MANY_SEGMENTS */
"transfert vector postload",
"register",
"",
-}; /* Used by error reporters, dumpers etc. */
+}; /* Used by error reporters, dumpers etc. */
#else /* BFD_ASSEMBLER */
/* Gas segment information for bfd_abs_section_ptr and
#endif
frchain_root = NULL;
- frchain_now = NULL; /* Warn new_subseg() that we are booting. */
+ frchain_now = NULL; /* Warn new_subseg() that we are booting. */
frag_now = &dummy_frag;
#ifndef BFD_ASSEMBLER
- now_subseg = 42; /* Lie for 1st call to subseg_new. */
+ now_subseg = 42; /* Lie for 1st call to subseg_new. */
#ifdef MANY_SEGMENTS
{
int i;
*/
if (!frcP
|| (frcP->frch_seg > seg
- || frcP->frch_subseg > subseg)) /* Kinky logic only works with 2 segments. */
+ || frcP->frch_subseg > subseg)) /* Kinky logic only works with 2 segments. */
{
/*
* This should be the only code that creates a frchainS.
seginfo->frchainP = newP;
}
#endif
-
+
frcP = newP;
}
/*
#endif /* BFD_ASSEMBLER */
+/* Return whether the specified segment is thought to hold text. */
+
+#ifndef BFD_ASSEMBLER
+const char * const nontext_section_names[] =
+{
+ ".eh_frame",
+ ".gcc_except_table",
+#ifdef OBJ_COFF
+#ifndef COFF_LONG_SECTION_NAMES
+ ".eh_fram",
+ ".gcc_exc",
+#endif
+#endif
+ NULL
+};
+#endif /* ! BFD_ASSEMBLER */
+
+int
+subseg_text_p (sec)
+ segT sec;
+{
+#ifdef BFD_ASSEMBLER
+ return (bfd_get_section_flags (stdoutput, sec) & SEC_CODE) != 0;
+#else /* ! BFD_ASSEMBLER */
+ const char * const *p;
+
+ if (sec == data_section || sec == bss_section)
+ return 0;
+
+ for (p = nontext_section_names; *p != NULL; ++p)
+ {
+ if (strcmp (segment_name (sec), *p) == 0)
+ return 0;
+
+#ifdef obj_segment_name
+ if (strcmp (obj_segment_name (sec), *p) == 0)
+ return 0;
+#endif
+ }
+
+ return 1;
+
+#endif /* ! BFD_ASSEMBLER */
+}
+
void
subsegs_print_statistics (file)
FILE *file;