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 Fri, May 04, 2007 at 09:28:02AM +0100, Richard Sandiford wrote:
> 
> Ah, it seems we're talking about different cases then.
> 
> The default linker scripts already have "ENTRY(_start);" (or a target-
> specific equivalent).  The angle I was coming from -- and I think Dan
> was coming from -- is that that's a good thing.  You should get an error
> if you use the default linker script and don't provide a definition of
> its designated entry point.  You should also get an error if your
> custom linker script has "ENTRY (foo)" and you don't define foo.
> It sounds like you're OK with that.  (This is the bit that Ian says
> will break existing builds though.  The user has blindly copied the
> ENTRY statement from the default linker script, hasn't defined the
> symbol, and is currently ignoring what is only a warning.)

Yep, if that hurts, the user should stop doing it. :-)

Then Dan's original case:
On Mon, 30 Apr 2007, Daniel Jacobowitz wrote:
daniel> While we're on the subject of errors, it bugs me that the linker warns
daniel> and auto-selects an address if you don't provide _start or specify an
daniel> entry point.  How do you feel about making that fatal?

already requires active excision of an existing defensive
"ENTRY(_start);" when customising a project's linker script, in order to
create the "problem"?

OK, now answering your immediately following update post:

> In other words, if you use a custom linker script with no ENTRY,
> you already (silently) get an entry point of 0.

That seems to be the historically established behaviour, documented in
the info page (though the copy I have first sneaks in:
* the address of the first byte of the `.text' section, if present; )

> Does that make the warning->error change OK with you?

An error on failure to honour an explicit ENTRY() would be a good thing,
also where it results in a trivial clean-up in an old build.

IIUC, silent linker default is the source of Dan's irritation. Changing
that silence to fatal error would be _much_ less kind. That's the only
one I'm wary of. Have I misunderstood Dan's intent?

Avagoodweegend,
Erik
(Who's the last one out the door again, on POETS day. ;-)


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