diff options
author | Doug Kwan <dougkwan@google.com> | 2009-10-16 18:56:07 +0000 |
---|---|---|
committer | Doug Kwan <dougkwan@google.com> | 2009-10-16 18:56:07 +0000 |
commit | 3c12dcdba03d51b78e80c1847f249787d39cd572 (patch) | |
tree | fe93ffbc7f8c85217450c21ab466eb027cee43d6 /gold/script-sections.h | |
parent | 64b1ae3731ea1d8ffe5bcd0a4b1046921c869fa4 (diff) | |
download | gdb-3c12dcdba03d51b78e80c1847f249787d39cd572.zip gdb-3c12dcdba03d51b78e80c1847f249787d39cd572.tar.gz gdb-3c12dcdba03d51b78e80c1847f249787d39cd572.tar.bz2 |
2009-10-16 Doug Kwan <dougkwan@google.com>
* expression.cc (class Segment_start_expression): New class definition.
(Segment_start_expression::value): New method definition.
(script_exp_function_segment_start): Return a new
Segment_start_expression.
* gold/script-c.h (script_saw_segment_start_expression): New function
prototype.
* script-sections.cc (Script_sections::Script_sections): Initialize
SAW_SEGMENT_START_EXPRESSION_ to false.
(Script_sections::set_section_addresses): Use -Ttext, -Tdata
and -Tbbs options to specify section addresses if given in
command line and no SEGMENT_START expression is seen in a script.
* script-sections.h (Script_sections::saw_segment_start_expression,
Script_sections::set_saw_segment_start_expression): New method
definition.
(Script_sections::saw_segment_start_expression_): New data member
declaration.
* script.cc (script_saw_segment_start_expression): New function.
* yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
* testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
script_test_7.sh and script_test_8.sh.
(check_DATA): Add script_test_6.stdout, script_test_7.stdout and
script_test_8.stdout.
(MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
(script_test_6, script_test_6.stdout, script_test_7,
script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
* Makefile.in: Regenerate.
* testsuite/script_test_6.sh: New file.
* testsuite/script_test_6.t: Same.
* testsuite/script_test_7.sh: Same.
* testsuite/script_test_7.t: Same.
* testsuite/script_test_8.sh: Same.
Diffstat (limited to 'gold/script-sections.h')
-rw-r--r-- | gold/script-sections.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gold/script-sections.h b/gold/script-sections.h index b326eae..c0d1d08 100644 --- a/gold/script-sections.h +++ b/gold/script-sections.h @@ -191,6 +191,17 @@ class Script_sections void release_segments(); + // Whether we ever saw a SEGMENT_START expression, the presence of which + // changes the behaviour of -Ttext, -Tdata and -Tbss options. + bool + saw_segment_start_expression() const + { return this->saw_segment_start_expression_; } + + // Set the flag which indicates whether we saw a SEGMENT_START expression. + void + set_saw_segment_start_expression(bool value) + { this->saw_segment_start_expression_ = value; } + // Print the contents to the FILE. This is for debugging. void print(FILE*) const; @@ -253,6 +264,8 @@ class Script_sections bool saw_data_segment_align_; // Whether we have seen DATA_SEGMENT_RELRO_END. bool saw_relro_end_; + // Whether we have seen SEGMENT_START. + bool saw_segment_start_expression_; }; } // End namespace gold. |