[Top][All Lists]

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

[avr-gcc-list] redefining __init / start

From: Torsten Mohr
Subject: [avr-gcc-list] redefining __init / start
Date: Fri, 29 Jul 2005 21:45:21 +0200
User-agent: KMail/1.8


i got all your hints for the bootloader start/initialisation
and now try to redirect the reset vector to an own function
to set a certain byte to mark that the startup cause was a
real reset.

I still use avr-libc and no own linker script.

Whatever i try to redirect the reset vector to another function
fails, when i look into the final list file (generated with
avr-objdump -h -S) fails, at location 0x1e000 there's still
an "rjmp __init".

I tried:

# Always:
avr-gcc \
-Wl,--section-start=.text=0x1e000 \
-Wl,-Tdata=0x800900,--defsym=__heap_end=0x8010ff \
-Wl,--defsym,__stack=0x08fe \

# and additionally:
-Wl,--defsym,__vector_0=reset_vector \

-Wl,--defsym,__init=reset_vector \

-Wl,--wrap,__init \
# i also rewrote my startup code to use __wrap___init
and __real___init

-Wl,--entry,start \

I did not find any reference in /opt/avr/avr/lib/ldscripts
to "entry", "start" or "init".  In avr-libcs gcrt1.S in function
__vectors in section .vectors it starts with an XJMP __init and
__init is set to be .weak __init.  So i understand that the
standard symbol "start" is not used, but why overwriting __init
did not work i don't know.  Also --wrap should have worked,
especially as avr-nm shows this:

address@hidden:~/p/avr/fbl> avr-nm obj/fbl_start.o | grep init
         U __init
         U __real___init
00000000 T __wrap___init

address@hidden:/opt/avr/avr/lib> avr-nm crtm128.o | grep init
00000000 W __init

Is there a way to redirect __init without own linker script?

Best regards,

reply via email to

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