hanchenye-llvm-project/llvm
Ulrich Weigand 52cf8e4488 [PowerPC] Revert r185476 and fix up TLS variant kinds
In the commit message to r185476 I wrote:

>The PowerPC-specific modifiers VK_PPC_TLSGD and VK_PPC_TLSLD
>correspond exactly to the generic modifiers VK_TLSGD and VK_TLSLD.
>This causes some confusion with the asm parser, since VK_PPC_TLSGD
>is output as @tlsgd, which is then read back in as VK_TLSGD.
>
>To avoid this confusion, this patch removes the PowerPC-specific
>modifiers and uses the generic modifiers throughout.  (The only
>drawback is that the generic modifiers are printed in upper case
>while the usual convention on PowerPC is to use lower-case modifiers.
>But this is just a cosmetic issue.)

This was unfortunately incorrect, there is is fact another,
serious drawback to using the default VK_TLSLD/VK_TLSGD
variant kinds: using these causes ELFObjectWriter::RelocNeedsGOT
to return true, which in turn causes the ELFObjectWriter to emit
an undefined reference to _GLOBAL_OFFSET_TABLE_.

This is a problem on powerpc64, because it uses the TOC instead
of the GOT, and the linker does not provide _GLOBAL_OFFSET_TABLE_,
so the symbol remains undefined.  This means shared libraries
using TLS built with the integrated assembler are currently
broken.

While the whole RelocNeedsGOT / _GLOBAL_OFFSET_TABLE_ situation
probably ought to be properly fixed at some point, for now I'm
simply reverting the r185476 commit.  Now this in turn exposes
the breakage of handling @tlsgd/@tlsld in the asm parser that
this check-in was originally intended to fix.

To avoid this regression, I'm also adding a different fix for
this problem: while common code now parses @tlsgd as VK_TLSGD,
a special hack in the asm parser translates this code to the
platform-specific VK_PPC_TLSGD that the back-end now expects.
While this is not really pretty, it's self-contained and
shouldn't hurt anything else for now.  One the underlying
problem is fixed, this hack can be reverted again.

llvm-svn: 185945
2013-07-09 16:41:09 +00:00
..
autoconf No ',' between programs. 2013-07-08 21:18:54 +00:00
bindings We're in 3.4 land now. 2013-05-07 20:31:28 +00:00
cmake Find xdot or xdot.py. 2013-07-08 20:24:54 +00:00
docs Document LLVM_USE_SANITIZER CMake option 2013-07-09 10:56:13 +00:00
examples ExceptionDemo: Corresponding to r181820, SectionMemoryManager should belong to RTDyldMemoryManager. 2013-05-14 23:05:00 +00:00
include [PowerPC] Revert r185476 and fix up TLS variant kinds 2013-07-09 16:41:09 +00:00
lib [PowerPC] Revert r185476 and fix up TLS variant kinds 2013-07-09 16:41:09 +00:00
projects The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD. 2013-07-01 08:07:52 +00:00
runtime Remove "-Wl,-seg1addr -Wl,0xE0000000" from link options. 2013-06-04 15:26:37 +00:00
test [PowerPC] Revert r185476 and fix up TLS variant kinds 2013-07-09 16:41:09 +00:00
tools Don't run internalize if we're outputing bit-code and not an object file. 2013-07-08 23:23:03 +00:00
unittests Make BinaryRef output correctly in case of empty data. 2013-07-09 00:54:46 +00:00
utils Extend 'readonly' and 'readnone' to work on function arguments as well as 2013-07-06 00:29:58 +00:00
.arcconfig
.gitignore
CMakeLists.txt Support using "host" as a target in LLVM_TARGETS_TO_BUILD when using cmake. 2013-06-26 07:57:53 +00:00
CODE_OWNERS.TXT Add more owners to CODE_OWNERS.TXT (Kostya Serebryany: AddressSanitizer and ThreadSanitizer; Evgeniy Stepanov: MemorySanitizer) 2013-06-27 08:47:12 +00:00
CREDITS.TXT Identify me on IRC. 2013-06-18 22:09:36 +00:00
LICENSE.TXT Be more specific and capitalize filenames. 2013-05-21 21:22:34 +00:00
LLVMBuild.txt
Makefile Fix regular expression used by 'make update' to only look for 'I' and '?' at the start of svn info results and to check for spaces after 'I' instead of just after '?'. 2013-07-03 14:48:37 +00:00
Makefile.common
Makefile.config.in Add an autoconf option for turning on -gsplit-dwarf by default 2013-06-25 01:12:25 +00:00
Makefile.rules The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD. 2013-07-01 08:07:52 +00:00
README.txt test 2013-04-17 05:34:03 +00:00
configure No ',' between programs. 2013-07-08 21:18:54 +00:00
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you're writing a package for LLVM, see docs/Packaging.rst for our
suggestions.