osprey-gcc-4.2.0/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 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 *, struct pex_obj *)
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 **)
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, FILE *to)
int main (int argc, char **argv)
int collect_wait (const char *prog, struct pex_obj *pex)
struct pex_objcollect_execute (const char *prog, char **argv, const char *outname, const char *errname)
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
const char * lderrout
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
static struct path_prefix cpath path
static long sequence_number = 0


Define Documentation

#define COLLECT

Definition at line 42 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 125 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 121 of file collect2.c.

#define DEFAULT_INIT_PRIORITY   65535

Definition at line 118 of file collect2.c.

#define LIBRARY_PATH_ENV   "LIBRARY_PATH"

Definition at line 39 of file collect2.c.

#define NAME__MAIN   "__main"

Definition at line 114 of file collect2.c.

#define NM_FLAGS   "-n"

Definition at line 105 of file collect2.c.

#define OBJECT_FORMAT_NONE

Definition at line 70 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 161 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]

struct pex_obj* collect_execute ( const char *  prog,
char **  argv,
const char *  outname,
const char *  errname 
) [read]

void collect_exit ( int  status  ) 

Definition at line 277 of file collect2.c.

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

int collect_wait ( const char *  prog,
struct pex_obj pex 
)

static void do_wait ( const char *  prog,
struct pex_obj pex 
) [static]

Definition at line 1508 of file collect2.c.

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

void dump_file ( const char *  name,
FILE to 
)

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

Definition at line 356 of file collect2.c.

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

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

Definition at line 1632 of file collect2.c.

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

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

Definition at line 410 of file collect2.c.

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

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

Definition at line 371 of file collect2.c.

References fatal().

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

Definition at line 340 of file collect2.c.

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

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

Definition at line 323 of file collect2.c.

References _, collect_exit(), errno, FATAL_EXIT_CODE, fprintf(), va_end, va_start, vfprintf(), and xstrerror().

int file_exists ( const char *  name  ) 

Definition at line 402 of file collect2.c.

References access, R_OK, S_ISREG, stat::st_mode, stat, and strlen().

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 1575 of file collect2.c.

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

static void handler ( int  signo  )  [static]

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

Definition at line 506 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 1586 of file collect2.c.

References debug, notice(), and unlink_if_ordinary().

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

Definition at line 311 of file collect2.c.

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

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

Definition at line 684 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 1649 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 1963 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 1690 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 1757 of file collect2.c.

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


Variable Documentation

const char* c_file [static]

Definition at line 182 of file collect2.c.

const char* c_file_name

Definition at line 195 of file collect2.c.

Definition at line 198 of file collect2.c.

int debug

Definition at line 178 of file collect2.c.

const char* demangle_flag [static]

Definition at line 171 of file collect2.c.

Definition at line 199 of file collect2.c.

int do_collecting = 0

Definition at line 136 of file collect2.c.

char * fininame [static]

Definition at line 196 of file collect2.c.

Definition at line 203 of file collect2.c.

char* initname [static]

Definition at line 196 of file collect2.c.

const char* lderrout

Definition at line 188 of file collect2.c.

Referenced by collect_exit(), do_tlink(), and main().

const char* ldout

Definition at line 187 of file collect2.c.

const char* nm_file_name [static]

Definition at line 190 of file collect2.c.

Definition at line 141 of file collect2.c.

const char* o_file [static]

Definition at line 183 of file collect2.c.

const char* output_file [static]

Definition at line 189 of file collect2.c.

Definition at line 554 of file collect2.c.

int rflag [static]

Definition at line 169 of file collect2.c.

long sequence_number = 0 [static]

Definition at line 1595 of file collect2.c.

int shared_obj [static]

Definition at line 180 of file collect2.c.

const char* strip_file_name [static]

Definition at line 194 of file collect2.c.

int strip_flag [static]

Definition at line 170 of file collect2.c.

Definition at line 206 of file collect2.c.

Definition at line 205 of file collect2.c.

int vflag

Definition at line 168 of file collect2.c.


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