This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gold patch committed to 2.21 branch: EXTERN in input file script


I committed this patch to the binutils 2.21 branch to fix the case of
EXTERN appearing in a linker script which appears on the command line as
an ordinary input file.

Ian


2011-02-01  Ian Lance Taylor  <iant@google.com>

	Backport from mainline:
	2011-01-25  Ian Lance Taylor  <iant@google.com>
	* script.cc (script_add_extern): Rewrite to use
	add_symbol_reference.


Index: script.cc
===================================================================
RCS file: /cvs/src/src/gold/script.cc,v
retrieving revision 1.79
diff -u -p -r1.79 script.cc
--- script.cc	3 Nov 2010 17:18:23 -0000	1.79
+++ script.cc	1 Feb 2011 14:53:05 -0000
@@ -1,6 +1,6 @@
 // script.cc -- handle linker scripts for gold.
 
-// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -2576,12 +2576,8 @@ yyerror(void* closurev, const char* mess
 extern "C" void
 script_add_extern(void* closurev, const char* name, size_t length)
 {
-  // We treat exactly like -u NAME.  FIXME: If it seems useful, we
-  // could handle this after the command line has been read, by adding
-  // entries to the symbol table directly.
-  std::string arg("--undefined=");
-  arg.append(name, length);
-  script_parse_option(closurev, arg.c_str(), arg.size());
+  Parser_closure* closure = static_cast<Parser_closure*>(closurev);
+  closure->script_options()->add_symbol_reference(name, length);
 }
 
 // Called by the bison parser to add a file to the link.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]