Skip to content
  • Benedikt Huber's avatar
    Fix gcc inline assembler operand constraints for syscall -- as pushl modifies... · ea904493
    Benedikt Huber authored
    Fix gcc inline assembler operand constraints for syscall -- as pushl modifies %esp, variable operands must not reference the stack pointer.
    
    Without this patch, gcc-4.6.1-9ubuntu3 miscompiles the read syscall to:
      000000b6 <read>:
        b6:   ff 74 24 0c             pushl  0xc(%esp)
        ba:   ff 74 24 08             pushl  0x8(%esp)  ; [!]
        be:   ff 74 24 04             pushl  0x4(%esp)  ; [!]
        ...
    ea904493