]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix PR ld/24574
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 5 Sep 2019 16:23:37 +0000 (18:23 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 5 Sep 2019 16:35:18 +0000 (18:35 +0200)
This restores a line that has been dropped when the auto-import feature
of the PE-COFF linker was overhauled about one year.  It is necessary
for GDB to properly resolve extern symbol in DLLs.

ld/ChangeLog
* pe-dll.c (pe_find_data_imports): Replace again the original name
of the undefined symbol with the __imp_ prefixed one after it is
resolved.

ld/ChangeLog
ld/pe-dll.c

index 9f7771d8845f68f3882cfc7fdaa9ba80664a624e..ef1f5446c0c3388487b649af78aa6ef289f406de 100644 (file)
@@ -1,3 +1,9 @@
+2019-09-05  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR ld/24574
+       * pe-dll.c (pe_find_data_imports): Replace again the original name of
+       the undefined symbol with the __imp_ prefixed one after it is resolved.
+
 2019-08-28  Tamar Christina  <tamar.christina@arm.com>
 
        Backported from mainline.
index 81ab116c46abce7bcc720b7d40ba313943ed99cd..577b911da8a6ffb5b845fee6c4789da1da169c47 100644 (file)
@@ -1445,6 +1445,11 @@ pe_find_data_imports (const char *symhead,
            undef->u.def.value = sym->u.def.value;
            undef->u.def.section = sym->u.def.section;
 
+           /* We replace the original name with the __imp_ prefixed one, this
+              1) may trash memory 2) leads to duplicate symbols.  But this is
+              better than having a misleading name that can confuse GDB.  */
+           undef->root.string = sym->root.string;
+
            if (link_info.pei386_auto_import == -1)
              {
                static bfd_boolean warned = FALSE;