openlibm/amd64/e_fmodf.S
Jakov Smolić e2482c959e
Add stack markings for GNU to fmod assembly files (#307)
This adds stack markings to the missing fmod .S files, otherwise the
final libopenlibm object file gets marked with an executable stack.

Output when compiling from source on Gentoo Linux:

```
 * QA Notice: The following files contain writable and executable sections
 *  Files with such sections will not work properly (or at all!) on some
 *  architectures/operating systems.  A bug should be filed at
 *  https://bugs.gentoo.org/ to make sure the issue is fixed.
 *  For more information, see:
 *
 *    https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
 *
 *  Please include the following list of files in your report:
 *  Note: Bugs should be filed for the respective maintainers
 *  of the package in question and not hardened@gentoo.org.
 * RWX --- --- usr/lib64/libopenlibm.so.4.0
```
2024-08-04 18:12:41 -04:00

27 lines
419 B
ArmAsm

/*
* Based on the i387 version written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <amd64/bsd_asm.h>
ENTRY(fmodf)
movss %xmm0,-4(%rsp)
movss %xmm1,-8(%rsp)
flds -8(%rsp)
flds -4(%rsp)
1: fprem
fstsw %ax
testw $0x400,%ax
jne 1b
fstps -4(%rsp)
movss -4(%rsp),%xmm0
fstp %st
ret
END(fmodf)
/* Enable stack protection */
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif