@@ -146,6 +146,11 @@ Options
representation build by Libabigail to represent the ABI and will
not end up in the abi XML file.
+ * ``--no-elf-needed``
+
+ Do not include the list of DT_NEEDED dependency names in the
+ corpus.
+
* ``--drop-undefined-syms``
With this option functions or variables for which the (exported)
@@ -62,6 +62,9 @@ set_write_corpus_path(write_context& ctxt, bool flag);
void
set_write_comp_dir(write_context& ctxt, bool flag);
+void
+set_write_elf_needed(write_context& ctxt, bool flag);
+
void
set_short_locs(write_context& ctxt, bool flag);
@@ -89,6 +92,7 @@ set_common_options(write_context& ctxt, const OPTS& opts)
set_write_architecture(ctxt, opts.write_architecture);
set_write_corpus_path(ctxt, opts.write_corpus_path);
set_write_comp_dir(ctxt, opts.write_comp_dir);
+ set_write_elf_needed(ctxt, opts.write_elf_needed);
set_write_parameter_names(ctxt, opts.write_parameter_names);
set_short_locs(ctxt, opts.short_locs);
set_named_type_ids(ctxt, opts.named_type_ids);
@@ -221,6 +221,7 @@ class write_context
bool m_write_architecture;
bool m_write_corpus_path;
bool m_write_comp_dir;
+ bool m_write_elf_needed;
bool m_write_parameter_names;
bool m_short_locs;
bool m_named_type_ids;
@@ -258,6 +259,7 @@ public:
m_write_architecture(true),
m_write_corpus_path(true),
m_write_comp_dir(true),
+ m_write_elf_needed(true),
m_write_parameter_names(true),
m_short_locs(false),
m_named_type_ids(false)
@@ -316,6 +318,20 @@ public:
set_write_architecture(bool f)
{m_write_architecture = f;}
+ /// Getter of the elf-needed option.
+ ///
+ /// @return true iff elf needed information shall be emitted
+ bool
+ get_write_elf_needed()
+ {return m_write_elf_needed;}
+
+ /// Setter of the elf-needed option.
+ ///
+ /// @param f the new value of the flag.
+ void
+ set_write_elf_needed(bool f)
+ {m_write_elf_needed = f;}
+
/// Getter of the write-corpus-path option.
///
/// @return true iff corpus-path information shall be emitted
@@ -2140,6 +2156,18 @@ void
set_write_parameter_names(write_context& ctxt, bool flag)
{ctxt.set_write_parameter_names(flag);}
+/// Set the 'elf-needed' flag.
+///
+/// When this flag is set then the XML writer will emit corpus
+/// get_needed() (DT_NEEDED) information.
+///
+/// @param ctxt the context to set this flag on to.
+///
+/// @param flag the new value of the 'elf-needed' flag.
+void
+set_write_elf_needed(write_context& ctxt, bool flag)
+{ctxt.set_write_elf_needed(flag);}
+
/// Serialize the canonical types of a given scope.
///
/// @param scope the scope to consider.
@@ -4529,7 +4557,7 @@ write_corpus(write_context& ctxt,
// Write the list of needed corpora.
- if (!corpus->get_needed().empty())
+ if (ctxt.get_write_elf_needed () && !corpus->get_needed().empty())
{
do_indent_to_level(ctxt, indent, 1);
out << "<elf-needed>\n";
@@ -99,6 +99,7 @@ struct options
bool write_architecture;
bool write_corpus_path;
bool write_comp_dir;
+ bool write_elf_needed;
bool write_parameter_names;
bool short_locs;
bool load_all_types;
@@ -121,6 +122,7 @@ struct options
write_architecture(true),
write_corpus_path(true),
write_comp_dir(true),
+ write_elf_needed(true),
write_parameter_names(true),
short_locs(false),
load_all_types(),
@@ -170,6 +172,7 @@ display_usage(const string& prog_name, ostream& out)
<< " --drop-undefined-syms drop undefined symbols from representation\n"
<< " --named_type-ids use id attributes based on type names in XML file\n"
<< " --no-comp-dir-path do not show compilation path information\n"
+ << " --no-elf-needed do not show the DT_NEEDED information\n"
<< " --no-parameter-names do not show names of function parameters\n"
<< " --check-alternate-debug-info <elf-path> check alternate debug info "
"of <elf-path>\n"
@@ -291,6 +294,8 @@ parse_command_line(int argc, char* argv[], options& opts)
opts.short_locs = true;
else if (!strcmp(argv[i], "--no-comp-dir-path"))
opts.write_comp_dir = false;
+ else if (!strcmp(argv[i], "--no-elf-needed"))
+ opts.write_elf_needed = false;
else if (!strcmp(argv[i], "--no-parameter-names"))
opts.write_parameter_names = false;
else if (!strcmp(argv[i], "--check-alternate-debug-info")