diff options
author | Ian Lance Taylor <iant@google.com> | 2008-02-04 06:45:50 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2008-02-04 06:45:50 +0000 |
commit | 3802b2dd6b937e2904b6e2de087e224437eab493 (patch) | |
tree | ac185197a2a44c92c3785020c2ce1e389f2b0287 /gold/script.cc | |
parent | ae7d22a6f2f59251b85ef5655b800f2dfe2dfbee (diff) | |
download | gdb-3802b2dd6b937e2904b6e2de087e224437eab493.zip gdb-3802b2dd6b937e2904b6e2de087e224437eab493.tar.gz gdb-3802b2dd6b937e2904b6e2de087e224437eab493.tar.bz2 |
Implement SIZEOF_HEADERS, section constraints, other minor linker
script items.
Diffstat (limited to 'gold/script.cc')
-rw-r--r-- | gold/script.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gold/script.cc b/gold/script.cc index 734349b..973c05c 100644 --- a/gold/script.cc +++ b/gold/script.cc @@ -393,7 +393,9 @@ Lex::can_start_name(char c, char c2) return this->mode_ == LINKER_SCRIPT && can_continue_name(&c2); case '*': case '[': - return this->mode_ == VERSION_SCRIPT; + return (this->mode_ == VERSION_SCRIPT + || (this->mode_ == LINKER_SCRIPT + && can_continue_name(&c2))); default: return false; @@ -1607,6 +1609,7 @@ script_keyword_parsecodes[] = { "SHORT", SHORT }, { "SIZEOF", SIZEOF }, { "SIZEOF_HEADERS", SIZEOF_HEADERS }, + { "SORT", SORT_BY_NAME }, { "SORT_BY_ALIGNMENT", SORT_BY_ALIGNMENT }, { "SORT_BY_NAME", SORT_BY_NAME }, { "SPECIAL", SPECIAL }, @@ -2145,6 +2148,24 @@ script_parse_option(void* closurev, const char* option, size_t length) } } +// Called by the bison parser to handle SEARCH_DIR. This is handled +// exactly like a -L option. + +extern "C" void +script_add_search_dir(void* closurev, const char* option, size_t length) +{ + Parser_closure* closure = static_cast<Parser_closure*>(closurev); + if (closure->command_line() == NULL) + gold_warning(_("%s:%d:%d: ignoring SEARCH_DIR; SEARCH_DIR is only valid" + " for scripts specified via -T/--script"), + closure->filename(), closure->lineno(), closure->charpos()); + else + { + std::string s = "-L" + std::string(option, length); + script_parse_option(closurev, s.c_str(), s.size()); + } +} + /* Called by the bison parser to push the lexer into expression mode. */ |