Skip to content

Commit

Permalink
Add stack markings for GNU to fmod assembly files (#307)
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
jsmolic authored Aug 4, 2024
1 parent d66f477 commit e2482c9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions amd64/e_fmod.S
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ ENTRY(fmod)
fstp %st
ret
END(fmod)

/* Enable stack protection */
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif
5 changes: 5 additions & 0 deletions amd64/e_fmodf.S
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ ENTRY(fmodf)
fstp %st
ret
END(fmodf)

/* Enable stack protection */
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif
5 changes: 5 additions & 0 deletions amd64/e_fmodl.S
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ ENTRY(fmodl)
fstp %st(1)
ret
END(fmodl)

/* Enable stack protection */
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

0 comments on commit e2482c9

Please sign in to comment.