• Austin Clements's avatar
    liblink: fail for too-large register offset constants · 9b1b0a46
    Austin Clements authored
    Previously, liblink would silently truncate register offset constants
    to 32 bits.  For example,
    
        MOVD $0x200000004(R2),R3
    
    would assemble to
    
        addis   r31,r2,0
        addi    r3,r31,4
    
    To fix this, limit C_LACON to 32 bit (signed) offsets and introduce a
    new C_DACON operand type for larger register offsets.  We don't
    implement this currently, but at least liblink will now give an error
    if it encounters an address like this.
    
    Change-Id: I8e87def8cc4cc5b75498b0fb543ac7666cf2964e
    Reviewed-on: https://go-review.googlesource.com/1758Reviewed-by: 's avatarMinux Ma <minux@golang.org>
    9b1b0a46
9.out.h 7.48 KB