execstack 标志的行为

Behavior of execstack flag

我正在使用 gcc 7.5,但在 https://gcc.gnu.org/onlinedocs/gcc-7.5.0/gcc/ 中找不到关于标志 -z,noexecstack 的信息 我在哪里可以找到有关其行为的信息?即它是否默认启用,如何检查它是否应用于我的文件等等。

我找到了 https://linux.die.net/man/8/execstack,它说 “标记是由最近的 GCC 版本自动完成的” 自从 7.5 版于 2019 年 11 月发布以来,我假设这适用对于 gcc 7.5.

来自link options

-z keyword

-z is passed directly on to the linker along with the keyword keyword. See the section in the documentation of your linker for permitted values and their meanings.

来自man ld

-z keyword
    The recognized keywords are:
    [...]
    execstack 
    Marks the object as requiring executable stack.
    [...]
    noexecstack 
    Marks the object as not requiring executable stack.