osprey-gcc/gcc/collect2.c File Reference

#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include <signal.h>
#include "collect2.h"
#include "demangle.h"
#include "obstack.h"
#include "intl.h"
#include "version.h"

Include dependency graph for collect2.c:

Go to the source code of this file.

Data Types

type  id
type  head
type  prefix_list
type  path_prefix

Defines

#define VFORK_STRING   "vfork"
#define LIBRARY_PATH_ENV   "LIBRARY_PATH"
#define COLLECT
#define OBJECT_FORMAT_NONE
#define NM_FLAGS   "-n"
#define NAME__MAIN   "__main"
#define DEFAULT_INIT_PRIORITY   65535
#define COLLECT_SHARED_INIT_FUNC(STREAM, FUNC)   fprintf ((STREAM), "void _GLOBAL__DI() {\n\t%s();\n}\n", (FUNC))
#define COLLECT_SHARED_FINI_FUNC(STREAM, FUNC)   fprintf ((STREAM), "void _GLOBAL__DD() {\n\t%s();\n}\n", (FUNC))

Enumerations

enum  pass {
  PASS_FIRST, PASS_OBJ, PASS_LIB, PASS_SECOND,
  PASS_FIRST, PASS_OBJ, PASS_LIB, PASS_SECOND,
  PASS_FIRST, PASS_OBJ, PASS_LIB, PASS_SECOND,
  PASS_FIRST, PASS_OBJ, PASS_LIB, PASS_SECOND
}

Functions/Subroutines

static void handler (int)
static int is_ctor_dtor (const char *)
static char * find_a_file (struct path_prefix *, const char *)
static void add_prefix (struct path_prefix *, const char *)
static void prefix_from_env (const char *, struct path_prefix *)
static void prefix_from_string (const char *, struct path_prefix *)
static void do_wait (const char *)
static void fork_execute (const char *, char **)
static void maybe_unlink (const char *)
static void add_to_list (struct head *, const char *)
static int extract_init_priority (const char *)
static void sort_ids (struct head *)
static void write_list (FILE *, const char *, struct id *)
static void write_list_with_asm (FILE *, const char *, struct id *)
static void write_c_file (FILE *, const char *)
static void write_c_file_stat (FILE *, const char *)
static void write_c_file_glob (FILE *, const char *)
static void scan_prog_file (const char *, enum pass)
static char * extract_string (const char **)
static int dup2 (int oldfd, int newfd)
void collect_exit (int status)
void notice (const char *cmsgid,...)
void fatal_perror (const char *cmsgid,...)
void fatal (const char *cmsgid,...)
void error (const char *gmsgid,...)
void fancy_abort (const char *file, int line, const char *func)
int file_exists (const char *name)
void dump_file (const char *name)
int main (int argc, char **argv)
int collect_wait (const char *prog)
void collect_execute (const char *prog, char **argv, const char *redir)
static void write_c_file_stat (FILE *stream, const char *name ATTRIBUTE_UNUSED)
static void write_c_file_glob (FILE *stream, const char *name ATTRIBUTE_UNUSED)

Variables

int do_collecting = 0
int no_demangle
int vflag
static int rflag
static int strip_flag
static const char * demangle_flag
int debug
static int shared_obj
static const char * c_file
static const char * o_file
const char * ldout
static const char * output_file
static const char * nm_file_name
static const char * strip_file_name
const char * c_file_name
static char * initname
static char * fininame
static struct head constructors
static struct head destructors
static struct head frame_tables
struct obstack temporary_obstack
char * temporary_firstobj
int pid
static struct path_prefix cpath path
static long sequence_number = 0


Define Documentation

#define COLLECT

Definition at line 55 of file collect2.c.

#define COLLECT_SHARED_FINI_FUNC ( STREAM,
FUNC   )     fprintf ((STREAM), "void _GLOBAL__DD() {\n\t%s();\n}\n", (FUNC))

Definition at line 138 of file collect2.c.

#define COLLECT_SHARED_INIT_FUNC ( STREAM,
FUNC   )     fprintf ((STREAM), "void _GLOBAL__DI() {\n\t%s();\n}\n", (FUNC))

Definition at line 134 of file collect2.c.

#define DEFAULT_INIT_PRIORITY   65535

Definition at line 131 of file collect2.c.

#define LIBRARY_PATH_ENV   "LIBRARY_PATH"

Definition at line 52 of file collect2.c.

#define NAME__MAIN   "__main"

Definition at line 127 of file collect2.c.

#define NM_FLAGS   "-n"

Definition at line 118 of file collect2.c.

#define OBJECT_FORMAT_NONE

Definition at line 83 of file collect2.c.

#define VFORK_STRING   "vfork"

Definition at line 41 of file collect2.c.


Enumeration Type Documentation

enum pass

Enumerator:
PASS_FIRST 
PASS_OBJ 
PASS_LIB 
PASS_SECOND 
PASS_FIRST 
PASS_OBJ 
PASS_LIB 
PASS_SECOND 
PASS_FIRST 
PASS_OBJ 
PASS_LIB 
PASS_SECOND 
PASS_FIRST 
PASS_OBJ 
PASS_LIB 
PASS_SECOND 

Definition at line 174 of file collect2.c.


Function Documentation

static void add_prefix ( struct path_prefix pprefix,
const char *  prefix 
) [static]

static void add_to_list ( struct head head_ptr,
const char *  name 
) [static]

void collect_execute ( const char *  prog,
char **  argv,
const char *  redir 
)

