How to catch data-alignment faults on x86 (aka SIGBUS on Sparc)

前端 未结 6 990
耶瑟儿~
耶瑟儿~ 2020-12-25 15:30

Is it somehow possible to catch data-alignment faults even on i386? Maybe by setting a i386 specific machine register or something like that.

On Solaris-Sparc I am r

6条回答
  •  伪装坚强ぢ
    2020-12-25 16:01

    Intel built in unaligned transfers from the start - it was one of the selling points when x86 was brand new. I understand your reasons for wanting to trap unaligned access, but I don't think it's possible.

    Edit: very glad to be proven wrong.

提交回复
热议问题