33.5.1. gem5 semihosting
For gem5, you need patches/manual/gem5-semihost.patch:
patch -d "$(./getvar gem5_source_dir)" -p 1 < patches/manual/gem5-semihost.patch
https://stackoverflow.com/questions/52475268/how-to-enable-arm-semihosting-in-gem5/52475269#52475269