Skip to content

Commit

Permalink
Windows TLS: Section name prefix to ensure correct order
Browse files Browse the repository at this point in the history
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!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177256 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
asl committed Mar 18, 2013
1 parent 086a472 commit 87294b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/CodeGen/TargetLoweringObjectFileImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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$";
Expand Down

0 comments on commit 87294b6

Please sign in to comment.