POSDEP_NOARG('\0', "no-as-needed",
N_("Always DT_NEEDED for dynamic libs (default)"),
NULL, TWO_DASHES, &Position_dependent_options::clear_as_needed),
+ GENERAL_NOARG('\0', "Bsymbolic", N_("Bind defined symbols locally"),
+ NULL, ONE_DASH, &General_options::set_symbolic),
GENERAL_NOARG('E', "export-dynamic", N_("Export all dynamic symbols"),
NULL, TWO_DASHES, &General_options::set_export_dynamic),
GENERAL_NOARG('\0', "eh-frame-hdr", N_("Create exception frame header"),
output_file_name_("a.out"),
is_relocatable_(false),
strip_(STRIP_NONE),
+ symbolic_(false),
create_eh_frame_hdr_(false),
rpath_(),
rpath_link_(),
strip_debug() const
{ return this->strip_ == STRIP_ALL || this->strip_ == STRIP_DEBUG; }
+ // -Bsymbolic: bind defined symbols locally.
+ bool
+ symbolic() const
+ { return this->symbolic_; }
+
// --eh-frame-hdr: Whether to generate an exception frame header.
bool
create_eh_frame_hdr() const
set_strip_debug()
{ this->strip_ = STRIP_DEBUG; }
+ void
+ set_symbolic()
+ { this->symbolic_ = true; }
+
void
set_create_eh_frame_hdr()
{ this->create_eh_frame_hdr_ = true; }
const char* output_file_name_;
bool is_relocatable_;
Strip strip_;
+ bool symbolic_;
bool create_eh_frame_hdr_;
Dir_list rpath_;
Dir_list rpath_link_;
Parameters::Parameters(const General_options* options, Errors* errors)
: errors_(errors), output_file_name_(options->output_file_name()),
- sysroot_(options->sysroot()),
+ sysroot_(options->sysroot()), symbolic_(options->symbolic()),
is_doing_static_link_valid_(false), doing_static_link_(false),
is_size_and_endian_valid_(false), size_(0), is_big_endian_(false),
optimization_level_(options->optimization_level()),
strip_debug() const
{ return this->strip_ == STRIP_ALL || this->strip_ == STRIP_DEBUG; }
+ // Whether we are doing a symbolic link, in which all defined
+ // symbols are bound locally.
+ bool
+ symbolic() const
+ { return this->symbolic_; }
+
// Whether we are doing a static link--a link in which none of the
// input files are shared libraries. This is only known after we
// have seen all the input files.
std::string sysroot_;
// Which symbols to strip.
Strip strip_;
+ // Whether we are doing a symbolic link.
+ bool symbolic_;
// Whether the doing_static_link_ field is valid.
bool is_doing_static_link_valid_;
{
return (this->visibility_ != elfcpp::STV_INTERNAL
&& this->visibility_ != elfcpp::STV_HIDDEN
- && this->visibility_ != elfcpp::STV_PROTECTED);
+ && this->visibility_ != elfcpp::STV_PROTECTED
+ && !parameters->symbolic());
}
// Return whether there should be a warning for references to this