+2015-06-15 Nick Clifton <nickc@redhat.com>
+
+ PR ld/18466
+ * emultempl/pe.em (pe_find_data_imports): Generate an error if a
+ symbol name is too long to handle.
+ * emultempl/pep.em (pep_find_data_imports): Likewise.
+
2015-06-12 Tristan Gingold <gingold@adacore.com>
* NEWS: Mention new option.
if (undef->type == bfd_link_hash_undefined)
{
/* C++ symbols are *long*. */
- char buf[4096];
+#define BUF_SIZE 4096
+ char buf[BUF_SIZE];
if (pe_dll_extra_pe_debug)
printf ("%s:%s\n", __FUNCTION__, undef->root.string);
+ if (strlen (undef->root.string) > (BUF_SIZE - 6))
+ {
+ /* PR linker/18466. */
+ einfo (_("%P: internal error: symbol too long: %s\n"),
+ undef->root.string);
+ return;
+ }
+
sprintf (buf, "__imp_%s", undef->root.string);
sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1);
if (undef->type == bfd_link_hash_undefined)
{
/* C++ symbols are *long*. */
- char buf[4096];
+#define BUF_SIZE 4096
+ char buf[BUF_SIZE];
if (pep_dll_extra_pe_debug)
printf ("%s:%s\n", __FUNCTION__, undef->root.string);
+ if (strlen (undef->root.string) > (BUF_SIZE - 6))
+ {
+ /* PR linker/18466. */
+ einfo (_("%P: internal error: symbol too long: %s\n"),
+ undef->root.string);
+ return;
+ }
+
sprintf (buf, "__imp_%s", undef->root.string);
sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1);