osprey/kg++fe/gnu/collect2.c File Reference

#include "config.h"
#include "system.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 PARAMS ((int))
static int is_ctor_dtor PARAMS ((const char *))
static char *find_a_file PARAMS ((struct path_prefix *, const char *))
static void prefix_from_env PARAMS ((const char *, struct path_prefix *))
static void fork_execute PARAMS ((const char *, char **))
static void add_to_list PARAMS ((struct head *, const char *))
static void sort_ids PARAMS ((struct head *))
static void write_list PARAMS ((FILE *, const char *, struct id *))
static void write_c_file PARAMS ((FILE *, const char *))
static void scan_prog_file PARAMS ((const char *, enum pass))
static char *extract_string PARAMS ((const char **))
static int dup2 PARAMS ((int, int))
static int dup2 (int oldfd, int newfd)
void collect_exit (int status)
void notice VPARAMS ((const char *msgid,...))
void fancy_abort ()
static void handler (int signo)
int file_exists (char *name) const
static char * extract_string (char **pp) const
void dump_file (char *name) const
static int is_ctor_dtor (char *s) const
static char * find_a_file (struct path_prefix *pprefix, const char *name)
static void add_prefix (struct path_prefix *pprefix, const char *prefix)
static void prefix_from_env (char *env, struct path_prefix *pprefix) const
static void prefix_from_string (char *p, struct path_prefix *pprefix) const
int main PARAMS ((int, char *[]))
int main (int argc, argv)
int collect_wait (char *prog) const
static void do_wait (char *prog) const
void collect_execute (char *prog, char **argv, const char *redir) const
static void fork_execute (char *prog, char **argv) const
static void maybe_unlink (char *file) const
static void add_to_list (struct head *head_ptr, const char *name)
static int extract_init_priority (char *name) const
static void sort_ids (struct head *head_ptr)
static void write_list (FILE *stream, const char *prefix, struct id *list)
static void write_list_with_asm (FILE *stream, const char *prefix, struct id *list)
static void write_c_file_stat (FILE *stream, name)
static void write_c_file_glob (FILE *stream, name)
static void write_c_file (FILE *stream, const char *name)
static void scan_prog_file (char *prog_name, enum pass which_pass) const

Variables

int do_collecting = 0
int no_demangle
int vflag
static int rflag
static int strip_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 pexecute_pid
static struct path_prefix cpath path
static long sequence_number = 0


Define Documentation

#define COLLECT

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

Referenced by write_c_file_stat().

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

Definition at line 156 of file collect2.c.

Referenced by write_c_file_stat().

#define DEFAULT_INIT_PRIORITY   65535

#define LIBRARY_PATH_ENV   "LIBRARY_PATH"

Definition at line 54 of file collect2.c.

Referenced by main(), and process_command().

#define NAME__MAIN   "__main"

Definition at line 149 of file collect2.c.

Referenced by expand_main_function(), and write_c_file_glob().

#define NM_FLAGS   "-n"

Definition at line 140 of file collect2.c.

Referenced by scan_prog_file().

#define OBJECT_FORMAT_NONE

Definition at line 87 of file collect2.c.

#define VFORK_STRING   "vfork"

Definition at line 43 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 196 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]

Definition at line 1687 of file collect2.c.

References free(), id::name, id::next, id::sequence, strcmp(), strcpy, strlen(), and xcalloc().

Referenced by main(), and scan_prog_file().

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

void collect_exit ( int  status  ) 

Definition at line 339 of file collect2.c.

Referenced by collect_wait(), do_tlink(), do_wait(), fatal(), and fatal_perror().

int collect_wait ( char *  prog  )  const

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

Definition at line 1572 of file collect2.c.

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

Referenced by fork_execute(), and scan_prog_file().

void dump_file ( char *  name  )  const

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

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

Definition at line 1722 of file collect2.c.

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

Referenced by sort_ids().

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

Definition at line 507 of file collect2.c.

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

Referenced by get_base_filename(), and main().

void fancy_abort ( void   ) 

Definition at line 469 of file collect2.c.

References fatal().

Referenced by _fatal_insn(), abort_with_insn(), and segv_handler().

