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

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

This is a reland of f24e9958

Speculatively relanding the CL. LLD ignores the added section, so the
output should not be any different. The issue was also not reproducible
locally. Keeping an eye on the bot/roll to quickly revert, in case this
CL really breaks the deterministic build.

Original change's description:
> [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: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62504}

TBR=jgruber@chromium.org

Bug: chromium:981138
Change-Id: I2ddbaa7aa33f125ea0a0854cd9a94108c3a3845f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1690825Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62560}
parent a495c35e
......@@ -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