Commit f24e9958 authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

[snapshot] Add '.note.GNU-stack' marker section for ELF snapshots

This snapshot adds a marker section to the output assembly of
mksnapshot. Omitting this section can imply an executable stack, which
can result in linker warnings.

R=jgruber@chromium.org

Change-Id: I6f5dacb24de3a852faf6ce0caf18c32b499ba5a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1687669
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62504}
parent e350e84a
......@@ -127,7 +127,15 @@ void PlatformEmbeddedFileWriterGeneric::DeclareExternalFilename(
fprintf(fp_, ".file %d \"%s\"\n", fileid, fixed_filename.c_str());
}
void PlatformEmbeddedFileWriterGeneric::FileEpilogue() {}
void PlatformEmbeddedFileWriterGeneric::FileEpilogue() {
// Omitting this section can imply an executable stack, which is usually
// a linker warning/error. C++ compilers add these automatically, but
// compiling assembly requires the .note.GNU-stack section to be inserted
// manually.
// Additional documentation:
// https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
fprintf(fp_, ".section .note.GNU-stack,\"\",%%progbits\n");
}
int PlatformEmbeddedFileWriterGeneric::IndentedDataDirective(
DataDirective directive) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment