diff options
Diffstat (limited to 'ld/ld.h')
-rw-r--r-- | ld/ld.h | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -295,6 +295,10 @@ typedef struct char *map_filename; FILE *map_file; + char *stats_filename; + /* If non-NULL then resource use information should be written to this file. */ + FILE *stats_file; + char *dependency_file; unsigned int split_by_reloc; @@ -330,6 +334,39 @@ typedef struct enum compressed_debug_section_type compress_debug; } ld_config_type; +/* An enumeration of the linker phases for which resource usage information + is recorded. PHASE_ALL is special as it covers the entire link process. + + Instructions for adding a new phase: + 1. Add an entry to this enumeration. + 2. Add an entry for the phase to the phase_data[] structure in ldmain.c. + 3. Add calls to ld_start_phase(PHASE_xxx) and ld_stop_phase(PHASE_xxx) + at the appropriate place(s) in the code. It does not matter if the + new phase overlaps with or is contained by any other phase. + + Instructions for adding a new resource: + 1. If necessary add a new field to the phase_data structure defined in + ldmain.c. + 2. Add code to initialise the field in ld_main.c:ld_start_phase(). + 3. Add code to finalise the field in ld_main.c:ld_stop_phase(). + 4. Add code to report the field in ld_main.c:report_phases(). */ +typedef enum +{ + PHASE_ALL = 0, + PHASE_CTF, + PHASE_MERGE, + PHASE_PARSE, + PHASE_PLUGINS, + PHASE_PROCESS, + PHASE_WRITE, + + NUM_PHASES /* This must be the last entry. */ +} +ld_phase; + +extern void ld_start_phase (ld_phase); +extern void ld_stop_phase (ld_phase); + extern ld_config_type config; extern FILE * saved_script_handle; |