summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/PowerPC/vtable-reloc.ll
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2014-03-14 12:45:22 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2014-03-14 12:45:22 +0000
commitf445399870e5d3e70be72db0e5ac6aa4d581d8ca (patch)
treeff7e49b9e56b335276fe4d16a2441b1a654d55a8 /llvm/test/CodeGen/PowerPC/vtable-reloc.ll
parent3554912129073eb282877ac553f0ea2da0adfd9f (diff)
downloadbcm5719-llvm-f445399870e5d3e70be72db0e5ac6aa4d581d8ca.tar.gz
bcm5719-llvm-f445399870e5d3e70be72db0e5ac6aa4d581d8ca.zip
[ppc64] Avoid copy relocs in named rodata sections
Commit r181723 introduced code to avoid placing initialized variables needing relocations into the .rodata section, which avoid copy relocs that do not work as expected on ppc64 function references. The same treatment is also needed for *named* .rodata.XXX sections. This patch changes PPC64LinuxTargetObjectFile::SelectSectionForGlobal to modify "Kind" *before* calling the default SelectSectionForGlobal routine, instead of first calling the default routine and then just checking for the (main) .rodata section afterwards. llvm-svn: 203921
Diffstat (limited to 'llvm/test/CodeGen/PowerPC/vtable-reloc.ll')
-rw-r--r--llvm/test/CodeGen/PowerPC/vtable-reloc.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/vtable-reloc.ll b/llvm/test/CodeGen/PowerPC/vtable-reloc.ll
new file mode 100644
index 00000000000..995a5d03ba5
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/vtable-reloc.ll
@@ -0,0 +1,11 @@
+; RUN: llc -O0 < %s | FileCheck %s
+
+target datalayout = "E-m:e-i64:64-n32:64"
+target triple = "powerpc64-unknown-linux-gnu"
+
+@_ZTV3foo = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast (void ()* @__cxa_pure_virtual to i8*)]
+declare void @__cxa_pure_virtual()
+
+; CHECK: .section .data.rel.ro
+; CHECK: .quad __cxa_pure_virtual
+
OpenPOWER on IntegriCloud