[ppc64] Avoid copy relocs in named rodata sections
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 14 Mar 2014 12:45:22 +0000 (12:45 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 14 Mar 2014 12:45:22 +0000 (12:45 +0000)
commit0951eecae4ff281e8890651833d3835ed30b8531
tree98a81f628fb64a099a17fbb512c9b7681f320b84
parent670ef0236b1c343fb1bce33787dc9642e723b11f
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203921 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCTargetObjectFile.cpp
test/CodeGen/PowerPC/vtable-reloc.ll [new file with mode: 0644]