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

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 06:52:04 PDT 2020


psmith added a comment.

I can check this over, but I'll have to do it in my spare time after work so it may take some time to go through it all. I should be able to answer any specific questions without too much delay though so feel free to ask if there is anything that isn't clear? I'll be/am on Easter break right now, will probably be Tuesday before I can check again.



================
Comment at: lld/test/ELF/arm-adr.s:85
+// CHECK:     00020800 <_start>:
 /// 0x11800 + 0x8 - 0x3f8 = 0x11410 = dat1
+// CHECK-NEXT: 20800: sub     r0, pc, #1016
----------------
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.


================
Comment at: lld/test/ELF/arm-thumb-interwork-abs.s:31
+// CHECK: 00021000 <arm_caller>:
+// CHECK-NEXT:    21000: b   #-57352
+// CHECK-NEXT:    21004: bl  #-57356
----------------
thieta wrote:
> This looked a bit strange to me as I was working through this test. I am not sure if the -57352 is correct here it seems like a very large negative number which is not something I usually see in the other files. If anyone can double check it it would be great.
The offset looks good to me. The symbol "sym" is defined via defsym to be 0x13001 which is higher than the call site with 4k pages, but lower when using 64k pages. Given that 0x21000 = 135168 in decimal a hand evaluation of the B instruction gives me 135168 + 8 - 57352 = 0x13000 which is what we'd expect the destination address to be for a Thumb defsym of 0x13001.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77330/new/

https://reviews.llvm.org/D77330





More information about the llvm-commits mailing list