mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 15:18:37 +08:00
Ignore version scripts for relocatable links.
This commit is contained in:
10
gold/main.cc
10
gold/main.cc
@ -166,6 +166,16 @@ main(int argc, char** argv)
|
|||||||
write_debug_script(command_line.options().output_file_name(),
|
write_debug_script(command_line.options().output_file_name(),
|
||||||
program_name, args.c_str());
|
program_name, args.c_str());
|
||||||
|
|
||||||
|
// The GNU linker ignores version scripts when generating
|
||||||
|
// relocatable output. If we are not compatible, then we break the
|
||||||
|
// Linux kernel build, which uses a linker script with -r which must
|
||||||
|
// not force symbols to be local. It would actually be useful to
|
||||||
|
// permit symbols to be forced local with -r, though, as it would
|
||||||
|
// permit some linker optimizations. Perhaps we need yet another
|
||||||
|
// option to control this. FIXME.
|
||||||
|
if (parameters->output_is_object())
|
||||||
|
command_line.script_options()->version_script_info()->clear();
|
||||||
|
|
||||||
// The work queue.
|
// The work queue.
|
||||||
Workqueue workqueue(command_line.options());
|
Workqueue workqueue(command_line.options());
|
||||||
|
|
||||||
|
@ -1738,13 +1738,22 @@ struct Version_tree {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Version_script_info::~Version_script_info()
|
Version_script_info::~Version_script_info()
|
||||||
|
{
|
||||||
|
this->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Version_script_info::clear()
|
||||||
{
|
{
|
||||||
for (size_t k = 0; k < dependency_lists_.size(); ++k)
|
for (size_t k = 0; k < dependency_lists_.size(); ++k)
|
||||||
delete dependency_lists_[k];
|
delete dependency_lists_[k];
|
||||||
|
this->dependency_lists_.clear();
|
||||||
for (size_t k = 0; k < version_trees_.size(); ++k)
|
for (size_t k = 0; k < version_trees_.size(); ++k)
|
||||||
delete version_trees_[k];
|
delete version_trees_[k];
|
||||||
|
this->version_trees_.clear();
|
||||||
for (size_t k = 0; k < expression_lists_.size(); ++k)
|
for (size_t k = 0; k < expression_lists_.size(); ++k)
|
||||||
delete expression_lists_[k];
|
delete expression_lists_[k];
|
||||||
|
this->expression_lists_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string>
|
std::vector<std::string>
|
||||||
|
@ -118,6 +118,10 @@ class Version_script_info
|
|||||||
public:
|
public:
|
||||||
~Version_script_info();
|
~Version_script_info();
|
||||||
|
|
||||||
|
// Clear everything.
|
||||||
|
void
|
||||||
|
clear();
|
||||||
|
|
||||||
// Return whether any version were defined in the version script.
|
// Return whether any version were defined in the version script.
|
||||||
bool
|
bool
|
||||||
empty() const
|
empty() const
|
||||||
|
Reference in New Issue
Block a user