This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos 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: eCos compile problem with arm-none-eabi- toolchain 2008q1


Xie Chun-B19413 wrote:
Hi Simon,
We use arm-none-eabi- toolchain 2008q1 release compile eCos. The
compiler option -mcpu=cortex-a8 was used.
And we met a strange problem. The compiler/linker couldn't
calculate the right offset of the string pointer of function
diag_printf.
For example,

//some code
diag_printf("string_1");
diag_printf("string_2");
//some other diag_printf was called


	diag_printf("string n");			//this function
string pointer will not point to it's "string_n", but it will return to
somewhere of "sting_1"

//other diag_printf was called

The following is the dump of the code.

     2397c:       e3040ffc        movw    r0, #20476      ; 0x4ffc
   23980:       e3400005        movt    r0, #5  ; 0x5
   23984:       eb005229        bl      38230 <diag_printf>
//string pointer points(r0) to 0x54ffc
   23988:       e3040014        movw    r0, #16404      ; 0x4014
   2398c:       e3400005        movt    r0, #5  ; 0x5
   23990:       eb005226        bl      38230 <diag_printf>
//string pointer points(r0) to 0x54014, it returns to the origin address
of .rodata,where stores all the strings.
	
//actrually this pointer should point to an address behind 0x54ffc.



Disassembly of section .rodata:
00054008 <__func__.3237-0x18fc>:
54008: 636c6557 5400c: 20656d6f 54010: 46206f74 54014: 73656572



And arm-none-eabi- toolchain 2008q3 release could compile this code correctly.

But we still want to know the reason of this problem. We hope you could
help us.

I actually have no explanation for the behavior. I also posted to the codesourcery list, but didn't get an answer. To continue development I switched to the arm toolchain from zylin, and now I'm working with both the new codesourcery release and the zylin toolchain, which both don't show this problem. So unfortunately, I cannot really help you.


Simon


-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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