#include <stdlib.h>#include <unistd.h>#include <libgen.h>#include <sys/stat.h>#include <sys/mman.h>#include <fcntl.h>#include <sys/dir.h>#include <sys/wait.h>#include <alloca.h>#include <signal.h>#include <limits.h>#include "bfd.h"

Go to the source code of this file.
Defines | |
| #define | FREE(ptr) free((void *) (ptr)) |
| #define | MALLOC_ASSERT(addr) if (addr == 0) msg(ER_FATAL, ERN_MALLOC) |
| #define | MALLOC(nbytes) malloc((size_t)(nbytes)) |
| #define | REALLOC(ptr, size) realloc((void *)(ptr), (size_t)(size)) |
| #define | UNLINK(path) unlink((const char *)(path)) |
| #define | MKDIR(path, mode) mkdir((const char *)(path), (mode_t)(mode)) |
| #define | RMDIR(path) rmdir((const char *)(path)) |
| #define | CLOSE(fid) close((int)(fid)) |
| #define | ALLOCA(size) alloca((unsigned int)(size)) |
| #define | FCHMOD(fid, mode) fchmod((int)(fid), (mode_t)(mode)) |
| #define | MUNMAP(addr, len) munmap((void *)(addr), (int)(len)) |
| #define | MEMCPY(s1, s2, n) memcpy((void *)(s1), (void *)(s2), (size_t)(n)) |
| #define | OBJ_ASSERT(EX, obj, str) if (!(EX)) {fprintf(stderr,"%s: %s\n", obj->name, str); exit(1);} |
Functions/Subroutines | |
| static void | dump_argv (string *argv) |
| int | do_compile (string *argv) |
| static void | ld_kill_compilation (int sig) |
| void | add_to_tmp_file_list (string path) |
| static void | remove_from_tmp_file_list (string path) |
| void | cleanup_all_files (void) |
| string | make_temp_file (string name, char suffix) |
| add_to_tmp_file_list (tmpdir) | |
| string | create_unique_file (string path, char suffix) |
| string | create_tmp_file (string filename) |
| string * | get_command_line (bfd *abfd, string in_path, string out_path, int *arg_count) |
| static int | extract_archive_member (bfd *abfd, string path) |
| int | make_link (const string dest, const string src) |
| string | ld_compile (bfd *abfd) |
Variables | |
| char ** | environ_vars |
| string | toolroot = 0 |
| static int | active_pid |
| static mode_t | cmask = 0 |
| static string | thisfile = __FILE__ |
| static string * | tmp_list = 0 |
| static int | tmp_list_size = 0 |
| static int | tmp_list_max = 0 |
| string | tmpdir = 0 |
| static int | tmpdir_length |
| return | |
| #define FCHMOD | ( | fid, | |||
| mode | ) | fchmod((int)(fid), (mode_t)(mode)) |
| #define MALLOC_ASSERT | ( | addr | ) | if (addr == 0) msg(ER_FATAL, ERN_MALLOC) |
| add_to_tmp_file_list | ( | tmpdir | ) |
Definition at line 229 of file process.c.
References DEFAULT_TMP_LIST_SIZE, MALLOC, MALLOC_ASSERT, REALLOC, tmp_list_max, and tmp_list_size.
Definition at line 272 of file process.c.
References i, LD_IPA_KEEP_TEMPS, RMDIR, tmp_list_size, and UNLINK.
| int do_compile | ( | string * | argv | ) |
Definition at line 165 of file process.c.
References active_pid, basename, concat_names(), DEFAULT_TOOLROOT, dump_argv(), environ_vars, execve, exit(), fork, FREE, getenv(), ipa_copy_of(), LD_IPA_SHOW, LD_IPA_VERBOSE, perror(), and pid.
Definition at line 510 of file process.c.
References ALLOCA, args, elf_internal_shdr::contents, DEFAULT_COMPILATION_ARGC, DEFAULT_COMPILATION_FLAGS, elf_internal_ehdr::e_shnum, elf_elfheader, elf_elfsections, ELF_WORD, i, MALLOC, MALLOC_ASSERT, OBJ_ASSERT, read_one_section(), elf_internal_shdr::sh_info, elf_internal_shdr::sh_size, TOS_IA64_32, TOS_IA64_64, TOS_MIPS_64, TOS_MIPS_N32, TOS_MIPS_O32, and WT_COMP_FLAGS.
Definition at line 688 of file process.c.
References active_pid, add_to_tmp_file_list(), bfd::arelt_data, create_tmpdir(), create_unique_file(), do_compile(), ER_DEFAULT, ER_FATAL, ERN_COMPILE, ERN_MESSAGE2, exit(), extract_archive_member(), FALSE, file_name, bfd::filename, fprintf(), FREE, get_command_line(), if(), LD_IPA_SHOW, LD_IPA_VERBOSE, make_link(), msg, remove_from_tmp_file_list(), UNLINK, void, waitpid, and WEXITSTATUS.
| static void ld_kill_compilation | ( | int | sig | ) | [static] |
int active_pid [static] |
Definition at line 129 of file process.c.
Referenced by do_compile(), ld_compile(), and ld_kill_compilation().
Definition at line 131 of file process.c.
Referenced by create_unique_file(), emit_numeric_escape(), and wide_str_to_charconst().
| char** environ_vars |
Definition at line 54 of file ipa_cmdline.c.
Referenced by do_compile(), exec_smake(), and ipa_search_command_line().
int tmp_list_max = 0 [static] |
int tmp_list_size = 0 [static] |
Definition at line 136 of file process.c.
Referenced by add_to_tmp_file_list(), cleanup_all_files(), and remove_from_tmp_file_list().
Definition at line 138 of file process.c.
Referenced by choose_tmpdir(), cif_convert_to_cifconv(), cif_convert_to_lines(), IPA_LNO_WRITE_FILE::Create_Temp_File(), create_temp_file(), create_temp_file_name(), get_object_file(), init_crash_reporting(), init_temp_files(), ipa_compile_init(), IPA_LNO_Write_Summary(), ipacom_doit(), and save_cpp_output().
int tmpdir_length [static] |
Definition at line 127 of file process.c.
Referenced by emit_lkcord(), init_msg_processing(), init_phase_info(), ipa_compile_init(), and print_buffered_messages().
1.5.6