diff options
author | Roland McGrath <mcgrathr@google.com> | 2020-06-23 12:01:24 -0700 |
---|---|---|
committer | Roland McGrath <mcgrathr@google.com> | 2020-06-23 12:01:24 -0700 |
commit | f37b21b481a7804a13c5806098c19b6119288ba4 (patch) | |
tree | 3949b039081a31a28f9c9c227c7810e13ea2f25a /gold/options.h | |
parent | 236ef0346d88efffd1ca1da1a5d80724cb145660 (diff) | |
download | gdb-f37b21b481a7804a13c5806098c19b6119288ba4.zip gdb-f37b21b481a7804a13c5806098c19b6119288ba4.tar.gz gdb-f37b21b481a7804a13c5806098c19b6119288ba4.tar.bz2 |
PR 22843: ld, gold: Add --dependency-file option.
gold/
* options.h (class General_options): Add --dependency-file option.
* fileread.cc (File_read::files_read): New static variable.
(File_read::open): Add the file to the files_read list.
(File_read::record_file_read): New static member function.
(File_read::write_dependency_file): New static member function.
* fileread.h (class File_read): Declare them.
* layout.cc (Layout::read_layout_from_file): Call record_file_read.
(Close_task_runner::run): Call write_dependency_file if
--dependency-file was passed.
ld/
* NEWS: Note --dependency-file.
* ld.texi (Options): Document --dependency-file.
* ldlex.h (enum option_values): Add OPTION_DEPENDENCY_FILE.
* ld.h (ld_config_type): New member dependency_file.
* lexsup.c (ld_options, parse_args): Parse --dependency-file.
* ldmain.c (struct dependency_file): New type.
(dependency_files, dependency_files_tail): New static variables.
(track_dependency_files): New function.
(write_dependency_file): New function.
(main): Call it when --dependency-file was passed.
* ldfile.c (ldfile_try_open_bfd): Call track_dependency_files.
(ldfile_open_command_file_1): Likewise.
* ldelf.c (ldelf_try_needed): Likewise.
* pe-dll.c (pe_implied_import_dll): Likewise.
Diffstat (limited to 'gold/options.h')
-rw-r--r-- | gold/options.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gold/options.h b/gold/options.h index f0e9fbd..3c8d25a 100644 --- a/gold/options.h +++ b/gold/options.h @@ -472,7 +472,7 @@ struct Struct_special : public Struct_var options::String_set::const_iterator \ varname__##_end() const \ { return this->varname__##_.value.end(); } \ - \ + \ options::String_set::size_type \ varname__##_size() const \ { return this->varname__##_.value.size(); } \ @@ -800,6 +800,10 @@ class General_options N_("Do not demangle C++ symbols in log messages"), NULL); + DEFINE_string(dependency_file, options::TWO_DASHES, '\0', NULL, + N_("Write a dependency file listing all files read"), + N_("FILE")); + DEFINE_bool(detect_odr_violations, options::TWO_DASHES, '\0', false, N_("Look for violations of the C++ One Definition Rule"), N_("Do not look for violations of the C++ One Definition Rule")); @@ -1501,10 +1505,10 @@ class General_options DEFINE_uint64(stack_size, options::DASH_Z, '\0', 0, N_("Set PT_GNU_STACK segment p_memsz to SIZE"), N_("SIZE")); DEFINE_enum(start_stop_visibility, options::DASH_Z, '\0', "protected", - N_("ELF symbol visibility for synthesized " - "__start_* and __stop_* symbols"), - ("[default,internal,hidden,protected]"), - {"default", "internal", "hidden", "protected"}); + N_("ELF symbol visibility for synthesized " + "__start_* and __stop_* symbols"), + ("[default,internal,hidden,protected]"), + {"default", "internal", "hidden", "protected"}); DEFINE_bool(text, options::DASH_Z, '\0', false, N_("Do not permit relocations in read-only segments"), N_("Permit relocations in read-only segments")); |