This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RE: [PATCH 2/2] MIPS16: MIPS16 support proper
On Sat, 2013-01-26 at 00:31 +0000, Maciej W. Rozycki wrote:
> On Fri, 25 Jan 2013, Steve Ellcey wrote:
>
> > > Please also note that as I mentioned along the patch submission mixing
> > > execution modes in static constructors or destructors installed as single
> > > lumps of code (that is with the use of the DT_INIT or DT_FINI dynamic
> > > tags) cannot be supported. Can you run `objdump -j .init -j .fini -d' on
> > > your binary and make sure the disassembly looks right?
> >
> > Mine looks a bit different, this is the .init and .fini from a
> > dynamically linked big endian hello world program, I am not sure where
> > the addiu instructions are coming from.
>
> You have some standard MIPS code there, this is not ever going to work
> unless we switch to DT_INIT_ARRAY and DT_FINI_ARRAY
> constructors/destructors. Until then you need to rebuild the relevant
> sources as MIPS16 code.
OK, I see where this is happening now. crti (from glibc) is mips16 and
crtbegin (from gcc) is mips32. crtbegin is mips32 because it uses
CRT_CALL_STATIC_FUNCTION and that has '.nomips16' in it. I am not sure
how to rewrite CRT_CALL_STATIC_FUNCTION in mips16 to avoid this and it
looks like the codesourcery version of GCC is handling this by making
all .init/.fini code mips32 instead of mips16. So, should I try to make
crti use a mips32 .init or make crtbegin use a mips16 .init? I am not
sure which is better.
Steve Ellcey
sellcey@mips.com