]> Cypherpunks repositories - gostls13.git/commit
liblink: fail for too-large register offset constants
authorAustin Clements <austin@google.com>
Thu, 18 Dec 2014 16:40:48 +0000 (11:40 -0500)
committerAustin Clements <austin@google.com>
Thu, 18 Dec 2014 22:32:18 +0000 (22:32 +0000)
commit9b1b0a46dd3c9704a49a5ba1950212c6fff7917d
treed5fd9a5657ed8e5332e226498038fa33bf354d3e
parent15c67e21daee0a5055c8fc0144e7efe0345d1929
liblink: fail for too-large register offset constants

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/1758
Reviewed-by: Minux Ma <minux@golang.org>
src/cmd/9l/9.out.h
src/liblink/asm9.c