This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ld/ldlang.c: fatal error on architecture mismatch
Ian Lance Taylor <iant@google.com> writes:
> Richard Sandiford <richard@codesourcery.com> writes:
>> I don't think we can say the user has ditched the entry point if they
>> are still using a linker script that explicitly says "set the entry point
>> to this". Ignoring the linker script really violates the POLA for me.
>
> Just a comment on this: our default linker scripts set ENTRY, and many
> people copy them blindly.
Right. I think that's really the situation that motivated
Dan's original comment. The default linker scripts are based
on a particular entry point (and particular sections related
to it). If you accidentally use them instead of the linker
script for your board, or forget to use an appropriate crt0.o
file, the worst you get is a warning.
If you explicitly want a different set-up from the default linker
script, I think it's reasonable to ask people to use a custom linker
script. And if their custom linker script requests an entry point
that they don't define, I think that's just as good a reason to
issue an error as a reference to an undefined symbol elsewhere in
the script. After all, if you really want to make the entry symbol
optional, you can use PROVIDE to provide a default value.
Richard