[PATCH] D11673: [lld] COFF: When resolving _load_config_used, add it as a GC root.
Peter Collingbourne
peter at pcc.me.uk
Thu Jul 30 22:34:09 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL243735: COFF: When resolving _load_config_used, add it as a GC root. (authored by pcc).
Changed prior to commit:
http://reviews.llvm.org/D11673?vs=31105&id=31108#toc
Repository:
rL LLVM
http://reviews.llvm.org/D11673
Files:
lld/trunk/COFF/Driver.cpp
lld/trunk/test/COFF/loadcfg.ll
lld/trunk/test/COFF/loadcfg.test
Index: lld/trunk/test/COFF/loadcfg.test
===================================================================
--- lld/trunk/test/COFF/loadcfg.test
+++ lld/trunk/test/COFF/loadcfg.test
@@ -2,7 +2,7 @@
# RUN: lld -flavor link2 /out:%t.exe %t.obj /entry:main /subsystem:console
# RUN: llvm-readobj -file-headers %t.exe | FileCheck %s
-# CHECK: LoadConfigTableRVA: 0x1000
+# CHECK: LoadConfigTableRVA: 0x1008
# CHECK: LoadConfigTableSize: 0x70
---
@@ -14,6 +14,10 @@
Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
Alignment: 4
SectionData: B82A000000C3
+ - Name: .text
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: B82A000000C3
symbols:
- Name: .text
Value: 0
@@ -27,15 +31,28 @@
NumberOfLinenumbers: 0
CheckSum: 0
Number: 0
+ - Name: .text
+ Value: 0
+ SectionNumber: 2
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 6
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 0
+ Selection: IMAGE_COMDAT_SELECT_ANY
- Name: main
Value: 0
SectionNumber: 1
SimpleType: IMAGE_SYM_TYPE_NULL
ComplexType: IMAGE_SYM_DTYPE_NULL
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
- Name: _load_config_used
Value: 0
- SectionNumber: 1
+ SectionNumber: 2
SimpleType: IMAGE_SYM_TYPE_NULL
ComplexType: IMAGE_SYM_DTYPE_NULL
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
Index: lld/trunk/test/COFF/loadcfg.ll
===================================================================
--- lld/trunk/test/COFF/loadcfg.ll
+++ lld/trunk/test/COFF/loadcfg.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as -o %t.obj %s
+; RUN: lld -flavor link2 /out:%t.exe %t.obj /entry:main /subsystem:console
+; RUN: llvm-readobj -file-headers %t.exe | FileCheck %s
+
+; CHECK: LoadConfigTableRVA: 0x1000
+; CHECK: LoadConfigTableSize: 0x70
+
+target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-windows-msvc"
+
+ at _load_config_used = constant i32 1
+
+define void @main() {
+ ret void
+}
Index: lld/trunk/COFF/Driver.cpp
===================================================================
--- lld/trunk/COFF/Driver.cpp
+++ lld/trunk/COFF/Driver.cpp
@@ -662,9 +662,8 @@
}
// Windows specific -- if __load_config_used can be resolved, resolve it.
- if (Symbol *Sym = Symtab.find(Config->LoadConfigUsed))
- if (isa<Lazy>(Sym->Body))
- Symtab.addUndefined(Config->LoadConfigUsed);
+ if (Symtab.find(Config->LoadConfigUsed))
+ addUndefined(Config->LoadConfigUsed);
if (Symtab.queueEmpty())
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11673.31108.patch
Type: text/x-patch
Size: 3011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150731/d5f2f69c/attachment.bin>
More information about the llvm-commits
mailing list