Lines Matching refs:ld_state
210 struct ld_state ld_state; variable
307 obstack_init (&ld_state.smem); in main()
329 if (unlikely (ld_state.hash_style == hash_style_none)) in main()
330 ld_state.hash_style = hash_style_sysv; in main()
347 ld_state.srcfiles = NULL; in main()
360 ld_state.default_paths = ld_state.paths; in main()
361 ld_state.paths = ld_state.tailpaths = NULL; in main()
374 error_loading |= FILE_PROCESS (-1, last_file, &ld_state, &last_file); in main()
390 if (ld_state.file_type != relocatable_file_type) in main()
408 if (FLAG_UNRESOLVED (&ld_state) != 0) in main()
415 if (ld_state.file_type != relocatable_file_type) in main()
421 while ((h = ld_section_tab_iterate (&ld_state.section_tab, &p)) != NULL) in main()
430 COUNT_RELOCATIONS (&ld_state, runp); in main()
432 ld_state.relsize_total += runp->relsize; in main()
440 if (ld_state.need_got) in main()
441 create_special_section_symbol (&ld_state.got_symbol, in main()
446 create_special_section_symbol (&ld_state.dyn_symbol, "_DYNAMIC"); in main()
451 if (OPEN_OUTFILE (&ld_state, EM_NONE, ELFCLASSNONE, ELFDATANONE) != 0) in main()
458 GENERATE_SECTIONS (&ld_state); in main()
470 CREATE_SECTIONS (&ld_state); in main()
474 if (CREATE_OUTFILE (&ld_state) != 0) in main()
478 err |= FINALIZE (&ld_state); in main()
552 ld_state.export_all_dynamic = true; in parse_opt_1st()
556 if (ld_state.file_type != no_file_type) in parse_opt_1st()
559 ld_state.file_type = dso_file_type; in parse_opt_1st()
562 ld_state.export_all_dynamic = true; in parse_opt_1st()
566 ld_state.soname = arg; in parse_opt_1st()
575 ld_state.interp = arg; in parse_opt_1st()
586 ld_state.add_ld_comment = true; in parse_opt_1st()
588 ld_state.add_ld_comment = true; in parse_opt_1st()
594 if (ld_state.file_type != no_file_type) in parse_opt_1st()
597 ld_state.file_type = relocatable_file_type; in parse_opt_1st()
601 ld_state.strip = strip_debug; in parse_opt_1st()
605 ld_state.trace_files = true; in parse_opt_1st()
622 ld_state.pagesize = strtoul (arg, &endp, 0); in parse_opt_1st()
626 ld_state.pagesize *= 1024; in parse_opt_1st()
628 ld_state.pagesize *= 1024 * 1024; in parse_opt_1st()
634 ld_state.pagesize = 0; in parse_opt_1st()
641 add_rxxpath (&ld_state.rpath, arg); in parse_opt_1st()
645 add_rxxpath (&ld_state.rpath_link, arg); in parse_opt_1st()
649 add_rxxpath (&ld_state.runpath, arg); in parse_opt_1st()
653 add_rxxpath (&ld_state.runpath_link, arg); in parse_opt_1st()
658 ld_state.gc_sections = key == ARGP_gc_sections; in parse_opt_1st()
662 ld_state.eh_frame_hdr = true; in parse_opt_1st()
667 ld_state.hash_style = hash_style_gnu; in parse_opt_1st()
669 ld_state.hash_style = hash_style_gnu | hash_style_sysv; in parse_opt_1st()
671 ld_state.hash_style = hash_style_sysv; in parse_opt_1st()
678 ld_state.build_id = "sha1"; in parse_opt_1st()
685 ld_state.build_id = arg; in parse_opt_1st()
691 if (ld_state.strip == strip_all) in parse_opt_1st()
692 ld_state.strip = strip_everything; in parse_opt_1st()
694 ld_state.strip = strip_all; in parse_opt_1st()
736 ld_state.nodefs = false; in parse_opt_1st()
765 ld_state.entry = arg; in parse_opt_2nd()
769 if (ld_state.outfname != NULL) in parse_opt_2nd()
776 ld_state.outfname = arg; in parse_opt_2nd()
781 ld_state.optlevel = 1; in parse_opt_2nd()
791 ld_state.optlevel = level; in parse_opt_2nd()
796 ld_state.extract_rule = allextract; in parse_opt_2nd()
799 ld_state.extract_rule = defaultextract; in parse_opt_2nd()
803 ld_state.as_needed = true; in parse_opt_2nd()
806 ld_state.as_needed = false; in parse_opt_2nd()
812 ld_state.statically = key == ARGP_static; in parse_opt_2nd()
871 error_loading |= FILE_PROCESS (-1, last_file, &ld_state, &last_file); in parse_opt_2nd()
917 if (ld_state.needed == NULL) in load_needed()
920 runp = first = ld_state.needed->next; in load_needed()
927 err = FILE_PROCESS (-1, runp, &ld_state, &ignore); in load_needed()
960 && ld_state.file_type == dso_file_type) in parse_z_option()
961 ld_state.dt_flags_1 |= DF_1_NODEFLIB; in parse_z_option()
963 ld_state.muldefs = true; in parse_z_option()
965 ld_state.nodefs = true; in parse_z_option()
967 ld_state.nodefs = false; in parse_z_option()
971 ld_state.dt_flags |= DF_BIND_NOW; in parse_z_option()
975 ld_state.dt_flags |= DF_ORIGIN; in parse_z_option()
978 && ld_state.file_type == dso_file_type) in parse_z_option()
979 ld_state.dt_flags_1 |= DF_1_NODELETE; in parse_z_option()
981 ld_state.dt_flags_1 |= DF_1_INITFIRST; in parse_z_option()
984 && ld_state.file_type == dso_file_type) in parse_z_option()
985 ld_state.dt_flags_1 |= DF_1_NOOPEN; in parse_z_option()
987 ld_state.is_system_library = true; in parse_z_option()
989 ld_state.execstack = execstack_true; in parse_z_option()
991 ld_state.execstack = execstack_false_force; in parse_z_option()
1007 ld_state.extract_rule = allextract; in parse_z_option_2()
1009 ld_state.extract_rule = defaultextract; in parse_z_option_2()
1011 ld_state.extract_rule = weakextract; in parse_z_option_2()
1013 ld_state.lazyload = true; in parse_z_option_2()
1015 ld_state.lazyload = false; in parse_z_option_2()
1017 ld_state.as_needed = true; in parse_z_option_2()
1019 ld_state.as_needed = false; in parse_z_option_2()
1028 ld_state.default_bind_local = true; in parse_B_option()
1042 ld_state.statically = true; in parse_B_option_2()
1044 ld_state.statically = false; in parse_B_option_2()
1047 && ld_state.file_type == dso_file_type) in parse_B_option_2()
1048 ld_state.dt_flags |= DF_SYMBOLIC; in parse_B_option_2()
1069 ld_state.ebl = in try()
1114 ld_state.ebl = ebl_openbackend_emulation (emulation); in determine_output_format()
1116 assert (ld_state.ebl != NULL); in determine_output_format()
1136 if (ld_state.ebl == NULL) in determine_output_format()
1156 if (ld_state.file_type == no_file_type) in determine_output_format()
1157 ld_state.file_type = executable_file_type; in determine_output_format()
1168 obstack_calloc (&ld_state.smem, sizeof (struct pathelement)); in ld_new_searchdir()
1173 if (ld_state.tailpaths == NULL) in ld_new_searchdir()
1174 ld_state.paths = ld_state.tailpaths = newpath->next = newpath; in ld_new_searchdir()
1177 ld_state.tailpaths->next = newpath; in ld_new_searchdir()
1178 ld_state.tailpaths = newpath; in ld_new_searchdir()
1179 newpath->next = ld_state.paths; in ld_new_searchdir()
1188 obstack_calloc (&ld_state.smem, sizeof (struct usedfiles)); in ld_new_inputfile()
1192 newfile->extract_rule = ld_state.extract_rule; in ld_new_inputfile()
1193 newfile->as_needed = ld_state.as_needed; in ld_new_inputfile()
1194 newfile->lazyload = ld_state.lazyload; in ld_new_inputfile()
1213 ld_state.nallsections = ld_state.section_tab.filled; in collect_sections()
1217 ld_state.allsections = in collect_sections()
1218 (struct scnhead **) obstack_alloc (&ld_state.smem, in collect_sections()
1219 (ld_state.nallsections + 1) in collect_sections()
1226 while ((h = ld_section_tab_iterate (&ld_state.section_tab, &p)) != NULL) in collect_sections()
1257 ld_state.allsections[cnt++] = h; in collect_sections()
1259 ld_state.nusedsections = cnt; in collect_sections()
1261 assert (cnt == ld_state.nallsections); in collect_sections()
1274 newp = (struct pathelement *) obstack_alloc (&ld_state.smem, sizeof (*newp)); in add_rxxpath()
1307 lastp->pname = obstack_strndup (&ld_state.smem, pname, in normalize_dirlist()
1314 newp = (struct pathelement *) obstack_alloc (&ld_state.smem, in normalize_dirlist()
1343 if (ld_state.rpath != NULL) in gen_rxxpath_data()
1345 struct pathelement *endp = ld_state.rpath; in gen_rxxpath_data()
1346 ld_state.rpath = ld_state.rpath->next; in gen_rxxpath_data()
1349 if (ld_state.rpath_link != NULL) in gen_rxxpath_data()
1351 struct pathelement *endp = ld_state.rpath_link; in gen_rxxpath_data()
1352 ld_state.rpath_link = ld_state.rpath_link->next; in gen_rxxpath_data()
1356 if (ld_state.runpath != NULL) in gen_rxxpath_data()
1358 struct pathelement *endp = ld_state.runpath; in gen_rxxpath_data()
1359 ld_state.runpath = ld_state.runpath->next; in gen_rxxpath_data()
1364 while (ld_state.rpath != NULL) in gen_rxxpath_data()
1366 struct pathelement *old = ld_state.rpath; in gen_rxxpath_data()
1367 ld_state.rpath = ld_state.rpath->next; in gen_rxxpath_data()
1371 if (ld_state.runpath_link != NULL) in gen_rxxpath_data()
1373 struct pathelement *endp = ld_state.runpath_link; in gen_rxxpath_data()
1374 ld_state.runpath_link = ld_state.runpath_link->next; in gen_rxxpath_data()
1379 while (ld_state.rpath_link != NULL) in gen_rxxpath_data()
1381 struct pathelement *old = ld_state.rpath_link; in gen_rxxpath_data()
1382 ld_state.rpath_link = ld_state.rpath_link->next; in gen_rxxpath_data()
1390 normalize_dirlist (&ld_state.runpath_link); in gen_rxxpath_data()
1392 else if (ld_state.rpath_link != NULL) in gen_rxxpath_data()
1394 normalize_dirlist (&ld_state.rpath_link); in gen_rxxpath_data()
1417 add_rxxpath (&ld_state.ld_library_path1, ld_library_path1); in gen_rxxpath_data()
1418 normalize_dirlist (&ld_state.ld_library_path1); in gen_rxxpath_data()
1421 add_rxxpath (&ld_state.ld_library_path2, ld_library_path2); in gen_rxxpath_data()
1422 normalize_dirlist (&ld_state.ld_library_path2); in gen_rxxpath_data()
1458 if (ld_state.output_segments == NULL) in create_lscript_symbols()
1461 struct output_segment *segment = ld_state.output_segments->next; in create_lscript_symbols()
1472 struct symbol *s = ld_state.unresolved; in create_lscript_symbols()
1491 CDBL_LIST_DEL (ld_state.unresolved, s); in create_lscript_symbols()
1492 --ld_state.nunresolved; in create_lscript_symbols()
1516 obstack_calloc (&ld_state.smem, sizeof (struct symbol)); in create_lscript_symbols()
1523 if (unlikely (ld_symbol_tab_insert (&ld_state.symbol_tab, in create_lscript_symbols()
1530 struct symbol *old = ld_symbol_tab_find (&ld_state.symbol_tab, in create_lscript_symbols()
1558 SNGL_LIST_PUSH (ld_state.lscript_syms, s); in create_lscript_symbols()
1559 ++ld_state.nlscript_syms; in create_lscript_symbols()
1567 while (segment != ld_state.output_segments->next); in create_lscript_symbols()
1581 obstack_calloc (&ld_state.smem, sizeof (*newsym)); in create_special_section_symbol()
1588 if (unlikely (ld_symbol_tab_insert (&ld_state.symbol_tab, in create_special_section_symbol()
1603 ++ld_state.nsymtab; in create_special_section_symbol()