public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "simon.kallweit@intefo.ch" <simon.kallweit@intefo.ch>
To: Xie Chun-B19413 <Chun.Xie@freescale.com>
Cc: Nick Garnett <nickg@ecoscentric.com>,   ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] eCos compile problem with arm-none-eabi- toolchain 2008q1
Date: Tue, 21 Oct 2008 11:56:00 -0000	[thread overview]
Message-ID: <48FC59FE.3080908@intefo.ch> (raw)
In-Reply-To: <F9836C7620C3C04AB1FA93D04C8B5AE42722B7@zch01exm26.fsl.freescale.net>

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

      reply	other threads:[~2008-10-20 10:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-07 17:03 [ECOS] eCosCentric Cortex-M port contribution Nick Garnett
2008-10-08  6:37 ` Simon Kallweit
2008-10-08 11:13   ` Nick Garnett
2008-10-08 12:07     ` simon.kallweit
2008-10-08 14:33       ` Nick Garnett
2008-10-10  6:56         ` simon.kallweit
2008-10-20 14:37           ` [ECOS] eCos compile problem with arm-none-eabi- toolchain 2008q1 Xie Chun-B19413
2008-10-21 11:56             ` simon.kallweit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48FC59FE.3080908@intefo.ch \
    --to=simon.kallweit@intefo.ch \
    --cc=Chun.Xie@freescale.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=nickg@ecoscentric.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).