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] ld/ldlang.c: fatal error on architecture mismatch


On Wed, May 02, 2007 at 08:19:13AM +0100, Nick Clifton wrote:
> Hi Guys,
> 
> >>>>>While we're on the subject of errors, it bugs me that the linker warns
> >>>>>and auto-selects an address if you don't provide _start or specify an
> >>>>>entry point.  How do you feel about making that fatal?
> 
> >Fair enough, I'll rephrase.  The change would break a number of
> >embedded builds.  Whether that is a bad idea or not, I don't know.
> 
> I strongly suspect that if we make this change then in the cases where 
> entry points are not being specified at the moment the programmers will 
> just add "-e 0" to the command line.  ie they will not set a real start 
> address because they do not want to (or do not have one), they will just 
> add a switch to the command line to shut the linker up.
> 
> I see no good reason to break embedded builds in this way.  If it really 
> matters that the linker refuses to build a binary without a start 
> address then you can add the "--fatal-warnings" switch to the command 
> line.  So my vote is against changing the linker's current behaviour.

It's hard not to agree.

When using gcc with "-nostartfiles", whether _start or ENTRY() exist is
explicitly up to the programmer.

For the linker to have a vestigial fixation on a named entry point, when
the rest of the toolchain and the user have ditched it, would seem to
violate POLA?

That said, I have to admit to usually labelling my reset vector
"_start", but that's just habit.

Cheers,
Erik


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