summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2013-03-18 08:10:10 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2013-03-18 08:10:10 +0000
commit2810a0ab80695876b51209b535888df5dcf8ccbc (patch)
treeab0ea7efbf7717264998efc726066c95c71e3b4f
parent6f7ca81cce63c4d25ebdc1ab10739baf5a64d78d (diff)
downloadbcm5719-llvm-2810a0ab80695876b51209b535888df5dcf8ccbc.tar.gz
bcm5719-llvm-2810a0ab80695876b51209b535888df5dcf8ccbc.zip
Windows TLS: Section name prefix to ensure correct order
The linker sorts the .tls$<xyz> sections by name, and we need to make sure any extra sections we produce (e.g. for weak globals) always end up between .tls$AAA and .tls$ZZZ, even if the name starts with e.g. an underscore. Patch by David Nadlinger! llvm-svn: 177256
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 9a9ddc9b488..3bdca4c6407 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -742,8 +742,11 @@ static const char *getCOFFSectionPrefixForUniqueGlobal(SectionKind Kind) {
return ".text$";
if (Kind.isBSS ())
return ".bss$";
- if (Kind.isThreadLocal())
- return ".tls$";
+ if (Kind.isThreadLocal()) {
+ // 'LLVM' is just an arbitary string to ensure that the section name gets
+ // sorted in between '.tls$AAA' and '.tls$ZZZ' by the linker.
+ return ".tls$LLVM";
+ }
if (Kind.isWriteable())
return ".data$";
return ".rdata$";
OpenPOWER on IntegriCloud