[PATCH] D36745: [LLD][ELF] Always write non-immediate bits for AArch64 branch instruction.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 09:00:25 PDT 2017


grimar added a comment.

> ! In https://reviews.llvm.org/D36745#860322, @peter.smith wrote:
>  It is adding some value in that it shows the immediate field isn't getting corrupted but I'm happy to remove it if it is seen to be redundant, or not worth it.

Since test IMO should be enough, please see my comments inline.



================
Comment at: test/ELF/relocation-b-aarch64.test:7
+
+# REQUIRES: aarch64
+
----------------
Duplicate requires line.


================
Comment at: test/ELF/relocation-b-aarch64.test:39
+     Section:          .text
+     Name:             foo
----------------
If you put 2 symbols here:

```
....
Sections:
  - Type:            SHT_PROGBITS
    Name:            .text
    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
    Content:         "0000000000000000"
...
Symbols:
 Global:
   - Type:             STT_FUNC
     Section:          .text
     Name:             foo
   - Type:             STT_FUNC
     Section:          .text
     Name:             bar

```

Then output will be:

```
 Disassembly of section .text:
 foo:
   20000:	00 00 00 14 	b	#0
   20004:	ff ff ff 17 	        b	#-4
```

What I believe shows that immediate field isn't getting corrupted.


https://reviews.llvm.org/D36745





More information about the llvm-commits mailing list