#include "obstack.h"
#include "bfdlink.h"
#include "ctf-api.h"
-
#include "ld.h"
#include "ldmain.h"
#include "ldexp.h"
#include "demangle.h"
#include "hashtab.h"
#include "elf-bfd.h"
+#include "bfdver.h"
+
#if BFD_SUPPORTS_PLUGINS
#include "plugin.h"
-#endif /* BFD_SUPPORTS_PLUGINS */
+#endif
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) & (((TYPE*) 0)->MEMBER))
bool had_output_filename = false;
bool lang_float_flag = false;
bool delete_output_file_on_failure = false;
+bool enable_linker_version = false;
struct lang_phdr *lang_phdr_list;
struct lang_nocrossrefs *nocrossref_list;
struct asneeded_minfo **asneeded_list_tail;
lang_end ();
}
+void
+lang_add_version_string (void)
+{
+ if (! enable_linker_version)
+ return;
+
+ const char * str = "GNU ld ";
+ int len = strlen (str);
+ int i;
+
+ for (i = 0 ; i < len ; i++)
+ lang_add_data (BYTE, exp_intop (str[i]));
+
+ str = BFD_VERSION_STRING;
+ len = strlen (str);
+
+ for (i = 0 ; i < len ; i++)
+ lang_add_data (BYTE, exp_intop (str[i]));
+
+ lang_add_data (BYTE, exp_intop ('\0'));
+}
+
/* EXPORTED TO YACC */
void