diff options
author | Rui Ueyama <ruiu@google.com> | 2015-10-08 20:00:02 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-10-08 20:00:02 +0000 |
commit | 7114f0597ba25de36e7f1ce371e6ef2b05f06c9c (patch) | |
tree | 3d391b8bb68a420be6820b9260cd4a3be52d884a /lld/ELF/Writer.cpp | |
parent | e4b1765a0f3254038ef998cfe99efb17dc47f514 (diff) | |
download | bcm5719-llvm-7114f0597ba25de36e7f1ce371e6ef2b05f06c9c.tar.gz bcm5719-llvm-7114f0597ba25de36e7f1ce371e6ef2b05f06c9c.zip |
Roll back r249726 and r249723 because they broke buildbots.
llvm-svn: 249728
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r-- | lld/ELF/Writer.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index cce4122f28d..6293505f067 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -24,6 +24,15 @@ using namespace lld::elf2; static const int PageSize = 4096; +// On freebsd x86_64 the first page cannot be mmaped. +// On linux that is controled by vm.mmap_min_addr. At least on some x86_64 +// installs that is 65536, so the first 15 pages cannot be used. +// Given that, the smallest value that can be used in here is 0x10000. +// If using 2MB pages, the smallest page aligned address that works is +// 0x200000, but it looks like every OS uses 4k pages for executables. +// FIXME: This is architecture and OS dependent. +static const int VAStart = 0x10000; + namespace { static uint32_t toPHDRFlags(uint64_t Flags) { @@ -93,7 +102,7 @@ private: return !Symtab.getSharedFiles().empty() || Config->Shared; } bool needsDynamicSections() const { return isOutputDynamic(); } - unsigned getVAStart() const { return Config->Shared ? 0 : Target->getVAStart(); } + unsigned getVAStart() const { return Config->Shared ? 0 : VAStart; } std::unique_ptr<llvm::FileOutputBuffer> Buffer; |