summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-05-03 19:57:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-05-03 19:57:04 +0000
commit3d082fa50704f55a3c6d25c9d6b25d652e7d84ae (patch)
treea3aff89a7742699070c17f25e005b1f04fdeb4a7 /llvm/test
parent834652ade026fa990a110c8bc572f988d94a18a5 (diff)
downloadbcm5719-llvm-3d082fa50704f55a3c6d25c9d6b25d652e7d84ae.tar.gz
bcm5719-llvm-3d082fa50704f55a3c6d25c9d6b25d652e7d84ae.zip
Fix pr19645.
The fix itself is fairly simple: move getAccessVariant to MCValue so that we replace the old weak expression evaluation with the far more general EvaluateAsRelocatable. This then requires that EvaluateAsRelocatable stop when it finds a non trivial reference kind. And that in turn requires the ELF writer to look harder for weak references. Last but not least, this found a case where we were being bug by bug compatible with gas and accepting an invalid input. I reported pr19647 to track it. llvm-svn: 207920
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/MC/ELF/relocation-386.s3
-rw-r--r--llvm/test/MC/ELF/relocation.s3
2 files changed, 5 insertions, 1 deletions
diff --git a/llvm/test/MC/ELF/relocation-386.s b/llvm/test/MC/ELF/relocation-386.s
index 4ddfd00b120..ba12df0d3b6 100644
--- a/llvm/test/MC/ELF/relocation-386.s
+++ b/llvm/test/MC/ELF/relocation-386.s
@@ -62,6 +62,7 @@
// CHECK-NEXT: 0x9E R_386_PC16 und_symbol 0x0
// Relocation 28 (und_symbol-bar2) is of type R_386_PC8
// CHECK-NEXT: 0xA0 R_386_PC8 und_symbol 0x0
+// CHECK-NEXT: 0xA3 R_386_GOTOFF und_symbol 0x0
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -127,6 +128,8 @@ bar2:
.word und_symbol-bar2
.byte und_symbol-bar2
+ leal 1 + und_symbol@GOTOFF, %edi
+
.section zedsec,"awT",@progbits
zed:
.long 0
diff --git a/llvm/test/MC/ELF/relocation.s b/llvm/test/MC/ELF/relocation.s
index 318d60fdc82..c0e6007dc4e 100644
--- a/llvm/test/MC/ELF/relocation.s
+++ b/llvm/test/MC/ELF/relocation.s
@@ -25,6 +25,7 @@ bar:
.word foo-bar
.byte foo-bar
+ # this should probably be an error...
zed = foo +2
call zed@PLT
@@ -57,7 +58,7 @@ bar:
// CHECK-NEXT: 0x85 R_X86_64_TPOFF64 baz 0x0
// CHECK-NEXT: 0x8D R_X86_64_PC16 foo 0x8D
// CHECK-NEXT: 0x8F R_X86_64_PC8 foo 0x8F
-// CHECK-NEXT: 0x91 R_X86_64_PLT32 foo 0xFFFFFFFFFFFFFFFE
+// CHECK-NEXT: 0x91 R_X86_64_PLT32 zed 0xFFFFFFFFFFFFFFFC
// CHECK-NEXT: 0x98 R_X86_64_PC32 foo 0xFFFFFFFFFFFFFFFB
// CHECK-NEXT: 0x9D R_X86_64_GOTPC32 _GLOBAL_OFFSET_TABLE_ 0x1
// CHECK-NEXT: 0xA3 R_X86_64_GOTPC64 _GLOBAL_OFFSET_TABLE_ 0x2
OpenPOWER on IntegriCloud