I'm cross-compiling the FIPS Module v2.0.2 for a NetBSD/MIPS target. All seems well except for the following warning when compiling bn-mips.s (gcc version 4.1.3):

/usr/local/bin/perl ../../util/fipsas.pl <http://fipsas.pl> ../.. bn-mips.s mips64--netbsd-gcc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include -DOPENSSL_FIPSCANISTER -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DTERMIOS -O3 -fomit-frame-pointer -msoft-float -Wall -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -c -o bn-mips.o bn-mips.s
bn-mips.s: Assembler messages:
bn-mips.s:585: Warning: Pretending global symbol used as branch target is local.

The code causing the warning is below:

.align  5
.ent    bn_div_3_words_internal
bn_div_3_words_internal:
        .set    reorder
        move    $11,$31
        bal     fips_bn_div_words     <-----------
        move    $31,$11
        multu   $10,$2
        lw      $14,-2*4($7)
...

Here is something strange. Compiler is called mips64-*, there is -DSHA512_ASM, both indicate that we are talking about MIPS64 build (maybe in N32 ABI context, but MIPS64 nevertheless)... But then how come it's multu and not dmultu two lines below <-----? We don't have config line for NetBSD/MIPS, so it must be yours, private one. And provided above it's likely to be inconsistent. I don't know if it will pass the test. But even if it will, bn will perform sub-optimally, as dmultu gives at least 3x improvement over multu.

Is this something I can ignore?

Most likely. "Most likely" means that I can't imagine that it would be a problem, but can't be sure without hands-on experience. At all occasions, -Bsymbolic should help to avoid eventual problems.

Is there a  compiler option I'm missing that would eliminate the warning?

I can't know. But can you test/verify following? Open crypto/bn/asm/mips.pl in text editor, locate the line that reads "bal\tbn_div_words" and replace it bn_div_words with bn_div_words_internal. I can confirm that it produces correct result (in supported configs!-), but I can't tell if it fixes the warning.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to