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 08:29:00PM +1000, Erik Christiansen wrote:
> 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"?

No, but I confused the whole issue by careless phrasing.  I'm worried
about the warning that you get "if you use the default linker script,
don't provide _start, and don't specify a different entry point _on
the command line_".  Does that make more sense now?

We have a bunch of powerpc-eabi linker scripts.  If you specify one of
them, you get a specific crt0.o (via STARTUP) and its corresponding
ENTRY(_start).  But if you specify none of them, you get no _start and
the default linker script.  That's not so good.  The result generally
won't run and it generally means you forgot an option and didn't read
the manual.

On Fri, May 04, 2007 at 12:16:43PM +0100, Nick Clifton wrote:
>   2. Change the linker so that if the script specifies an ENTRY symbol
>      and that symbol is not defined then an error occurs.  Presumably
>      we would also provide a new command line option to change this
>      error back to a warning for compatibility with the old behaviour.
>      (The user of the linker may not have the option of fixing the
>      linker script, so without this new option they would be stuck).

Only if they can't specify an entry point either; you could always do
"-e 0" and then the linker would leave you alone.

> > In other words, if you use a custom linker script with no ENTRY,
> > you already (silently) get an entry point of 0.  Does that make
> > the warning->error change OK with you?
> 
> Are you saying here that any linker script that does not define an ENTRY point 
> will result in an error ?  Or just that if the script does not define an ENTRY 
> point then we do not issue a warning or error, so it would be OK to issue an 
> error if the script does define an ENTRY point, but that symbol is not defined 
> ?

The latter, which applies to the case I'm concerned with - default
scripts which specify _start and a missing crt0.

-- 
Daniel Jacobowitz
CodeSourcery


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