When running baremetal binaries under qemu (as discussed in the other thread), malloc is returning NULL. Is this expected in this configuration?
Vadim
-- Senior Research Associate Department of Computer Science and Technology University of Cambridge http://zaliva.org/
Hi,
On 04/07/2022 20:40, Vadim Zaliva via Gnu-morello wrote:
When running baremetal binaries under qemu (as discussed in the other thread), malloc is returning NULL. Is this expected in this configuration?
Well, nothing has been tested in this configuration, so it's not too surprising that things are broken.
Thanks for reporting the problems (both the lack of clean termination on exceptions and malloc returning NULL), I can reproduce both in QEMU. Note that neither issue happens when runninng in the FVP, however.
I'll try and debug the problems you've hit in QEMU to see what's going on.
Thanks, Alex
Vadim
-- Senior Research Associate Department of Computer Science and Technology University of Cambridge http://zaliva.org/
On 05/07/2022 10:05, Alex Coplan via Gnu-morello wrote:
Hi,
On 04/07/2022 20:40, Vadim Zaliva via Gnu-morello wrote:
When running baremetal binaries under qemu (as discussed in the other thread), malloc is returning NULL. Is this expected in this configuration?
Well, nothing has been tested in this configuration, so it's not too surprising that things are broken.
Thanks for reporting the problems (both the lack of clean termination on exceptions and malloc returning NULL), I can reproduce both in QEMU. Note that neither issue happens when runninng in the FVP, however.
I'll try and debug the problems you've hit in QEMU to see what's going on.
So the malloc problem turned out to be a bug in the newlib startup code that meant we ended up with an invalid heap capability when running under QEMU. I've pushed a fix to newlib here: https://git.morello-project.org/morello/newlib/-/commit/67fd37136e44556cd039...
So the issue should be fixed in the next toolchain binary release. In the meantime, you may be able to re-build crt0.S yourself and override the link command to use the patched version.
Thanks, Alex
Thanks, Alex
Vadim
-- Senior Research Associate Department of Computer Science and Technology University of Cambridge http://zaliva.org/
-- Gnu-morello mailing list -- gnu-morello@op-lists.linaro.org To unsubscribe send an email to gnu-morello-leave@op-lists.linaro.org
gnu-morello@op-lists.linaro.org