[ECOS] Re: Wrong declaration of idle_thread_stack

Uwe Kindler ukindler@htwm.de
Wed Jan 21 19:12:00 GMT 2004

Hello Andrew,

> assertion never goes off. If this were not true, all the targets in
> eCosCentrics test farm would be failing this test at regular

Do you have an Hitachi H8300 or H8S in your testfarm? - I develop for the
Renesas EDOSK-2674 board with H8S/2674 processor.

> Now, is this really a compiler issue? I think it probably is.  I
> suspect there is lots of code out there in general that assumes a char
> array starts on a word boundary. We could apply your patch, but i
> suspect you will run into trouble some where else. I think maybe you

Well, I executed the h8300-elf-nm command on the file tm_basic after
building the eCos kernel tests. Here are some lines:

0074ef60 b ___mangler_line
0074efc4 B _hal_saved_interrupt_state
0074efc8 B __cyg_hal_compiler_dummy
0074efcc b _cyg_dummy_diag_init_obj
0074efcd b _ZZ9trim_funcPKcE4fbuf
0074f031 b _idle_thread_stack
0074f834 B _idle_thread_loops
0074f838 B _idle_thread
0074f8d8 B __ZN10Cyg_Thread17exception_controlE

The idle thread stack starts at address 0x74f031 - so the assertions will
fail (and they do fail). Now I compiled a very simple and small application
(nothing eCos related):

static char stack01[16];
static char stack02[15];
static char stack03[14];
static char stack04[3];
static char stack05[4];

int main (void)
  for (count=0; count<12; count++)

After building I executed the h8300-elf-nm command again - this is the

00ffc00c b _stack01
00ffc01c b _stack02
00ffc02b b _stack03
00ffc039 b _stack04
00ffc03c b _stack05
0000026e T _start

So the h8300 compiler/linker does not align char arrays to CYG_WORD
boundary. So what can I do?

Regards, Uwe

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

More information about the Ecos-discuss mailing list