|
|
a85bd6f |
diff -rcp ../binutils-2.20.51.0.2-original/gold/script.cc gold/script.cc
|
|
|
a85bd6f |
*** ../binutils-2.20.51.0.2-original/gold/script.cc 2010-06-09 15:28:37.000000000 +0100
|
|
|
a85bd6f |
--- gold/script.cc 2010-06-09 15:48:55.000000000 +0100
|
|
|
a85bd6f |
*************** script_add_file(void* closurev, const ch
|
|
|
a85bd6f |
*** 2184,2189 ****
|
|
|
a85bd6f |
--- 2184,2205 ----
|
|
|
a85bd6f |
closure->inputs()->add_file(file);
|
|
|
a85bd6f |
}
|
|
|
a85bd6f |
|
|
|
a85bd6f |
+ // Called by the bison parser to add a library to the link.
|
|
|
a85bd6f |
+
|
|
|
a85bd6f |
+ extern "C" void
|
|
|
a85bd6f |
+ script_add_library(void* closurev, const char* name, size_t length)
|
|
|
a85bd6f |
+ {
|
|
|
a85bd6f |
+ Parser_closure* closure = static_cast<Parser_closure*>(closurev);
|
|
|
a85bd6f |
+ std::string name_string(name, length);
|
|
|
a85bd6f |
+
|
|
|
a85bd6f |
+ if (name_string[0] != 'l')
|
|
|
a85bd6f |
+ gold_error(_("library name must be prefixed with -l"));
|
|
|
a85bd6f |
+
|
|
|
a85bd6f |
+ Input_file_argument file(name_string.c_str() + 1, true, "", false,
|
|
|
a85bd6f |
+ closure->position_dependent_options());
|
|
|
a85bd6f |
+ closure->inputs()->add_file(file);
|
|
|
a85bd6f |
+ }
|
|
|
a85bd6f |
+
|
|
|
a85bd6f |
// Called by the bison parser to start a group. If we are already in
|
|
|
a85bd6f |
// a group, that means that this script was invoked within a
|
|
|
a85bd6f |
// --start-group --end-group sequence on the command line, or that
|
|
|
a85bd6f |
diff -rcp ../binutils-2.20.51.0.2-original/gold/script-c.h gold/script-c.h
|
|
|
a85bd6f |
*** ../binutils-2.20.51.0.2-original/gold/script-c.h 2010-06-09 15:29:59.000000000 +0100
|
|
|
a85bd6f |
--- gold/script-c.h 2010-06-09 15:41:38.000000000 +0100
|
|
|
a85bd6f |
*************** script_add_extern(void* closure, const c
|
|
|
a85bd6f |
*** 222,227 ****
|
|
|
a85bd6f |
--- 222,232 ----
|
|
|
a85bd6f |
extern void
|
|
|
a85bd6f |
script_add_file(void* closure, const char*, size_t);
|
|
|
a85bd6f |
|
|
|
a85bd6f |
+ /* Called by the bison parser to add a library to the link. */
|
|
|
a85bd6f |
+
|
|
|
a85bd6f |
+ extern void
|
|
|
a85bd6f |
+ script_add_library(void* closure, const char*, size_t);
|
|
|
a85bd6f |
+
|
|
|
a85bd6f |
/* Called by the bison parser to start and stop a group. */
|
|
|
a85bd6f |
|
|
|
a85bd6f |
extern void
|
|
|
a85bd6f |
diff -rcp ../binutils-2.20.51.0.2-original/gold/yyscript.y gold/yyscript.y
|
|
|
a85bd6f |
*** ../binutils-2.20.51.0.2-original/gold/yyscript.y 2010-06-09 15:28:37.000000000 +0100
|
|
|
a85bd6f |
--- gold/yyscript.y 2010-06-09 15:41:38.000000000 +0100
|
|
|
a85bd6f |
*************** input_list:
|
|
|
a85bd6f |
*** 314,319 ****
|
|
|
a85bd6f |
--- 314,321 ----
|
|
|
a85bd6f |
input_list_element:
|
|
|
a85bd6f |
string
|
|
|
a85bd6f |
{ script_add_file(closure, $1.value, $1.length); }
|
|
|
a85bd6f |
+ | '-' STRING
|
|
|
a85bd6f |
+ { script_add_library(closure, $2.value, $2.length); }
|
|
|
a85bd6f |
| AS_NEEDED
|
|
|
a85bd6f |
{ script_start_as_needed(closure); }
|
|
|
a85bd6f |
'(' input_list ')'
|
|
|
a85bd6f |
Only in gold: yyscript.y.gold-input~
|