GCC Middle and Back End API Reference
|
Data Structures | |
struct | symbol_hash_entry |
struct | file_hash_entry |
struct | demangled_hash_entry |
struct | symbol_stack_entry |
struct | file_stack_entry |
Typedefs | |
typedef struct symbol_hash_entry | symbol |
typedef struct file_hash_entry | file |
typedef const char * | str |
typedef struct demangled_hash_entry | demangled |
Functions | |
static int | hash_string_eq (const void *, const void *) |
static hashval_t | hash_string_hash (const void *) |
static int | hash_string_eq () |
static hashval_t | hash_string_hash () |
static struct symbol_hash_entry * | symbol_hash_lookup (const char *, int) |
static struct file_hash_entry * | file_hash_lookup (const char *) |
static struct demangled_hash_entry * | demangled_hash_lookup (const char *, int) |
static void | symbol_push (symbol *) |
static symbol * | symbol_pop (void) |
static void | file_push (file *) |
static file * | file_pop (void) |
static void | tlink_init (void) |
static int | tlink_execute (const char *, char **, const char *, const char *) |
static char * | frob_extension (const char *, const char *) |
static char * | obstack_fgets (FILE *, struct obstack *) |
static char * | tfgets (FILE *) |
static char * | pfgets (FILE *) |
static void | freadsym (FILE *, file *, int) |
static void | read_repo_file (file *) |
static void | maybe_tweak (char *, file *) |
static int | recompile_files (void) |
static int | read_repo_files (char **) |
static void | demangle_new_symbols (void) |
static int | scan_linker_output (const char *) |
static struct symbol_hash_entry * | symbol_hash_lookup () |
static struct file_hash_entry * | file_hash_lookup () |
static struct demangled_hash_entry * | demangled_hash_lookup () |
static void | symbol_push () |
static void | file_push () |
static char * | frob_extension () |
static char * | obstack_fgets () |
static char * | tfgets () |
static char * | pfgets () |
static void | freadsym () |
static void | read_repo_file () |
static void | maybe_tweak () |
static int | read_repo_files () |
static bool | start_tweaking () |
static int | scan_linker_output () |
void | do_tlink () |
Variables | |
int | prepends_underscore |
static int | tlink_verbose |
static char * | initial_cwd |
static htab_t | symbol_table |
static htab_t | file_table |
static htab_t | demangled_table |
struct obstack | symbol_stack_obstack |
struct symbol_stack_entry * | symbol_stack |
struct obstack | file_stack_obstack |
struct file_stack_entry * | file_stack |
typedef struct demangled_hash_entry demangled |
typedef struct file_hash_entry file |
typedef const char* str |
typedef struct symbol_hash_entry symbol |
Hash table boilerplate for working with htab_t. We have hash tables for symbol names, file names, and demangled symbols.
|
static |
Add the demangled forms of any new symbols to the hash table.
References demangled_hash_lookup(), symbol_hash_entry::key, demangled_hash_entry::mangled, and symbol_pop().
Referenced by do_tlink().
|
staticread |
Referenced by demangle_new_symbols(), and scan_linker_output().
|
staticread |
Look up an entry in the demangled name hash table.
References demangled_table, and demangled_hash_entry::key.
void do_tlink | ( | ) |
Entry point for tlink. Called from main in collect2.c. Iteratively try to provide definitions for all the unresolved symbols mentioned in the linker error messages. LD_ARGV is an array of arguments for the linker. OBJECT_LST is an array of object files that we may be able to recompile to provide missing definitions. Currently ignored.
References demangle_new_symbols(), dump_ld_file(), error(), lderrout, ldout, may_unlink_output_file, read_repo_files(), recompile_files(), scan_linker_output(), tlink_execute(), tlink_init(), and tlink_verbose.
|
staticread |
Referenced by read_repo_files().
|
staticread |
Look up an entry in the file hash table.
References file_table, and file_hash_entry::key.
|
static |
References file_stack, file_stack_obstack, file_stack_entry::next, file_hash_entry::tweaking, and file_stack_entry::value.
Referenced by recompile_files().
|
static |
Referenced by freadsym(), and start_tweaking().
|
static |
|
static |
Referenced by read_repo_file().
|
static |
Real tlink code.
Subroutine of read_repo_file. We are reading the repo file for file F, which is coming in on STREAM, and the symbol that comes next in STREAM is offered, chosen or provided if CHOSEN is 0, 1 or 2, respectively. XXX "provided" is unimplemented, both here and in the compiler.
References symbol_hash_entry::chosen, symbol_hash_entry::file, file_push(), symbol_hash_lookup(), symbol_push(), and tfgets().
|
static |
Referenced by read_repo_files(), and recompile_files().
|
static |
References strlen(), and temporary_obstack.
|
static |
Hash and comparison functions for these hash tables.
Referenced by tlink_init().
|
static |
|
static |
Referenced by tlink_init().
|
static |
|
static |
Referenced by recompile_files().
|
static |
We might want to modify LINE, which is a symbol line from file F. We do this if either we saw an error message referring to the symbol in question, or we have already allocated the symbol to another file and this one wants to emit it as well.
References symbol_hash_entry::chosen, symbol_hash_entry::file, symbol_hash_lookup(), symbol_hash_entry::tweaked, and symbol_hash_entry::tweaking.
|
static |
|
static |
Referenced by read_repo_file().
|
static |
References tfgets().
|
static |
Referenced by read_repo_files(), and recompile_files().
|
static |
Read in the repo file denoted by F, and record all its information.
References file_hash_entry::args, file_hash_entry::dir, freadsym(), getenv(), file_hash_entry::key, file_hash_entry::main, pfgets(), temporary_firstobj, temporary_obstack, and tlink_verbose.
|
static |
Referenced by do_tlink().
|
static |
The first phase of processing: determine which object files have .rpo files associated with them, and read in the information.
References file_exists(), file_hash_lookup(), frob_extension(), read_repo_file(), and recompile_files().
|
static |
Update the repo files for each of the object files we have adjusted and recompile.
References file_hash_entry::args, c_file_name, file_hash_entry::dir, error(), fatal_error(), file_pop(), frob_extension(), initial_cwd, file_hash_entry::key, file_hash_entry::main, maybe_tweak(), obstack, read_repo_file(), temporary_firstobj, temporary_obstack, tfgets(), tlink_execute(), and tlink_verbose.
Referenced by do_tlink(), and read_repo_files().
|
static |
Referenced by do_tlink().
|
static |
Step through the output of the linker, in the file named FNAME, and adjust the settings for each symbol encountered.
References symbol_hash_entry::chosen, demangled_hash_lookup(), len, demangled_hash_entry::mangled, start_tweaking(), strlen(), strstr(), symbol_hash_lookup(), temporary_firstobj, temporary_obstack, tfgets(), and symbol_hash_entry::tweaked.
|
static |
We want to tweak symbol SYM. Return true if all is well, false on error.
References error(), symbol_hash_entry::file, file_push(), symbol_hash_entry::key, file_hash_entry::key, tlink_verbose, symbol_hash_entry::tweaked, and symbol_hash_entry::tweaking.
Referenced by scan_linker_output().
|
staticread |
Referenced by freadsym(), maybe_tweak(), and scan_linker_output().
|
staticread |
Look up an entry in the symbol hash table.
References symbol_hash_entry::key, and symbol_table.
|
static |
References symbol_stack_entry::next, symbol_stack, symbol_stack_obstack, and symbol_stack_entry::value.
Referenced by demangle_new_symbols().
|
static |
Referenced by freadsym().
|
static |
References symbol_stack_entry::next, symbol_stack, symbol_stack_obstack, and symbol_stack_entry::value.
|
static |
Referenced by freadsym(), pfgets(), recompile_files(), and scan_linker_output().
|
static |
References obstack_fgets(), and temporary_obstack.
|
static |
References collect_execute(), and collect_wait().
Referenced by do_tlink(), and recompile_files().
|
static |
Other machinery.
Initialize the tlink machinery. Called from do_tlink.
References debug, demangled_table, file_stack_obstack, file_table, getenv(), hash_string_eq(), hash_string_hash(), initial_cwd, symbol_stack_obstack, symbol_table, tlink_verbose, and vflag.
Referenced by do_tlink().
|
static |
Referenced by demangled_hash_lookup(), and tlink_init().
struct file_stack_entry* file_stack |
Referenced by file_pop(), and file_push().
struct obstack file_stack_obstack |
Referenced by file_pop(), file_push(), and tlink_init().
|
static |
Referenced by file_hash_lookup(), and tlink_init().
|
static |
Referenced by recompile_files(), and tlink_init().
int prepends_underscore |
Defined in the automatically-generated underscore.c.
struct symbol_stack_entry* symbol_stack |
Referenced by symbol_pop(), and symbol_push().
struct obstack symbol_stack_obstack |
Referenced by symbol_pop(), symbol_push(), and tlink_init().
|
static |
Referenced by symbol_hash_lookup(), and tlink_init().
|
static |
Referenced by do_tlink(), read_repo_file(), recompile_files(), start_tweaking(), and tlink_init().