summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHan Shen <shenhan@google.com>2016-01-11 23:23:15 (GMT)
committerHan Shen <shenhan@google.com>2016-01-12 21:36:17 (GMT)
commita95c2e5c5e5338f535c730b2333e797adf2872c0 (patch)
tree2c6bb0f1a50d9453e5ee9c7328a01f79a2c4194f
parent3febaa7a3e7b8e89ef420c7984d60816798f1678 (diff)
downloadtoolchain_binutils-a95c2e5c5e5338f535c730b2333e797adf2872c0.zip
toolchain_binutils-a95c2e5c5e5338f535c730b2333e797adf2872c0.tar.gz
toolchain_binutils-a95c2e5c5e5338f535c730b2333e797adf2872c0.tar.bz2
Remove internal link in warning messages.
The go/unsafe-pie link should not appear in any warning messages, replace it with a little bit detail. Tested by building locally on ubuntu. Change-Id: I3e590108ec2c6c8917475b5d78cdabbfcf2833f7
-rw-r--r--binutils-2.25/gold/layout.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/binutils-2.25/gold/layout.cc b/binutils-2.25/gold/layout.cc
index 18063a0..54b9dc3 100644
--- a/binutils-2.25/gold/layout.cc
+++ b/binutils-2.25/gold/layout.cc
@@ -2819,8 +2819,18 @@ Layout::finalize(const Input_objects* input_objects, Symbol_table* symtab,
if (data_seg_size >= target->max_pie_data_segment_size())
gold_warning(
- _("Unsafe PIE data segment size (%" PRIu64 " > %" PRIu64 "). See "
- "go/unsafe-pie."),
+ _("Unsafe PIE data segment size (%" PRIu64 " > %" PRIu64 "). "
+ "For kernels with CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE enabled, "
+ "load_elf_binary() attempts to map a PIE binary into an address "
+ "range immediately below mm->mmap_base. The first PT_LOAD segment "
+ "is mapped below mm->mmap_base, the subsequent PT_LOAD segment(s) "
+ "end up being mapped above mm->mmap_base into the area that is "
+ "supposed to be the \"gap\" between the stack and the binary. Since"
+ " the size of the \"gap\" on x86_64 is only guaranteed to be 128MB "
+ "this means that binaries with large data segments > 128MB can end "
+ "up mapping part of their data segment over their stack resulting "
+ "in corruption of the stack. Any PIE binary with a data segment > "
+ "128MB is vulnerable to this. It is suggested to turn off PIE."),
data_seg_size,
target->max_pie_data_segment_size());
}