Skip to content

Add .note.GNU-stack to the assembly sources - #341

Merged
SChernykh merged 1 commit into
tevador:masterfrom
thomasbuilds:gnu-stack-note
Sep 8, 2026
Merged

Add .note.GNU-stack to the assembly sources#341
SChernykh merged 1 commit into
tevador:masterfrom
thomasbuilds:gnu-stack-note

Conversation

@thomasbuilds

Copy link
Copy Markdown
Contributor

The .S files have no .note.GNU-stack section, so on x86-64 GNU ld gives every binary or shared library that links librandomx an executable stack unless -z noexecstack is passed: binutils >= 2.39 warns at link time, and on glibc >= 2.41 dlopen() of librandomx.so fails ("cannot enable executable stack as shared object requires"). This adds the same empty note the compiler emits for every C/C++ object, guarded by __ELF__ since the files are also assembled for Mach-O and COFF.

@SChernykh
SChernykh merged commit 615de64 into tevador:master Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants