Wrong syntax in mpn/vax
Paul_Koning at Dell.com
Paul_Koning at Dell.com
Tue Jul 17 17:49:35 CEST 2012
On Jul 17, 2012, at 6:30 AM, Torbjorn Granlund wrote:
> <Paul_Koning at Dell.com> writes:
>
> I ran into two more issues when I tried "make check". There's a bug
> in the NetBSD/vax library loader (ld.elf_so) that affects two of the
> assembly language files.
>
> How?
The "jmp Loop(%r5) assembles into the actual address of Loop indexed by R5. So in a shared library, that address operand is relocated. The linker warns about a relocation in a .text section, and the loader dies with a segfault.
The fix is to use "jmp Loop[%r5]" -- that makes it a base address of PC-relative additionally indexed by R5. Then there is no relocation involved (the fixed code is already PIC).
I'm about to report this to NetBSD.
>
> Also, there were too many underscores in the function names in those
> files. The attached diff is the consolidated change for all this.
>
> I suppose Ultrix is long dead, so we can ignore it? At any rate, we
> should use the .asm style and let GMP's configure system tack on any
> needed underscores. (We could also let an vax/elf.m4 prepend the %
> signs to register names.)
Yup, #include <machine/asm.h> then _C_LABEL(__gmpn_add_n) etc.
>
> With those changes, I can run "make check". It fails one test, the
> other 32 work. The failing test is for mpn_get_d. The reason for the
> failure is that it goes through a code path that assumes IEEE float,
> and VAX isn't using IEEE. There seems to be code in get_d.c for
> non-IEEE, but that is in the #else path of a #if 1 statement...
>
> The non-IEEE code is probably suffering from bitrot, since it hasn't
> been tested for a very long time. I'd like it to be correct, but I
> won't work on it any time soon (due to lack of time and lack of working
> system).
>
> Perhaps you could work with the NetBSD team to make sure the upcoming
> 6.0 relesase works with simh? At least, it would be nice if you could
> make sure the bugs that you have found gets fixed.
Yes, will do. Some of that has already been done.
paul
More information about the gmp-bugs
mailing list