Commit | Line | Data |
---|---|---|
5a6f7e2d ILT |
1 | // main.cc -- gold main function. |
2 | ||
3 | #include "gold.h" | |
4 | ||
5 | #include "options.h" | |
6 | #include "dirsearch.h" | |
7 | #include "workqueue.h" | |
8 | #include "object.h" | |
9 | #include "symtab.h" | |
10 | #include "layout.h" | |
11 | ||
12 | using namespace gold; | |
13 | ||
14 | int | |
15 | main(int argc, char** argv) | |
16 | { | |
17 | #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) | |
18 | setlocale (LC_MESSAGES, ""); | |
19 | #endif | |
20 | #if defined (HAVE_SETLOCALE) | |
21 | setlocale (LC_CTYPE, ""); | |
22 | #endif | |
23 | bindtextdomain (PACKAGE, LOCALEDIR); | |
24 | textdomain (PACKAGE); | |
25 | ||
26 | program_name = argv[0]; | |
27 | ||
28 | // Handle the command line options. | |
29 | Command_line command_line; | |
30 | command_line.process(argc - 1, argv + 1); | |
31 | ||
32 | // The work queue. | |
33 | Workqueue workqueue(command_line.options()); | |
34 | ||
35 | // The list of input objects. | |
36 | Input_objects input_objects; | |
37 | ||
38 | // The symbol table. | |
39 | Symbol_table symtab; | |
40 | ||
41 | // The layout object. | |
42 | Layout layout(command_line.options()); | |
43 | ||
44 | // Get the search path from the -L options. | |
45 | Dirsearch search_path; | |
46 | search_path.add(&workqueue, command_line.options().search_path()); | |
47 | ||
48 | // Queue up the first set of tasks. | |
49 | queue_initial_tasks(command_line.options(), search_path, | |
50 | command_line, &workqueue, &input_objects, | |
51 | &symtab, &layout); | |
52 | ||
53 | // Run the main task processing loop. | |
54 | workqueue.process(); | |
55 | ||
56 | gold_exit(true); | |
57 | } |