Witam.
Z góry przepraszam za dużo linii w poście.
Problem dotyczy GNUARM oraz procka LPC2129.
Mam następujący problem występujący podczas linkowania poniższego kodu:
Jeżeli przez printf lub sprintf chcę przepuścić int'a (czyli w stringu formatującym pojawia się %d), linker rzuca mi następującym błędem:
Może ktoś spotkał się z tym problemem?
Parametry linkera w Makefile:
Oto skrypt linkera:
Z góry przepraszam za dużo linii w poście.
Problem dotyczy GNUARM oraz procka LPC2129.
Mam następujący problem występujący podczas linkowania poniższego kodu:
int main()
{
char bufor[256];
unsigned int i = 0;
IODIR0 = 0xFF000000;
IODIR1 = 0x00FF0000;
UART0_init();
while (1)
{
sprintf(bufor, "ZONK %d \n", i);
UART0_sendString(bufor);
delay(2*del_l);
}
return 0;
}
Jeżeli przez printf lub sprintf chcę przepuścić int'a (czyli w stringu formatującym pojawia się %d), linker rzuca mi następującym błędem:
arm-elf/bin/ld: section .bss [00000828 -> 0000091b] overlaps section .text [00000000 -> 00008433]
Może ktoś spotkał się z tym problemem?
Parametry linkera w Makefile:
LDFLAGS += -nostartfiles -T$(SCRIPTLINK).ld -Wl,-Map=$(TARGET).map,--cref
Oto skrypt linkera:
/* Plik konfiguracyjny linkera dla LPC2142
Program umiesczony w pamieci FLASH
*/
/* Konfiguracja pamieci */
MEMORY
{
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x0003E000
RAM (rw) : ORIGIN = 0x40000000, LENGTH = 0x00004000
}
/* Definicje poszczegolnych sekcji */
SECTIONS
{
/* Sekcja .text zawiera kod programu */
. = 0;
.text :
{
*boot.o (.text) /* Startup code */
*(.text) /* remaining code */
*(.text.*)
*(.glue_7t)
*(.glue_7)
*(.gnu.linkonce.t.*)
*(.gcc_except_table)
} >CODE
. = ALIGN(4);
/* sekcja .rodata zawiera dane stale */
.rodata :
{
*(.rodata)
*(.rodata.*)
*(.gnu.linkonce.r.*)
} >CODE
. = ALIGN(4);
/* sekcja .ctors zawiera konstruktory */
.ctors :
{
PROVIDE(__ctors_start__ = .);
KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors))
PROVIDE(__ctors_end__ = .);
} >CODE
. = ALIGN(4);
/* sekcja .dtors zawiera destruktory */
.dtors :
{
PROVIDE(__dtors_start__ = .);
KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors))
PROVIDE(__dtors_end__ = .);
} >CODE
. = ALIGN(4);
_etext = . ;
PROVIDE (etext = .);
/* sekcja .data zawiera dane zaincjalizowane */
.data : AT (_etext)
{
_data = . ;
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
} >DATA
. = ALIGN(4);
_edata = . ;
PROVIDE (edata = .);
/* .bss sekcja bss zawiera dane niezaincjalizowane */
.bss :
{
__bss_start = . ;
__bss_start__ = . ;
*(.bss)
*(.bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
} >DATA
. = ALIGN(4);
__bss_end__ = . ;
__bss_end__ = . ;
_end = .;
PROVIDE (end = .);
/* Stabs zawiera sekcje debugera */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
}