int file_exists ( char *  name  )  const

Definition at line 498 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 ( char *  prog,
char **  argv 
) const [static]

Definition at line 1661 of file collect2.c.

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

Referenced by main().

static void handler ( int  signo  )  [static]

Definition at line 475 of file collect2.c.

References c_file, getpid, kill, ldout, maybe_unlink(), o_file, and signal().

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

Definition at line 606 of file collect2.c.

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

Referenced by scan_prog_file().

int main ( int argc  ,
argv   
)

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

Definition at line 1672 of file collect2.c.

References debug, notice(), and unlink.

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

int main PARAMS ( (int, char *[])   ) 

static int dup2 PARAMS ( (int, int)   )  [static]

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

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

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

static void write_list PARAMS ( (FILE *, const char *, struct id *)   )  [static]

static void sort_ids PARAMS ( (struct head *)   )  [static]

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

static void fork_execute PARAMS ( (const char *, char **)   )  [static]

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

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

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

Definition at line 635 of file mips-tfile.c.

static void handler PARAMS ( (int)   )  [static]

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

Definition at line 797 of file collect2.c.

References GET_ENVIRONMENT, and prefix_from_string().

Referenced by main().

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

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

static void sort_ids ( struct head head_ptr  )  [static]

Definition at line 1740 of file collect2.c.

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

Referenced by main().

void notice VPARAMS ( (const char *msgid,...)   ) 

Definition at line 368 of file collect2.c.

References _, VA_CLOSE, va_end, VA_FIXEDARG, VA_OPEN, VA_START, and vfprintf().

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

Definition at line 2075 of file collect2.c.

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

Referenced by main().

static void write_c_file_glob ( FILE stream,
name   
) [static]

static void write_c_file_stat ( FILE stream,
name   
) [static]

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

Definition at line 1782 of file collect2.c.

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

Referenced by write_c_file_glob(), and write_c_file_stat().

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

Definition at line 1862 of file collect2.c.

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

Referenced by write_c_file_glob(), and write_c_file_stat().


Variable Documentation

const char* c_file [static]

const char* c_file_name

Definition at line 227 of file collect2.c.

Referenced by main(), and recompile_files().

Definition at line 230 of file collect2.c.

Referenced by main(), scan_prog_file(), write_c_file_glob(), and write_c_file_stat().

int debug

Definition at line 211 of file collect2.c.

Definition at line 231 of file collect2.c.

Referenced by main(), scan_prog_file(), write_c_file_glob(), and write_c_file_stat().

int do_collecting = 0

Definition at line 171 of file collect2.c.

Referenced by main().

char * fininame [static]

Definition at line 228 of file collect2.c.

Referenced by main(), and write_c_file_stat().

Definition at line 235 of file collect2.c.

Referenced by main(), scan_prog_file(), write_c_file_glob(), and write_c_file_stat().

char* initname [static]

Definition at line 228 of file collect2.c.

Referenced by main(), and write_c_file_stat().

const char* ldout

Definition at line 220 of file collect2.c.

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

const char* nm_file_name [static]

Definition at line 222 of file collect2.c.

Referenced by main(), and scan_prog_file().

Definition at line 176 of file collect2.c.

Referenced by dump_file(), and main().

const char* o_file [static]

Definition at line 216 of file collect2.c.

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

const char* output_file [static]

Definition at line 221 of file collect2.c.

Definition at line 663 of file collect2.c.

Definition at line 241 of file collect2.c.

Referenced by collect_execute(), and collect_wait().

int rflag [static]

Definition at line 204 of file collect2.c.

Referenced by main().

long sequence_number = 0 [static]

Definition at line 1682 of file collect2.c.

int shared_obj [static]

Definition at line 213 of file collect2.c.

Referenced by main(), write_c_file(), and write_c_file_stat().

const char* strip_file_name [static]

Definition at line 226 of file collect2.c.

Referenced by main().

int strip_flag [static]

Definition at line 205 of file collect2.c.

Referenced by main().

Definition at line 238 of file collect2.c.

Referenced by dump_file(), main(), read_repo_file(), recompile_files(), and scan_linker_output().

int vflag

Definition at line 203 of file collect2.c.


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