void collect_exit ( int  status  ) 

Definition at line 312 of file collect2.c.

References c_file, dump_file, exit(), ldout, maybe_unlink(), and o_file.

int collect_wait ( const char *  prog  ) 

static void do_wait ( const char *  prog  )  [static]

Definition at line 1530 of file collect2.c.

References collect_exit(), collect_wait(), error(), and ret.

void dump_file ( const char *  name  ) 

static int dup2 ( int  oldfd,
int  newfd 
) [static]

Definition at line 291 of file collect2.c.

References close, dup(), and fd.

void error ( const char *  gmsgid,
  ... 
)

Definition at line 385 of file collect2.c.

References _, fprintf(), va_end, va_start, and vfprintf().

static int extract_init_priority ( const char *  name  )  [static]

Definition at line 1669 of file collect2.c.

References atoi(), DEFAULT_INIT_PRIORITY, and pos().

static char * extract_string ( const char **  pp  )  [static]

Definition at line 436 of file collect2.c.

References c, obstack_1grow, obstack_finish, p, and temporary_obstack.

void fancy_abort ( const char *  file,
int  line,
const char *  func 
)

Definition at line 400 of file collect2.c.

void fatal ( const char *  cmsgid,
  ... 
)

void fatal_perror ( const char *  cmsgid,
  ... 
)

Definition at line 352 of file collect2.c.

Referenced by collect_execute(), collect_wait(), main(), recompile_files(), and scan_prog_file().

int file_exists ( const char *  name  ) 

Definition at line 428 of file collect2.c.

References access, and R_OK.

static char * find_a_file ( struct path_prefix pprefix,
const char *  name 
) [static]

static void fork_execute ( const char *  prog,
char **  argv 
) [static]

Definition at line 1614 of file collect2.c.

References collect_execute(), do_wait(), and NULL.

static void handler ( int  signo  )  [static]

Definition at line 951 of file run.c.

static int is_ctor_dtor ( const char *  s  )  [static]

Definition at line 532 of file collect2.c.

References len, names, NO_DOT_IN_LABEL, NULL, p, ret, and strncmp().

int main ( int argc  ,
char **  argv 
)

static void maybe_unlink ( const char *  file  )  [static]

Definition at line 1623 of file collect2.c.

References debug, notice(), and unlink.

void notice ( const char *  cmsgid,
  ... 
)

Definition at line 340 of file collect2.c.

static void prefix_from_env ( const char *  env,
struct path_prefix pprefix 
) [static]

Definition at line 710 of file collect2.c.

References GET_ENVIRONMENT, and prefix_from_string().

static void prefix_from_string ( const char *  p,
struct path_prefix pprefix 
) [static]

static void scan_prog_file ( const char *  prog_name,
enum pass  which_pass 
) [static]

static void sort_ids ( struct head head_ptr  )  [static]

Definition at line 1686 of file collect2.c.

References extract_init_priority(), head::first, id::name, id::next, NULL, and id::sequence.

static void write_c_file ( FILE stream,
const char *  name 
) [static]

Definition at line 2000 of file collect2.c.

References fprintf(), shared_obj, write_c_file_glob(), and write_c_file_stat().

static void write_c_file_glob ( FILE stream,
const char *name  ATTRIBUTE_UNUSED 
) [static]

static void write_c_file_glob ( FILE ,
const char *   
) [static]

static void write_c_file_stat ( FILE stream,
const char *name  ATTRIBUTE_UNUSED 
) [static]

static void write_c_file_stat ( FILE ,
const char *   
) [static]

static void write_list ( FILE stream,
const char *  prefix,
struct id list 
) [static]

Definition at line 1727 of file collect2.c.

References fprintf(), id::next, and id::sequence.

static void write_list_with_asm ( FILE stream,
const char *  prefix,
struct id list 
) [static]

Definition at line 1794 of file collect2.c.

References fprintf(), id::name, id::next, and id::sequence.


Variable Documentation

const char* c_file [static]

Definition at line 195 of file collect2.c.

const char* c_file_name

Definition at line 207 of file collect2.c.

Definition at line 210 of file collect2.c.

int debug

Definition at line 191 of file collect2.c.

const char* demangle_flag [static]

Definition at line 184 of file collect2.c.

Referenced by main().

Definition at line 211 of file collect2.c.

int do_collecting = 0

Definition at line 149 of file collect2.c.

char * fininame [static]

Definition at line 208 of file collect2.c.

Definition at line 215 of file collect2.c.

char* initname [static]

Definition at line 208 of file collect2.c.

const char* ldout

Definition at line 200 of file collect2.c.

const char* nm_file_name [static]

Definition at line 202 of file collect2.c.

Definition at line 154 of file collect2.c.

const char* o_file [static]

Definition at line 196 of file collect2.c.

const char* output_file [static]

Definition at line 201 of file collect2.c.

Definition at line 580 of file collect2.c.

int pid

int rflag [static]

Definition at line 182 of file collect2.c.

long sequence_number = 0 [static]

Definition at line 1632 of file collect2.c.

int shared_obj [static]

Definition at line 193 of file collect2.c.

const char* strip_file_name [static]

Definition at line 206 of file collect2.c.

int strip_flag [static]

Definition at line 183 of file collect2.c.

Definition at line 218 of file collect2.c.

Definition at line 217 of file collect2.c.

int vflag

Definition at line 181 of file collect2.c.


Generated on Wed Apr 8 15:13:43 2009 for Open64 by  doxygen 1.5.6