aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/ELF
diff options
context:
space:
mode:
authorDavid Meyer <pdox@google.com>2012-02-15 15:09:06 +0000
committerDavid Meyer <pdox@google.com>2012-02-15 15:09:06 +0000
commit5f7692604d44192206fbaf390085a95c9fb1a40b (patch)
tree55d04e26bcd0b4ebaf4fbacd11523f767a8f4bc2 /test/MC/ELF
parent4a1ff2fb3ecaa2576ecf9ed84816b174c235ac1d (diff)
downloadexternal_llvm-5f7692604d44192206fbaf390085a95c9fb1a40b.zip
external_llvm-5f7692604d44192206fbaf390085a95c9fb1a40b.tar.gz
external_llvm-5f7692604d44192206fbaf390085a95c9fb1a40b.tar.bz2
For ELF, also call fixSymbolsInTLSFixups() on expressions passed to EmitValue (literal values). Previously only called on expressions in instructions. New test cases added to tls.s, tls-i386.s. Resolves PR11981.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150582 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/ELF')
-rw-r--r--test/MC/ELF/tls-i386.s71
-rw-r--r--test/MC/ELF/tls.s33
2 files changed, 102 insertions, 2 deletions
diff --git a/test/MC/ELF/tls-i386.s b/test/MC/ELF/tls-i386.s
index 197418d..922d4c6 100644
--- a/test/MC/ELF/tls-i386.s
+++ b/test/MC/ELF/tls-i386.s
@@ -9,6 +9,13 @@
movl foo5@TPOFF(%eax), %eax
movl foo6@DTPOFF(%eax), %eax
movl foo7@INDNTPOFF, %eax
+ .long foo8@NTPOFF
+ .long foo9@GOTNTPOFF
+ .long fooA@TLSGD
+ .long fooB@TLSLDM
+ .long fooC@TPOFF
+ .long fooD@DTPOFF
+ .long fooE@INDNTPOFF
// CHECK: (('st_name', 0x00000001) # 'foo1'
// CHECK-NEXT: ('st_value', 0x00000000)
@@ -72,3 +79,67 @@
// CHECK-NEXT: ('st_other', 0x00)
// CHECK-NEXT: ('st_shndx', 0x0000)
// CHECK-NEXT: ),
+// CHECK-NEXT: # Symbol 12
+// CHECK-NEXT: (('st_name', 0x00000024) # 'foo8'
+// CHECK-NEXT: ('st_value', 0x00000000)
+// CHECK-NEXT: ('st_size', 0x00000000)
+// CHECK-NEXT: ('st_bind', 0x1)
+// CHECK-NEXT: ('st_type', 0x6)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0000)
+// CHECK-NEXT: ),
+// CHECK-NEXT: # Symbol 13
+// CHECK-NEXT: (('st_name', 0x00000029) # 'foo9'
+// CHECK-NEXT: ('st_value', 0x00000000)
+// CHECK-NEXT: ('st_size', 0x00000000)
+// CHECK-NEXT: ('st_bind', 0x1)
+// CHECK-NEXT: ('st_type', 0x6)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0000)
+// CHECK-NEXT: ),
+// CHECK-NEXT: # Symbol 14
+// CHECK-NEXT: (('st_name', 0x0000002e) # 'fooA'
+// CHECK-NEXT: ('st_value', 0x00000000)
+// CHECK-NEXT: ('st_size', 0x00000000)
+// CHECK-NEXT: ('st_bind', 0x1)
+// CHECK-NEXT: ('st_type', 0x6)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0000)
+// CHECK-NEXT: ),
+// CHECK-NEXT: # Symbol 15
+// CHECK-NEXT: (('st_name', 0x00000033) # 'fooB'
+// CHECK-NEXT: ('st_value', 0x00000000)
+// CHECK-NEXT: ('st_size', 0x00000000)
+// CHECK-NEXT: ('st_bind', 0x1)
+// CHECK-NEXT: ('st_type', 0x6)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0000)
+// CHECK-NEXT: ),
+// CHECK-NEXT: # Symbol 16
+// CHECK-NEXT: (('st_name', 0x00000038) # 'fooC'
+// CHECK-NEXT: ('st_value', 0x00000000)
+// CHECK-NEXT: ('st_size', 0x00000000)
+// CHECK-NEXT: ('st_bind', 0x1)
+// CHECK-NEXT: ('st_type', 0x6)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0000)
+// CHECK-NEXT: ),
+// CHECK-NEXT: # Symbol 17
+// CHECK-NEXT: (('st_name', 0x0000003d) # 'fooD'
+// CHECK-NEXT: ('st_value', 0x00000000)
+// CHECK-NEXT: ('st_size', 0x00000000)
+// CHECK-NEXT: ('st_bind', 0x1)
+// CHECK-NEXT: ('st_type', 0x6)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0000)
+// CHECK-NEXT: ),
+// CHECK-NEXT: # Symbol 18
+// CHECK-NEXT: (('st_name', 0x00000042) # 'fooE'
+// CHECK-NEXT: ('st_value', 0x00000000)
+// CHECK-NEXT: ('st_size', 0x00000000)
+// CHECK-NEXT: ('st_bind', 0x1)
+// CHECK-NEXT: ('st_type', 0x6)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0000)
+// CHECK-NEXT: ),
+
diff --git a/test/MC/ELF/tls.s b/test/MC/ELF/tls.s
index d6d7de6..fe2bb4e 100644
--- a/test/MC/ELF/tls.s
+++ b/test/MC/ELF/tls.s
@@ -5,12 +5,14 @@
leaq foo1@TLSGD(%rip), %rdi
leaq foo2@GOTTPOFF(%rip), %rdi
leaq foo3@TLSLD(%rip), %rdi
-
+ .long foo4@GOTTPOFF
+ .long foo5@TLSLD
+ .long foo6@TLSGD
.section .zed,"awT",@progbits
foobar:
.long 43
-// CHECK: (('st_name', 0x00000010) # 'foobar'
+// CHECK: (('st_name', 0x0000001f) # 'foobar'
// CHECK-NEXT: ('st_bind', 0x0)
// CHECK-NEXT: ('st_type', 0x6)
// CHECK-NEXT: ('st_other', 0x00)
@@ -46,3 +48,30 @@ foobar:
// CHECK-NEXT: ('st_value', 0x0000000000000000)
// CHECK-NEXT: ('st_size', 0x0000000000000000)
// CHECK-NEXT: ),
+// CHECK-NEXT: # Symbol 10
+// CHECK-NEXT: (('st_name', 0x00000010) # 'foo4'
+// CHECK-NEXT: ('st_bind', 0x1)
+// CHECK-NEXT: ('st_type', 0x6)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0000)
+// CHECK-NEXT: ('st_value', 0x0000000000000000)
+// CHECK-NEXT: ('st_size', 0x0000000000000000)
+// CHECK-NEXT: ),
+// CHECK-NEXT: # Symbol 11
+// CHECK-NEXT: (('st_name', 0x00000015) # 'foo5'
+// CHECK-NEXT: ('st_bind', 0x1)
+// CHECK-NEXT: ('st_type', 0x6)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0000)
+// CHECK-NEXT: ('st_value', 0x0000000000000000)
+// CHECK-NEXT: ('st_size', 0x0000000000000000)
+// CHECK-NEXT: ),
+// CHECK-NEXT: # Symbol 12
+// CHECK-NEXT: (('st_name', 0x0000001a) # 'foo6'
+// CHECK-NEXT: ('st_bind', 0x1)
+// CHECK-NEXT: ('st_type', 0x6)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0000)
+// CHECK-NEXT: ('st_value', 0x0000000000000000)
+// CHECK-NEXT: ('st_size', 0x0000000000000000)
+// CHECK-NEXT: ),