1 // readsyms.h -- read input file symbols for gold -*- C++ -*-
3 #ifndef GOLD_READSYMS_H
4 #define GOLD_READSYMS_H
12 // This Task is responsible for reading the symbols from an input
13 // file. This also includes reading the relocations so that we can
14 // check for any that require a PLT and/or a GOT. After the data has
15 // been read, this queues up another task to actually add the symbols
16 // to the symbol table. The tasks are separated because the file
17 // reading can occur in parallel but adding the symbols must be done
18 // in the order of the input files.
20 class Read_symbols
: public Task
23 // DIRPATH is the list of directories to search for libraries.
24 // INPUT is the file to read. THIS_BLOCKER is used to prevent the
25 // associated Add_symbols task from running before the previous one
26 // has completed; it will be NULL for the first task. NEXT_BLOCKER
27 // is used to block the next input file from adding symbols.
28 Read_symbols(const General_options
& options
, Object_list
* input_objects
,
29 Symbol_table
* symtab
, const Dirsearch
& dirpath
,
30 const Input_argument
& input
,
31 Task_token
* this_blocker
, Task_token
* next_blocker
)
32 : options_(options
), input_objects_(input_objects
), symtab_(symtab
),
33 dirpath_(dirpath
), input_(input
), this_blocker_(this_blocker
),
34 next_blocker_(next_blocker
)
39 // The standard Task methods.
42 is_runnable(Workqueue
*);
51 const General_options
& options_
;
52 Object_list
* input_objects_
;
53 Symbol_table
* symtab_
;
54 const Dirsearch
& dirpath_
;
55 const Input_argument
& input_
;
56 Task_token
* this_blocker_
;
57 Task_token
* next_blocker_
;
60 // This Task handles adding the symbols to the symbol table. These
61 // tasks must be run in the same order as the arguments appear on the
64 class Add_symbols
: public Task
67 // THIS_BLOCKER is used to prevent this task from running before the
68 // one for the previous input file. NEXT_BLOCKER is used to prevent
69 // the next task from running.
70 Add_symbols(Symbol_table
* symtab
, Object
* object
, Read_symbols_data sd
,
71 Task_token
* this_blocker
, Task_token
* next_blocker
)
72 : symtab_(symtab
), object_(object
), sd_(sd
), this_blocker_(this_blocker
),
73 next_blocker_(next_blocker
)
78 // The standard Task methods.
81 is_runnable(Workqueue
*);
90 class Add_symbols_locker
;
92 Symbol_table
* symtab_
;
94 Read_symbols_data sd_
;
95 Task_token
* this_blocker_
;
96 Task_token
* next_blocker_
;
99 } // end namespace gold
101 #endif // !defined(GOLD_READSYMS_H)