[PATCH] D38815: [LLD] [COFF] Implement support for IMAGE_REL_ARM64_ADDR32NB
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 11 22:37:29 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL315561: [COFF] Implement support for IMAGE_REL_ARM64_ADDR32NB (authored by mstorsjo).
Changed prior to commit:
https://reviews.llvm.org/D38815?vs=118663&id=118739#toc
Repository:
rL LLVM
https://reviews.llvm.org/D38815
Files:
lld/trunk/COFF/Chunks.cpp
lld/trunk/test/COFF/arm64-relocs-imports.test
Index: lld/trunk/test/COFF/arm64-relocs-imports.test
===================================================================
--- lld/trunk/test/COFF/arm64-relocs-imports.test
+++ lld/trunk/test/COFF/arm64-relocs-imports.test
@@ -36,12 +36,13 @@
# BEFORE: 6c: c0 03 5f d6 ret
# BEFORE: 70: 08 00 00 00 <unknown>
# BEFORE: 74: 00 00 00 00 <unknown>
+# BEFORE: 78: 01 00 00 00 <unknown>
# AFTER: Disassembly of section .text:
# AFTER: 140002000: fe 0f 1f f8 str x30, [sp, #-16]!
# AFTER: 140002004: e0 ff ff f0 adrp x0, #-4096
# AFTER: 140002008: 00 18 00 91 add x0, x0, #6
-# AFTER: 14000200c: 1b 00 00 94 bl #108
+# AFTER: 14000200c: 1c 00 00 94 bl #112
# AFTER: 140002010: 00 21 40 39 ldrb w0, [x8, #8]
# AFTER: 140002014: 00 11 40 79 ldrh w0, [x8, #8]
# AFTER: 140002018: 00 09 40 b9 ldr w0, [x8, #8]
@@ -68,9 +69,10 @@
# AFTER: 14000206c: c0 03 5f d6 ret
# AFTER: 140002070: 10 10 00 40 <unknown>
# AFTER: 140002074: 01 00 00 00 <unknown>
-# AFTER: 140002078: 10 00 00 b0 adrp x16, #4096
-# AFTER: 14000207c: 10 1e 40 f9 ldr x16, [x16, #56]
-# AFTER: 140002080: 00 02 1f d6 br x16
+# AFTER: 140002078: 09 10 00 00 <unknown>
+# AFTER: 14000207c: 10 00 00 b0 adrp x16, #4096
+# AFTER: 140002080: 10 1e 40 f9 ldr x16, [x16, #56]
+# AFTER: 140002084: 00 02 1f d6 br x16
--- !COFF
header:
@@ -80,7 +82,7 @@
- Name: .text
Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
Alignment: 4
- SectionData: FE0F1FF80000009000080091000000940001403900014079000140B9000140F90001003900010079000100B9000100F90001403D0001407D000140BD000140FD0001C03D0001003D0001007D000100BD000100FD0001803D000540F9201A01B000FC4FF9E0031F2AFE0741F8C0035FD60800000000000000
+ SectionData: FE0F1FF80000009000080091000000940001403900014079000140B9000140F90001003900010079000100B9000100F90001403D0001407D000140BD000140FD0001C03D0001003D0001007D000100BD000100FD0001803D000540F9201A01B000FC4FF9E0031F2AFE0741F8C0035FD6080000000000000001000000
Relocations:
- VirtualAddress: 4
SymbolName: .Lstr
@@ -157,6 +159,9 @@
- VirtualAddress: 112
SymbolName: .Lglobal
Type: 14
+ - VirtualAddress: 120
+ SymbolName: .Lglobal
+ Type: 2
- Name: .data
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
Alignment: 4
Index: lld/trunk/COFF/Chunks.cpp
===================================================================
--- lld/trunk/COFF/Chunks.cpp
+++ lld/trunk/COFF/Chunks.cpp
@@ -222,6 +222,7 @@
case IMAGE_REL_ARM64_PAGEOFFSET_12L: applyArm64Ldr(Off, S & 0xfff); break;
case IMAGE_REL_ARM64_BRANCH26: or32(Off, ((S - P) & 0x0FFFFFFC) >> 2); break;
case IMAGE_REL_ARM64_ADDR32: add32(Off, S + Config->ImageBase); break;
+ case IMAGE_REL_ARM64_ADDR32NB: add32(Off, S); break;
case IMAGE_REL_ARM64_ADDR64: add64(Off, S + Config->ImageBase); break;
default:
fatal("unsupported relocation type 0x" + Twine::utohexstr(Type));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38815.118739.patch
Type: text/x-patch
Size: 3382 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171012/112dc897/attachment.bin>
More information about the llvm-commits
mailing list