ac_rtld_config::ac_rtld_config() { int mapfile_fd; config_loaded = false; hashtable = NULL; /* Our config file exists? */ mapfile_fd = find_config_file ("ac_rtld.relmap"); if (mapfile_fd >= 0) { if (hash_initialize(&hashtable) == FINE) { if (process_map_file(mapfile_fd, hashtable) == FINE) { config_loaded = true; } else { hash_delete(&hashtable); } } close(mapfile_fd); } }
int main (int argc, char **argv) { unsigned int mapfile_fd; hash_node **hashtable; char reverse_mode; if (hash_initialize(&hashtable) == ACRELCONVERT_FUNC_ERROR) exit(EXIT_FAILURE); if (process_parameters(argc, argv, &reverse_mode) == ACRELCONVERT_FUNC_ERROR) exit(EXIT_FAILURE); if ((mapfile_fd = open(argv[2], 0)) == -1) { fprintf(stderr, "Fatal error while opening map file \"%s\"\n", argv[2]); exit(EXIT_FAILURE); } if (process_map_file(mapfile_fd, hashtable, reverse_mode) == ACRELCONVERT_FUNC_ERROR) { close(mapfile_fd); exit(EXIT_FAILURE); } close(mapfile_fd); if (process_elf(argv[3], hashtable) == ACRELCONVERT_FUNC_ERROR) { hash_delete (&hashtable); exit(EXIT_FAILURE); } hash_delete (&hashtable); exit(EXIT_SUCCESS); }