This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Fix PR ld/24574
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 06 Sep 2019 09:24:05 +0200
- Subject: Re: [patch] Fix PR ld/24574
- References: <2353376.kH97uzeIrP@polaris> <20190906001016.GI30165@bubble.grove.modra.org>
> "may trash memory" is alarmist. Replacing a pointer to a string
> (typically in memory containing a copy of .strtab or .dynstr) with a
> pointer to another string won't "trash memory".
Yes, that's probably the reason why I initially removed the line. I guess
that ideally we would need to make this previously undefined symbol hidden
or anonymous if this is possible. For the time being the code reads:
/* Let's differentiate it somehow from defined. */
undef->type = bfd_link_hash_defweak;
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;
--
Eric Botcazou