avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] Startup code.


From: Robert von Knobloch
Subject: Re: [avr-chat] Startup code.
Date: Wed, 22 Sep 2010 16:37:37 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

OK Erik,

why did I not just make linker script the second I saw that you had
replied??
I must be getting stupid, or something.
I just removed ,init1 & .init2 from the linker script and replaced it
with my own code in a new section.
Only small thing is, that if my code:
================================================================
void init(void)  __attribute__((naked)) __attribute__((section
(".nkinit")));

void init(void)
{
    __asm volatile ("       eor r1, r1\n"
                    "       out 0x3f, r1");
}
================================================================
does not actually exist (e.g. comment it out, the linker does not throw
any kind of error (not even an incomprehensible one!!), the code is, of
course, missing from the output.
Any idea how to error-trap this & make the linker throw up ??
Linker script snippet is:
================================================================
    /* From this point on, we don't bother about wether the insns are
       below or above the 16 bits boundary.  */
    *(.init0)  /* Start here after reset.  */
    KEEP (*(.init0)) */
    *(.nkinit)
    KEEP (*(.nkinit))
    /* *(.init1) */
    /* KEEP (*(.init1))
    /* *(.init2)  /* Clear __zero_reg__, set up stack pointer.  */
    /* KEEP (*(.init2)) */
    *(.init3)
    KEEP (*(.init3))
================================================================
BTW, I admit I don't know what KEEP means (manpage && google doesnt help
either).

Cheers,

Robert



reply via email to

[Prev in Thread] Current Thread [Next in Thread]