Hallo,
ich hab' jetzt einen halben Tag lang gegoogled und probiert, und komme
nicht weiter:
ich habe in mehreren .c files einige Funktionen mit
__attribute__((section(".xbootloader"))) versehen.
der GCC aufruf zum linken lautet:
1 | avr-gcc fb_prot.o fb_bootloader.o msg_queue.o fb_hal.o fbrf_hal.o fbrf_prot.o rf22.o Spi.o
|
2 | -Wl,-Map,fb-bootloader.out.map -mmcu=atmega328p -lm -Wl,--section-start=.xbootloader=0x1000
|
3 | -Wl,--section-start=.text=0x7000 -o fb-bootloader.out
|
danach stehen die .xbootloader funktionen von fb_prot.o wie gewünscht
auf 0x1000.
1 | .xbootloader 0x00001000 0x3e0
|
2 | .xbootloader 0x00001000 0x3e0 fb_prot.o
|
3 | 0x0000123a fbprot_msg_handler
|
4 | 0x000013c8 fbprot_Init
|
die funktionen aus fb_bootloader.o z.B. jedoch nicht, sie werden hinten
an .text angehängt:
1 | .xbootloader 0x00007e96 0x15c
|
2 | .xbootloader 0x00007e96 0x15c fb_bootloader.o
|
3 | 0x00007e96 jumpToApplication
|
4 | 0x00007edc restartApplication
|
5 | 0x00007ee0 runApplication
|
6 | 0x00007f6a main
|
wenn ich im gcc aufruf fb_bootloader.o nach vorn schiebe, ist es genau
umgekehrt. --section-start wird also offenbar nur das erste .o file
angewendet.
Wie bekomme ich den gcc dazu, alle .o files zu berücksichtigen?
Gruß,
tuxbow.