+
+/* Enumerations describing which pass this is for scanning the
+ program file ... */
+
+typedef enum {
+ PASS_FIRST, /* without constructors */
+ PASS_OBJ, /* individual objects */
+ PASS_LIB, /* looking for shared libraries */
+ PASS_SECOND /* with constructors linked in */
+} scanpass;
+
+/* ... and which kinds of symbols are to be considered. */
+
+enum scanfilter_masks {
+ SCAN_NOTHING = 0,
+
+ SCAN_CTOR = 1 << SYM_CTOR,
+ SCAN_DTOR = 1 << SYM_DTOR,
+ SCAN_INIT = 1 << SYM_INIT,
+ SCAN_FINI = 1 << SYM_FINI,
+ SCAN_DWEH = 1 << SYM_DWEH,
+ SCAN_ALL = ~0
+};
+
+/* This type is used for parameters and variables which hold
+ combinations of the flags in enum scanfilter_masks. */
+typedef int scanfilter;
+
+/* Scan the name list of the loaded program for the symbols g++ uses for
+ static constructors and destructors.
+
+ The SCANPASS argument tells which collect processing pass this is for and
+ the SCANFILTER argument tells which kinds of symbols to consider in this
+ pass. Symbols of a special kind not in the filter mask are considered as
+ regular ones.
+
+ The constructor table begins at __CTOR_LIST__ and contains a count of the
+ number of pointers (or -1 if the constructors are built in a separate
+ section by the linker), followed by the pointers to the constructor
+ functions, terminated with a null pointer. The destructor table has the
+ same format, and begins at __DTOR_LIST__. */
+
+static void scan_prog_file (const char *, scanpass, scanfilter);
+