* options.h (Input_file_argument::Input_file_type): New enum.
(Input_file_argument::is_lib_): Replace with...
(Input_file_argument::type_): New member.
(Input_file_argument::Input_file_argument): Take Input_file_type
'type' rather than boolean 'is_lib' as second argument.
(Input_file_argument::is_lib): Use type_.
(Input_file_argument::is_searched_file): New function.
(Input_file_argument::may_need_search): Handle is_searched_file.
* options.cc (General_options::parse_library): Support -l:filename.
(General_options::parse_just_symbols): Update for Input_file_argument
changes.
(Command_line::process): Likewise.
* archive.cc (Archive::get_file_and_offset): Likewise.
* plugin.cc (Plugin_manager::release_input_file): Likewise.
* script.cc (read_script_file, script_add_file): Likewise.
* fileread.cc (Input_file::Input_file): Likewise.
(Input_file::will_search_for): Handle is_searched_file.
(Input_file::open): Likewise.
* readsyms.cc (Read_symbols::get_name): Likewise.
* testsuite/Makefile.am (searched_file_test): New test.
* testsuite/Makefile.in: Regenerate.
* testsuite/searched_file_test.cc: New file.
* testsuite/searched_file_test_lib.cc: New file.
+2009-10-10 Chris Demetriou <cgd@google.com>
+
+ * options.h (Input_file_argument::Input_file_type): New enum.
+ (Input_file_argument::is_lib_): Replace with...
+ (Input_file_argument::type_): New member.
+ (Input_file_argument::Input_file_argument): Take Input_file_type
+ 'type' rather than boolean 'is_lib' as second argument.
+ (Input_file_argument::is_lib): Use type_.
+ (Input_file_argument::is_searched_file): New function.
+ (Input_file_argument::may_need_search): Handle is_searched_file.
+ * options.cc (General_options::parse_library): Support -l:filename.
+ (General_options::parse_just_symbols): Update for Input_file_argument
+ changes.
+ (Command_line::process): Likewise.
+ * archive.cc (Archive::get_file_and_offset): Likewise.
+ * plugin.cc (Plugin_manager::release_input_file): Likewise.
+ * script.cc (read_script_file, script_add_file): Likewise.
+ * fileread.cc (Input_file::Input_file): Likewise.
+ (Input_file::will_search_for): Handle is_searched_file.
+ (Input_file::open): Likewise.
+ * readsyms.cc (Read_symbols::get_name): Likewise.
+ * testsuite/Makefile.am (searched_file_test): New test.
+ * testsuite/Makefile.in: Regenerate.
+ * testsuite/searched_file_test.cc: New file.
+ * testsuite/searched_file_test_lib.cc: New file.
+
2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
Ian Lance Taylor <iant@google.com>
else
{
Input_file_argument* input_file_arg =
- new Input_file_argument(member_name->c_str(), false, "", false,
- parameters->options());
+ new Input_file_argument(member_name->c_str(),
+ Input_file_argument::INPUT_FILE_TYPE_FILE,
+ "", false, parameters->options());
*input_file = new Input_file(input_file_arg);
int dummy = 0;
if (!(*input_file)->open(*this->dirpath_, this->task_, &dummy))
// This is an external member of a thin archive. Open the
// file as a regular relocatable object file.
Input_file_argument* input_file_arg =
- new Input_file_argument(member_name->c_str(), false, "", false,
- this->input_file_->options());
+ new Input_file_argument(member_name->c_str(),
+ Input_file_argument::INPUT_FILE_TYPE_FILE,
+ "", false, this->input_file_->options());
*input_file = new Input_file(input_file_arg);
int dummy = 0;
if (!(*input_file)->open(*this->dirpath_, this->task_, &dummy))
: file_()
{
this->input_argument_ =
- new Input_file_argument(name, false, "", false,
- Position_dependent_options());
+ new Input_file_argument(name, Input_file_argument::INPUT_FILE_TYPE_FILE,
+ "", false, Position_dependent_options());
bool ok = this->file_.open(task, name, contents, size);
gold_assert(ok);
}
{
return (!IS_ABSOLUTE_PATH(this->input_argument_->name())
&& (this->input_argument_->is_lib()
+ || this->input_argument_->is_searched_file()
|| this->input_argument_->extra_search_path() != NULL));
}
// If the filename is not absolute, we assume it is in the current
// directory *except* when:
-// A) input_argument_->is_lib() is true; or
-// B) input_argument_->extra_search_path() is not empty.
-// In both cases, we look in extra_search_path + library_path to find
+// A) input_argument_->is_lib() is true;
+// B) input_argument_->is_searched_file() is true; or
+// C) input_argument_->extra_search_path() is not empty.
+// In each, we look in extra_search_path + library_path to find
// the file location, rather than the current directory.
bool
std::string name;
// Case 1: name is an absolute file, just try to open it
- // Case 2: name is relative but is_lib is false and extra_search_path
- // is empty
+ // Case 2: name is relative but is_lib is false, is_searched_file is false,
+ // and extra_search_path is empty
if (IS_ABSOLUTE_PATH(this->input_argument_->name())
|| (!this->input_argument_->is_lib()
+ && !this->input_argument_->is_searched_file()
&& this->input_argument_->extra_search_path() == NULL))
{
name = this->input_argument_->name();
this->found_name_ = name;
}
- // Case 3: is_lib is true
- else if (this->input_argument_->is_lib())
+ // Case 3: is_lib is true or is_searched_file is true
+ else if (this->input_argument_->is_lib()
+ || this->input_argument_->is_searched_file())
{
// We don't yet support extra_search_path with -l.
gold_assert(this->input_argument_->extra_search_path() == NULL);
- std::string n1("lib");
- n1 += this->input_argument_->name();
- std::string n2;
- if (parameters->options().is_static()
- || !this->input_argument_->options().Bdynamic())
- n1 += ".a";
- else
+ std::string n1, n2;
+ if (this->input_argument_->is_lib())
{
- n2 = n1 + ".a";
- n1 += ".so";
+ n1 = "lib";
+ n1 += this->input_argument_->name();
+ if (parameters->options().is_static()
+ || !this->input_argument_->options().Bdynamic())
+ n1 += ".a";
+ else
+ {
+ n2 = n1 + ".a";
+ n1 += ".so";
+ }
}
+ else
+ n1 = this->input_argument_->name();
name = dirpath.find(n1, n2, &this->is_in_sysroot_, pindex);
if (name.empty())
{
- gold_error(_("cannot find -l%s"),
+ gold_error(_("cannot find %s%s"),
+ this->input_argument_->is_lib() ? "-l" : "",
this->input_argument_->name());
return false;
}
General_options::parse_library(const char*, const char* arg,
Command_line* cmdline)
{
- Input_file_argument file(arg, true, "", false, *this);
+ Input_file_argument::Input_file_type type;
+ const char *name;
+ if (arg[0] == ':')
+ {
+ type = Input_file_argument::INPUT_FILE_TYPE_SEARCHED_FILE;
+ name = arg + 1;
+ }
+ else
+ {
+ type = Input_file_argument::INPUT_FILE_TYPE_LIBRARY;
+ name = arg;
+ }
+ Input_file_argument file(name, type, "", false, *this);
cmdline->inputs().add_file(file);
}
General_options::parse_just_symbols(const char*, const char* arg,
Command_line* cmdline)
{
- Input_file_argument file(arg, false, "", true, *this);
+ Input_file_argument file(arg, Input_file_argument::INPUT_FILE_TYPE_FILE,
+ "", true, *this);
cmdline->inputs().add_file(file);
}
this->position_options_.copy_from_options(this->options());
if (no_more_options || argv[i][0] != '-')
{
- Input_file_argument file(argv[i], false, "", false,
- this->position_options_);
+ Input_file_argument file(argv[i],
+ Input_file_argument::INPUT_FILE_TYPE_FILE,
+ "", false, this->position_options_);
this->inputs_.add_file(file);
++i;
}
class Input_file_argument
{
public:
+ enum Input_file_type
+ {
+ // A regular file, name used as-is, not searched.
+ INPUT_FILE_TYPE_FILE,
+ // A library name. When used, "lib" will be prepended and ".so" or
+ // ".a" appended to make a filename, and that filename will be searched
+ // for using the -L paths.
+ INPUT_FILE_TYPE_LIBRARY,
+ // A regular file, name used as-is, but searched using the -L paths.
+ INPUT_FILE_TYPE_SEARCHED_FILE
+ };
+
// name: file name or library name
- // is_lib: true if name is a library name: that is, emits the leading
- // "lib" and trailing ".so"/".a" from the name
+ // type: the type of this input file.
// extra_search_path: an extra directory to look for the file, prior
// to checking the normal library search path. If this is "",
// then no extra directory is added.
// options: The position dependent options at this point in the
// command line, such as --whole-archive.
Input_file_argument()
- : name_(), is_lib_(false), extra_search_path_(""), just_symbols_(false),
- options_()
+ : name_(), type_(INPUT_FILE_TYPE_FILE), extra_search_path_(""),
+ just_symbols_(false), options_()
{ }
- Input_file_argument(const char* name, bool is_lib,
+ Input_file_argument(const char* name, Input_file_type type,
const char* extra_search_path,
bool just_symbols,
const Position_dependent_options& options)
- : name_(name), is_lib_(is_lib), extra_search_path_(extra_search_path),
+ : name_(name), type_(type), extra_search_path_(extra_search_path),
just_symbols_(just_symbols), options_(options)
{ }
// Position_dependent_options. In that case, we extract the
// position-independent vars from the General_options and only store
// those.
- Input_file_argument(const char* name, bool is_lib,
+ Input_file_argument(const char* name, Input_file_type type,
const char* extra_search_path,
bool just_symbols,
const General_options& options)
- : name_(name), is_lib_(is_lib), extra_search_path_(extra_search_path),
+ : name_(name), type_(type), extra_search_path_(extra_search_path),
just_symbols_(just_symbols), options_(options)
{ }
bool
is_lib() const
- { return this->is_lib_; }
+ { return type_ == INPUT_FILE_TYPE_LIBRARY; }
+
+ bool
+ is_searched_file() const
+ { return type_ == INPUT_FILE_TYPE_SEARCHED_FILE; }
const char*
extra_search_path() const
// options.
bool
may_need_search() const
- { return this->is_lib_ || !this->extra_search_path_.empty(); }
+ {
+ return (this->is_lib()
+ || this->is_searched_file()
+ || !this->extra_search_path_.empty());
+ }
private:
// We use std::string, not const char*, here for convenience when
// using script files, so that we do not have to preserve the string
// in that case.
std::string name_;
- bool is_lib_;
+ Input_file_type type_;
std::string extra_search_path_;
bool just_symbols_;
Position_dependent_options options_;
ld_plugin_status
Plugin_manager::add_input_file(char *pathname, bool is_lib)
{
- Input_file_argument file(pathname, is_lib, "", false, this->options_);
+ Input_file_argument file(pathname,
+ (is_lib
+ ? Input_file_argument::INPUT_FILE_TYPE_LIBRARY
+ : Input_file_argument::INPUT_FILE_TYPE_FILE),
+ "", false, this->options_);
Input_argument* input_argument = new Input_argument(file);
Task_token* next_blocker = new Task_token(true);
next_blocker->add_blocker();
std::string ret("Read_symbols ");
if (this->input_argument_->file().is_lib())
ret += "-l";
+ else if (this->input_argument_->file().is_searched_file())
+ ret += "-l:";
ret += this->input_argument_->file().name();
return ret;
}
std::string ret("Read_script ");
if (this->input_argument_->file().is_lib())
ret += "-l";
+ else if (this->input_argument_->file().is_searched_file())
+ ret += "-l:";
ret += this->input_argument_->file().name();
return ret;
}
Position_dependent_options posdep = cmdline->position_dependent_options();
if (posdep.format_enum() == General_options::OBJECT_FORMAT_BINARY)
posdep.set_format_enum(General_options::OBJECT_FORMAT_ELF);
- Input_file_argument input_argument(filename, false, "", false, posdep);
+ Input_file_argument input_argument(filename,
+ Input_file_argument::INPUT_FILE_TYPE_FILE,
+ "", false, posdep);
Input_file input_file(&input_argument);
int dummy = 0;
if (!input_file.open(dirsearch, task, &dummy))
}
}
- Input_file_argument file(name_string.c_str(), false, extra_search_path,
- false, closure->position_dependent_options());
+ Input_file_argument file(name_string.c_str(),
+ Input_file_argument::INPUT_FILE_TYPE_FILE,
+ extra_search_path, false,
+ closure->position_dependent_options());
closure->inputs()->add_file(file);
}
chmod 600 $@; \
$(CXXLINK) -Bgcctestdir/ basic_test.o
+# Check -l:foo.a
+check_PROGRAMS += searched_file_test
+MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \
+ alt/searched_file_test_lib.a
+searched_file_test_SOURCES = searched_file_test.cc
+searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a
+searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt
+searched_file_test_LDADD = -l:searched_file_test_lib.a
+searched_file_test_lib.o: searched_file_test_lib.cc
+ $(CXXCOMPILE) -c -o $@ $<
+alt/searched_file_test_lib.a: searched_file_test_lib.o
+ test -d alt || mkdir -p alt
+ $(TEST_AR) rc $@ $^
+
endif GCC
endif NATIVE_LINKER
@GCC_TRUE@@NATIVE_LINKER_TRUE@ hidden_test hidden_test.err \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ retain_symbols_file_test \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ retain_symbols_file_test.in \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ retain_symbols_file_test.stdout
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ retain_symbols_file_test.stdout \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ searched_file_test \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ searched_file_test_lib.o \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ alt/searched_file_test_lib.a
@GCC_TRUE@@MCMODEL_MEDIUM_TRUE@@NATIVE_LINKER_TRUE@am__append_30 = large
@GCC_FALSE@large_DEPENDENCIES = libgoldtest.a ../libgold.a \
@GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
# Test that if the output file already exists and is empty,
# it will get execute permission.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_31 = permission_test
+
+# Check -l:foo.a
+@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_31 = permission_test \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ searched_file_test
+@GCC_FALSE@searched_file_test_DEPENDENCIES =
+@NATIVE_LINKER_FALSE@searched_file_test_DEPENDENCIES =
# These tests work with cross linkers.
@DEFAULT_TARGET_I386_TRUE@am__append_32 = split_i386.sh
@GCC_TRUE@@NATIVE_LINKER_TRUE@ discard_locals_test$(EXEEXT)
@GCC_TRUE@@MCMODEL_MEDIUM_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_18 = large$(EXEEXT)
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_19 = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ permission_test$(EXEEXT)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ permission_test$(EXEEXT) \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ searched_file_test$(EXEEXT)
basic_pic_test_SOURCES = basic_pic_test.c
basic_pic_test_OBJECTS = basic_pic_test.$(OBJEXT)
basic_pic_test_LDADD = $(LDADD)
script_test_3_DEPENDENCIES = libgoldtest.a ../libgold.a \
../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am__searched_file_test_SOURCES_DIST = searched_file_test.cc
+@GCC_TRUE@@NATIVE_LINKER_TRUE@am_searched_file_test_OBJECTS = \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ searched_file_test.$(OBJEXT)
+searched_file_test_OBJECTS = $(am_searched_file_test_OBJECTS)
+searched_file_test_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
+ $(searched_file_test_LDFLAGS) $(LDFLAGS) -o $@
am__thin_archive_test_1_SOURCES_DIST = thin_archive_main.cc
@GCC_TRUE@@NATIVE_LINKER_TRUE@am_thin_archive_test_1_OBJECTS = \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_main.$(OBJEXT)
$(protected_2_SOURCES) $(relro_script_test_SOURCES) \
$(relro_test_SOURCES) $(script_test_1_SOURCES) \
$(script_test_2_SOURCES) script_test_3.c \
- $(thin_archive_test_1_SOURCES) $(thin_archive_test_2_SOURCES) \
- $(tls_pic_test_SOURCES) $(tls_shared_gd_to_ie_test_SOURCES) \
+ $(searched_file_test_SOURCES) $(thin_archive_test_1_SOURCES) \
+ $(thin_archive_test_2_SOURCES) $(tls_pic_test_SOURCES) \
+ $(tls_shared_gd_to_ie_test_SOURCES) \
$(tls_shared_gnu2_gd_to_ie_test_SOURCES) \
$(tls_shared_gnu2_test_SOURCES) $(tls_shared_ie_test_SOURCES) \
$(tls_shared_nonpic_test_SOURCES) $(tls_shared_test_SOURCES) \
$(am__relro_test_SOURCES_DIST) \
$(am__script_test_1_SOURCES_DIST) \
$(am__script_test_2_SOURCES_DIST) script_test_3.c \
+ $(am__searched_file_test_SOURCES_DIST) \
$(am__thin_archive_test_1_SOURCES_DIST) \
$(am__thin_archive_test_2_SOURCES_DIST) \
$(am__tls_pic_test_SOURCES_DIST) \
@GCC_TRUE@@MCMODEL_MEDIUM_TRUE@@NATIVE_LINKER_TRUE@large_CFLAGS = -mcmodel=medium
@GCC_TRUE@@MCMODEL_MEDIUM_TRUE@@NATIVE_LINKER_TRUE@large_DEPENDENCIES = gcctestdir/ld
@GCC_TRUE@@MCMODEL_MEDIUM_TRUE@@NATIVE_LINKER_TRUE@large_LDFLAGS = -Bgcctestdir/
+@GCC_TRUE@@NATIVE_LINKER_TRUE@searched_file_test_SOURCES = searched_file_test.cc
+@GCC_TRUE@@NATIVE_LINKER_TRUE@searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a
+@GCC_TRUE@@NATIVE_LINKER_TRUE@searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt
+@GCC_TRUE@@NATIVE_LINKER_TRUE@searched_file_test_LDADD = -l:searched_file_test_lib.a
@DEFAULT_TARGET_I386_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
@DEFAULT_TARGET_X86_64_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
all: $(BUILT_SOURCES)
@NATIVE_LINKER_FALSE@script_test_3$(EXEEXT): $(script_test_3_OBJECTS) $(script_test_3_DEPENDENCIES)
@NATIVE_LINKER_FALSE@ @rm -f script_test_3$(EXEEXT)
@NATIVE_LINKER_FALSE@ $(LINK) $(script_test_3_OBJECTS) $(script_test_3_LDADD) $(LIBS)
+searched_file_test$(EXEEXT): $(searched_file_test_OBJECTS) $(searched_file_test_DEPENDENCIES)
+ @rm -f searched_file_test$(EXEEXT)
+ $(searched_file_test_LINK) $(searched_file_test_OBJECTS) $(searched_file_test_LDADD) $(LIBS)
thin_archive_test_1$(EXEEXT): $(thin_archive_test_1_OBJECTS) $(thin_archive_test_1_DEPENDENCIES)
@rm -f thin_archive_test_1$(EXEEXT)
$(thin_archive_test_1_LINK) $(thin_archive_test_1_OBJECTS) $(thin_archive_test_1_LDADD) $(LIBS)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/script_test_2a.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/script_test_2b.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/script_test_3.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/searched_file_test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmain.Po@am__quote@
@GCC_TRUE@@NATIVE_LINKER_TRUE@ touch $@; \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ chmod 600 $@; \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ basic_test.o
+@GCC_TRUE@@NATIVE_LINKER_TRUE@searched_file_test_lib.o: searched_file_test_lib.cc
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -o $@ $<
+@GCC_TRUE@@NATIVE_LINKER_TRUE@alt/searched_file_test_lib.a: searched_file_test_lib.o
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ test -d alt || mkdir -p alt
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_AR) rc $@ $^
@DEFAULT_TARGET_I386_TRUE@split_i386_1.o: split_i386_1.s
@DEFAULT_TARGET_I386_TRUE@ $(TEST_AS) -o $@ $<
@DEFAULT_TARGET_I386_TRUE@split_i386_2.o: split_i386_2.s
--- /dev/null
+// searched_file_test.cc -- test -l:foo.a for gold
+
+// Copyright 2009 Free Software Foundation, Inc.
+// Written by Chris Demetriou <cgd@google.com>.
+
+// This file is part of gold.
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+// MA 02110-1301, USA.
+
+// The Linux kernel builds an object file using a linker script, and
+// then links against that object file using the -R option. This is a
+// test for that usage.
+
+#include <cstdlib>
+
+extern int zero_from_lib;
+
+int
+main(int, char**)
+{
+ exit(zero_from_lib);
+}
+
--- /dev/null
+// searched_file_test_lib.cc -- test -l:foo.a for gold
+
+// Copyright 2009 Free Software Foundation, Inc.
+// Written by Chris Demetriou <cgd@google.com>.
+
+// This file is part of gold.
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+// MA 02110-1301, USA.
+
+// The Linux kernel builds an object file using a linker script, and
+// then links against that object file using the -R option. This is a
+// test for that usage.
+
+int zero_from_lib = 0;