This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix PR ld/24574


> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]