Sparc v7 has no multiplication instruction so a .mul function is used to do the multiplication. Typically dynamic linker detects v8 and interposes a DSO where .mul is implemented using the v8 multiplication instruction.
Unfortunately the NetBSD .mul stub doesn't follow the ABI. .mul is defined to return the upper bits in %o1, but smul instruction returns it in %y. Nothing in the gcc generated code uses the upper half, but Self does and garbage in %o1 makes it think multiplication failed.
As a quick kludge provide and always use a local copy of .mul that behaves as expected.
Sparc v7 has no multiplication instruction so a .mul function is used to do the multiplication. Typically dynamic linker detects v8 and interposes a DSO where .mul is implemented using the v8 multiplication instruction.
Unfortunately the NetBSD .mul stub doesn't follow the ABI. .mul is defined to return the upper bits in %o1, but smul instruction returns it in %y. Nothing in the gcc generated code uses the upper half, but Self does and garbage in %o1 makes it think multiplication failed.
As a quick kludge provide and always use a local copy of .mul that behaves as expected.
Works around #152.