This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] Use .init_array, .fini_array sections for ARM EABI (broke-target=avr)


On Sat, 30 Apr 2005, Mark Mitchell wrote:

> Joseph S. Myers wrote:
> 
> > /usr/ccs/bin/ld: Unsatisfied symbols:
> >    __main (first referenced in build/genmodes.o) (code)
> > collect2: ld returned 1 exit status
> > make[2]: *** [build/genmodes] Error 1
> 
> Has this configuration always used __main, but now we fail to define it?  Or
> are we now calling it where before we did not?

Previously (with a 2005-04-29 compiler), "int main(){return 0;}" compiles 
to code not calling __main.  Now (with a 2005-04-30 compiler) it compiles 
to code calling __main.

Old:

        .LEVEL 1.1
        .SPACE $PRIVATE$
        .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
        .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
        .SPACE $TEXT$
        .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
        .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
        .IMPORT $global$,DATA
        .IMPORT $$dyncall,MILLICODE
        .SPACE $TEXT$
        .NSUBSPA $CODE$
        .align 4
        .EXPORT main,ENTRY,PRIV_LEV=3,RTNVAL=GR
main
        .PROC
        .CALLINFO FRAME=64,NO_CALLS,SAVE_SP,ENTRY_GR=3
        .ENTRY
        copy %r3,%r1
        copy %r30,%r3
        stwm %r1,64(%r30)
        stw %r3,-4(%r30)
        ldi 0,%r28
        ldo 64(%r3),%r30
        ldwm -64(%r30),%r3
        bv,n %r0(%r2)
        .EXIT
        .PROCEND

New:

        .LEVEL 1.1
        .SPACE $PRIVATE$
        .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
        .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
        .SPACE $TEXT$
        .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
        .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
        .IMPORT $global$,DATA
        .IMPORT $$dyncall,MILLICODE
        .IMPORT __main,CODE
        .SPACE $TEXT$
        .NSUBSPA $CODE$
        .align 4
        .EXPORT main,ENTRY,PRIV_LEV=3,RTNVAL=GR
main
        .PROC
        .CALLINFO FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
        .ENTRY
        stw %r2,-20(%r30)
        copy %r3,%r1
        copy %r30,%r3
        stwm %r1,64(%r30)
        stw %r3,-4(%r30)
        .CALL 
        bl __main,%r2
        nop
        ldi 0,%r28
        ldw -20(%r3),%r2
        ldo 64(%r3),%r30
        ldwm -64(%r30),%r3
        bv,n %r0(%r2)
        .EXIT
        .PROCEND

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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