linker: map the entire ELF file if address space is 64bit

For 64bit address space we can map from file_offset_ to the end of the
file and not worry about address space exhaustion. This will ensure the
initial mapping covers all the areas needed to load the Elf file.

Bug: 322132947
Test: atest -c linker-unit-tests
Change-Id: Id82646547f1336eb18bf427dab85767b04d800d3
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
diff --git a/linker/linker_phdr.cpp b/linker/linker_phdr.cpp
index cf1cfb3..a629ee6 100644
--- a/linker/linker_phdr.cpp
+++ b/linker/linker_phdr.cpp
@@ -228,8 +228,10 @@
     return false;
   }
 
+#if !defined(__LP64__)
   // Map at most 1MiB which should cover most cases
   map_size = std::min(map_size, static_cast<size_t>(1 * 1024 * 1024));
+#endif
 
   if (!file_fragment_.Map(fd_, file_offset_, 0, map_size)) {
     DL_ERR("\"%s\" header mmap failed: %s", name_.c_str(), strerror(errno));