aboutsummaryrefslogtreecommitdiff
path: root/ld/pe-dll.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2019-09-05 18:23:37 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2019-09-05 18:23:37 +0200
commitde07a745805b28ed2c973635752719c4a6a32b1d (patch)
tree64c4b7e469a0fd5746b03f777c4e35937dc0e9d4 /ld/pe-dll.c
parent30331a6ca014f6b51b17627aa968c6b79627ce21 (diff)
downloadgdb-de07a745805b28ed2c973635752719c4a6a32b1d.zip
gdb-de07a745805b28ed2c973635752719c4a6a32b1d.tar.gz
gdb-de07a745805b28ed2c973635752719c4a6a32b1d.tar.bz2
Fix PR ld/24574
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.
Diffstat (limited to 'ld/pe-dll.c')
-rw-r--r--ld/pe-dll.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 81ab116..577b911 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -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;