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.
Apologies in advance for being a pain. Please could you fix up the comments? PC-relative Arm and Thumb instructions can be a bit strange if you aren't used to them, as the PC-bias of 8 on Arm and 4 on Thumb needs to be accounted for. I wrote a comment hand evaluating the instructions in a lot of these cases to show that the disassembled immediate was correct.
I would hope in the majority of cases, like this one, the fix up is relatively straightforward.
There will be more than just this test affected, at this stage I won't highlight each one. In most of the tests the comments are identified as / although this is a relatively new convention that may not exist older tests. When updating the comment please could you start with / rather than //? The reason behind the convention is so that it is easier to pick up comments from FileCheck lines.