gcc 有 -N 选项吗?
Does gcc have an -N option?
在"Learning Linux Binary Analysis" by Ryan "elfmaster" O'Neill.
Another neat trick that I just recently discovered during the
construction of the Skeksi virus for 64-bit Linux is to merge the text and data segment into a single segment, that is, read+write+execute (RWX), by using the -N
option with gcc.
我在 man gcc
和 gcc --help | grep '\-N'
中都没有看到 -N
选项?此选项是否已重命名?
-N
似乎是 (gnu)ld 的一个选项,链接器 ("loader")
来自man ld
:
-N
--omagic
Set the text and data sections to be readable and writable. Also, do not page-align the data segment, and disable linking against
shared libraries. If the output format
supports Unix style magic numbers, mark the output as "OMAGIC". Note: Although a writable text section is allowed for
PE-COFF targets, it does not conform to the format
specification published by Microsoft.
gcc
compiler-driver 会将带有 -Wl,
前缀的选项传递给加载程序,因此您的 gcc 命令行将类似于:
gcc -Wl,-N -oher_options...`
在"Learning Linux Binary Analysis" by Ryan "elfmaster" O'Neill.
Another neat trick that I just recently discovered during the construction of the Skeksi virus for 64-bit Linux is to merge the text and data segment into a single segment, that is, read+write+execute (RWX), by using the
-N
option with gcc.
我在 man gcc
和 gcc --help | grep '\-N'
中都没有看到 -N
选项?此选项是否已重命名?
-N
似乎是 (gnu)ld 的一个选项,链接器 ("loader")
来自man ld
:
-N
--omagic
Set the text and data sections to be readable and writable. Also, do not page-align the data segment, and disable linking against shared libraries. If the output format supports Unix style magic numbers, mark the output as "OMAGIC". Note: Although a writable text section is allowed for PE-COFF targets, it does not conform to the format specification published by Microsoft.
gcc
compiler-driver 会将带有 -Wl,
前缀的选项传递给加载程序,因此您的 gcc 命令行将类似于:
gcc -Wl,-N -oher_options...`