[uClinux-dev] file(1) bflt entry

Philippe De Muyter phdm at macqel.be
Fri Mar 28 04:46:00 EST 2003


Greg Ungerer wrote :
> Hi Philippe,
> 
> Philippe De Muyter wrote:
> >>Jivin Philippe De Muyter lays it down ...
> >>
> >>>>>68    belong          0x4e714e71      m68k,
> > 
> > 
> > I wonder why with the latest elf-tools, crt0 begins at 68 decimal and is
> > preceded by four 0 bytes, while with some ancient version of the elf-tools
> > (I do not know precisely which one) crt0 started at 64 decimal, i.e. just
> > after the header.  Is that change intentional ? (we consume 4 bytes more
> > per executable :) ).
> 
> That is an intentional change. It has to do with constructors/
> destructors table and c++. To find out why read the comments
> in uClinux-2.4.x/fs/binfmt_flat.c around line 756...

If I understand correctly, it seems to me that for m68k at least this
problem has been fixed twice; m68k/crt0.S already begins with :

	    .text

	    nop
	    nop
    _start: /* put here so that references to _start work with elf-PIC */

	    movea.l %d5, %a5        /* uClinux passes in data segment here */

The two nop's are at offset 68, and have value 0x4e714e71.
What I asked for was the 0 at offset 64.

> 
> 
> >>># I do not know what the other magic values and platforms are (arm e.g.)
> > 
> > 
> > If people using other processors (arm e.g.) could tell me what's found at
> > 64 or 68 decimal (if it is constant of course), I could add that to
> > recognize that processor too.
> 
> I would be a little hesitant to rely on the first few bytes
> of code to recognize the processor type though. Although it
> doesn't change often, it could still change.

I'd be glad to have a processor info in the header, but I haven't find
one.

> 
> Regards
> Greg
> 
> 
> 
> ------------------------------------------------------------------------
> Greg Ungerer  --  Chief Software Wizard        EMAIL:  gerg at snapgear.com
> SnapGear Pty Ltd                               PHONE:    +61 7 3435 2888
> 825 Stanley St,                                  FAX:    +61 7 3891 3630
> Woolloongabba, QLD, 4102, Australia              WEB:   www.SnapGear.com
> 
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org
> 




More information about the uClinux-dev mailing list