diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-11-19 19:52:52 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-11-19 19:52:52 +0000 |
commit | 60ec3836a2c10cf96526ad499af171f3b1c9b170 (patch) | |
tree | 74c81024d1a050d2fe5e9b37957bd73ec5b8cf62 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | b79d4f82e854bd951e1ac280490f2d632dae08c3 (diff) | |
download | bcm5719-llvm-60ec3836a2c10cf96526ad499af171f3b1c9b170.tar.gz bcm5719-llvm-60ec3836a2c10cf96526ad499af171f3b1c9b170.zip |
Support multiple COFF sections with the same name but different COMDAT.
This is the first step to fix pr17918.
It extends the .section directive a bit, inspired by what the ELF one looks
like. The problem with using linkonce is that given
.section foo
.linkonce....
.section foo
.linkonce
we would already have switched sections when getting to .linkonce. The cleanest
solution seems to be to add the comdat information in the .section itself.
llvm-svn: 195148
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 66ba3ec7af8..59d7b570375 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -733,6 +733,7 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, return getContext().getCOFFSection(Name, Characteristics, Kind, + "", Selection); } @@ -768,7 +769,7 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Characteristics |= COFF::IMAGE_SCN_LNK_COMDAT; return getContext().getCOFFSection(Name.str(), Characteristics, - Kind, COFF::IMAGE_COMDAT_SELECT_ANY); + Kind, "", COFF::IMAGE_COMDAT_SELECT_ANY); } if (Kind.isText()) |