On 14.11.2010 18:50, Peter Maydell wrote: > Although newlib/libgloss use different modes for opening stdout > and stderr, the ARM C library implementation does not, for > instance; so your patch is relying on a detail of implementation of > a particular semihosting user. So I don't think we can apply this > patch, because it could break other (nonlibgloss) users of > semihosting. >
Thanks for your answer. I think we could argue it's a bug in the ARM semihosting spec, so maybe we could request them to change this. However, I am unsure how to do this efficiently, as I recently tried with little success to have them change the "angel_SWIreason_ReportException" such that at least ADP_Stopped_AplicationExit can have the program return code as an extra parameter... (anyway I have another small Qemu patch to handle this situation by returning the contents of r0 when the program entered exit(). I can submit it if someone is willing to review it). Christophe.