[PATCH] D77330: Consider increasing the default ARM32 page size to 64k.

Tobias Hieta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 12:28:42 PDT 2020


thieta created this revision.
thieta added reviewers: peter.smith, lld.
thieta added a project: lld.
Herald added subscribers: llvm-commits, danielkiss, MaskRay, kristof.beyls, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

After some discussion on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2020-April/140549.html I was recommended to open up a Pull Request for changing the default page size on ARM32 in LLD.

The current 4k page size doesn't work if the arm system has a higher page size configured. There are some systems out there that do this and it leads to the binary getting `Killed!` by the kernel, this is scenario that is hard to debug and a more compatible value might be good as we see adoption of lld go up.

Another thing to consider is that arm32 binaries can be executed on arm64 and there the 64k page size is pretty common. This is what GNU LD considered: https://github.com/bminor/binutils-gdb/commit/7572ca8989ead4c3425a1500bc241eaaeffa2c89

The question to the community is - would the increased compatibility be worth the hassle for the people that would have to tweak it with a option?

Note that the current diff doesn't update the tests to account for the new page size. There are 58 tests failing after this change, but I didn't want to update them all until I know if there is any interest in tweaking this value or not.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77330

Files:
  lld/ELF/Arch/ARM.cpp


Index: lld/ELF/Arch/ARM.cpp
===================================================================
--- lld/ELF/Arch/ARM.cpp
+++ lld/ELF/Arch/ARM.cpp
@@ -65,6 +65,7 @@
   ipltEntrySize = 16;
   trapInstr = {0xd4, 0xd4, 0xd4, 0xd4};
   needsThunks = true;
+  defaultMaxPageSize = 65536;
 }
 
 uint32_t ARM::calcEFlags() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77330.254588.patch
Type: text/x-patch
Size: 323 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200402/a5da9cad/attachment.bin>


More information about the llvm-commits mailing list