ITADN

psm: add .note.GNU-stack section as executable stack is not needed

#136Pull Requestsymphorien 创建于 2026-01-04
S
symphoriencommented
On GNU/Linux, when linking an executable comprising psm in a static library created by cargo because Cargo.toml contains `crate-type = ["staticlib"]`, the linker outputs the following warning: ``` /nix/store/dc9vaz50jg7mibk9xvqw5dqv89cxzla3-binutils-2.44/bin/ld: warning: 4f9a91766097c4c5-x86_64.o: missing .note.GNU-stack section implies executable stack /nix/store/dc9vaz50jg7mibk9xvqw5dqv89cxzla3-binutils-2.44/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker ``` (where 4f9a91766097c4c5-x86_64.o is the object corresponding to psm/src/arch/x86_64.s) Add the note requested by the linker. For some reason, executables linked directly by rustc do not seem affected. I only observed this with a c++ project linking a rust static library comprising psm (lnav). Note that I'm quite out of my depth here, and that I have only tested on x86_64-linux-gnu. I expect that a note will not be problematic with non-gnu toolchains, which should ignore it.
合并状态:未合并 关闭于 2026-01-23 2 条评论