[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

coff vs elf on i386


> I am trying to tidy up loose ends for a new snapshot.  The tool transition
> to ELF has left me with a problem on the i386.  The i386 BSP specs needs
> to reference crt[in].o with ELF to make C++ work.  These files are not
> generated by the COFF configuration of the tools.

I have been looking and testing m68k-unknown-elf and came across this
section in the CVS version of binutils. Could this help?

  .ctors   :
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first.  Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard.  The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in.  */
    KEEP (*crtbegin.o(.ctors))
    /* We don't want to include the .ctor section from
       from the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))