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