This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Linker plugins should be aware of --defsym during symbol resolution
>> // The GNU linker lets symbol assignments in the linker script
>> // silently override defined symbols in object files. We are
>> // compatible. FIXME: Should we issue a warning?
>>
>> I think this is a misfeature, and the comment suggests that Ian thought so too.
>
> FWIW, so do I, but see the following in ld/ldexp.c
>
> if (!update_definedness (tree->assign.dst, h) && 0)
> {
> /* Symbol was already defined. For now this error
> is disabled because it causes failures in the ld
> testsuite: ld-elf/var1, ld-scripts/defined5, and
> ld-scripts/pr14962. Some of these no doubt
> reflect scripts used in the wild. */
> (*link_info.callbacks->multiple_definition)
> (&link_info, h, link_info.output_bfd,
> expld.result.section, expld.result.value);
> }
>
> ld-elf/var1 and ld-scripts/pr14962 both came from real-world use by
> a boot loader.
Yeah, I had a feeling it would be problematic to fix it.
-cary