aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2011-07-03 04:46:56 +0000
committerIan Lance Taylor <ian@airs.com>2011-07-03 04:46:56 +0000
commit886288f10bd9d10fb446191e5266154c38f0cbad (patch)
tree26e8bfbc8ec2337e1c3f4212b8a1aa54f46c88d7 /gold
parentae3a6d4fa3cfdf9daa38946945b2a6aa0c0e9fa8 (diff)
downloadbinutils-886288f10bd9d10fb446191e5266154c38f0cbad.zip
binutils-886288f10bd9d10fb446191e5266154c38f0cbad.tar.gz
binutils-886288f10bd9d10fb446191e5266154c38f0cbad.tar.bz2
PR gold/12957
* options.h (class General_options): Add -f and -F. * options.cc (General_options::finalize): Fatal error if -f/-F are used without -shared. * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog8
-rw-r--r--gold/layout.cc14
-rw-r--r--gold/options.cc8
-rw-r--r--gold/options.h8
4 files changed, 36 insertions, 2 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 4ac6808..fdedd86 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,13 @@
2011-07-02 Ian Lance Taylor <iant@google.com>
+ PR gold/12957
+ * options.h (class General_options): Add -f and -F.
+ * options.cc (General_options::finalize): Fatal error if -f/-F
+ are used without -shared.
+ * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
+
+2011-07-02 Ian Lance Taylor <iant@google.com>
+
* dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2011-07-01 Ian Lance Taylor <iant@google.com>
diff --git a/gold/layout.cc b/gold/layout.cc
index 11dbbef..e6fd7e5 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -4218,8 +4218,18 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
}
}
- // Add a DT_FLAGS entry. We add it even if no flags are set so that
- // post-link tools can easily modify these flags if desired.
+ if (parameters->options().filter() != NULL)
+ odyn->add_string(elfcpp::DT_FILTER, parameters->options().filter());
+ if (parameters->options().any_auxiliary())
+ {
+ for (options::String_set::const_iterator p =
+ parameters->options().auxiliary_begin();
+ p != parameters->options().auxiliary_end();
+ ++p)
+ odyn->add_string(elfcpp::DT_AUXILIARY, *p);
+ }
+
+ // Add a DT_FLAGS entry if necessary.
unsigned int flags = 0;
if (have_textrel)
{
diff --git a/gold/options.cc b/gold/options.cc
index 50fc557..f1dc1cb 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -1166,6 +1166,14 @@ General_options::finalize()
if (this->pie() && this->relocatable())
gold_fatal(_("-pie and -r are incompatible"));
+ if (!this->shared())
+ {
+ if (this->filter() != NULL)
+ gold_fatal(_("-F/--filter may not used without -shared"));
+ if (this->any_auxiliary())
+ gold_fatal(_("-f/--auxiliary may not be used without -shared"));
+ }
+
// TODO: implement support for -retain-symbols-file with -r, if needed.
if (this->relocatable() && this->retain_symbols_file())
gold_fatal(_("-retain-symbols-file does not yet work with -r"));
diff --git a/gold/options.h b/gold/options.h
index 506c376..57d5810 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -735,6 +735,14 @@ class General_options
N_("(ARM only) Do not warn about objects with incompatible "
"enum sizes"));
+ DEFINE_set(auxiliary, options::TWO_DASHES, 'f',
+ N_("Auxiliary filter for shared object symbol table"),
+ N_("SHLIB"));
+
+ DEFINE_string(filter, options::TWO_DASHES, 'F', NULL,
+ N_("Filter for shared object symbol table"),
+ N_("SHLIB"));
+
DEFINE_bool(fatal_warnings, options::TWO_DASHES, '\0', false,
N_("Treat warnings as errors"),
N_("Do not treat warnings as errors"));