Files
mbedtls/include/mbedtls
Peter Korsgaard 9d9d45c6b2 bn_mul.h: fix x86 PIC inline ASM compilation with GCC < 5
Fixes #1910

With ebx added to the MULADDC_STOP clobber list to fix #1550, the inline
assembly fails to build with GCC < 5 in PIC mode with the following error:

include/mbedtls/bn_mul.h:46:13: error: PIC register clobbered by ‘ebx’ in ‘asm’

This is because older GCC versions treated the x86 ebx register (which is
used for the GOT) as a fixed reserved register when building as PIC.

This is fixed by an improved register allocator in GCC 5+.  From the release
notes:

Register allocation improvements: Reuse of the PIC hard register, instead of
using a fixed register, was implemented on x86/x86-64 targets.  This
improves generated PIC code performance as more hard registers can be used.

https://www.gnu.org/software/gcc/gcc-5/changes.html

As a workaround, detect this situation and disable the inline assembly,
similar to the MULADDC_CANNOT_USE_R7 logic.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2022-07-19 09:02:47 +01:00
..
2021-12-07 12:16:33 +00:00
2021-11-11 11:33:19 +01:00
2021-12-11 15:02:06 +01:00
2022-01-24 10:31:06 -05:00
2021-12-13 11:14:45 +00:00
2021-09-30 12:29:27 +02:00
2021-11-22 15:35:58 +00:00
2022-07-11 10:43:55 +01:00