diff options
author | Ian Lance Taylor <ian@airs.com> | 2010-01-06 22:37:18 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2010-01-06 22:37:18 +0000 |
commit | a192ba05083cb72a218e7c7722f30eadb9973833 (patch) | |
tree | fd02bf5a6447fb6c1ec2ba8655779f583ee8892e /gold/options.h | |
parent | d5551862dfa8c22746642b9a7f66b076557a0325 (diff) | |
download | gdb-a192ba05083cb72a218e7c7722f30eadb9973833.zip gdb-a192ba05083cb72a218e7c7722f30eadb9973833.tar.gz gdb-a192ba05083cb72a218e7c7722f30eadb9973833.tar.bz2 |
PR 10980
* options.cc (General_options::parse_section_start): New function.
(General_options::section_start): New function.
(General_options::General_options): Initialize all members.
* options.h: Include <map>
(class General_options): Add --section-start. Add section_starts_
member.
* layout.cc (Layout::attach_allocated_section_to_segment): If
--section-start was used, set the address of the segment. Remove
local sort_sections.
(Layout::relaxation_loop_body): If the address of the load segment
has been set by --section-start, don't use it.
* output.h (Output_segment::update_flags_for_output_section): New
function.
* output.cc (Output_segment::add_output_section): Call
update_flags_for_output_section.
Diffstat (limited to 'gold/options.h')
-rw-r--r-- | gold/options.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gold/options.h b/gold/options.h index 817cac7..7e9c9f9 100644 --- a/gold/options.h +++ b/gold/options.h @@ -39,6 +39,7 @@ #include <cstdlib> #include <cstring> #include <list> +#include <map> #include <string> #include <vector> @@ -845,6 +846,9 @@ class General_options N_("Add DIR to link time shared library search path"), N_("DIR")); + DEFINE_special(section_start, options::TWO_DASHES, '\0', + N_("Set address of section"), N_("SECTION=ADDRESS")); + DEFINE_optional_string(sort_common, options::TWO_DASHES, '\0', NULL, N_("Sort common symbols by alignment"), N_("[={ascending,descending}]")); @@ -1174,6 +1178,12 @@ class General_options bool check_excluded_libs (const std::string &s) const; + // If an explicit start address was given for section SECNAME with + // the --section-start option, return true and set *PADDR to the + // address. Otherwise return false. + bool + section_start(const char* secname, uint64_t* paddr) const; + private: // Don't copy this structure. General_options(const General_options&); @@ -1261,6 +1271,8 @@ class General_options Unordered_set<std::string> excluded_libs_; // List of symbol-names to keep, via -retain-symbol-info. Unordered_set<std::string> symbols_to_retain_; + // Map from section name to address from --section-start. + std::map<std::string, uint64_t> section_starts_; }; // The position-dependent options. We use this to store the state of |