[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NEWLIB and rtems[debugging report on i960KB]



I had sent mail about newlib before and
in that mail I had written that printf() was not working but write() was
working well.
I found the reason why printf() function is not working
and fixed that. And I have some question on that.

What I found is that struct _reent's memory layout in libc.a differ from

memory layout of rtems image.
It is found by tracing deassembled code of libc.a and rtems test image.
The code of newlibc.c of rtems not working with libc.a, perticularly at
_REENT initialization part.

So, I elimiated the below code from libc_init() function in newlibc.c

_REENT = &libc_global_reent;

Then, printf() was working.

Now, what I asking is that the libc.a is compiled not by target
compiler(i960-rtems-gcc)
but by host computer's gcc?
If the libc.a is compiled by host computer's gcc, it maybe means
binary uncompatability between host gcc and gcc for target.
My host environment is redhet 5.3 for alpha and egcs 1.0.3

And another is that I found that newlibc is unnecessary code in the
debugging
because _REENT is not changed with task switch.
Actually, codes that changing _REENT is written in libc_switch_hook()
function but
libc_switch_hook() is not called when task is switched.


Jae-Chul Moon

Graduate school student
School of Electronics and Electrical Engineering,
Kyungpook National University, Korea
e-mail : vgate at palgong.kyungpook.ac.kr