diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-02-21 01:30:30 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-02-21 01:30:30 +0000 |
| commit | a3ea407d48eba34c712399c8885a49861ea9a741 (patch) | |
| tree | bd1e7ff265d796fa63c38c1af1e0eeaca075268b /llvm/lib/Target/X86/X86TargetObjectFile.h | |
| parent | 96a01fa04671d7c554007d256294f4ddd96d3eee (diff) | |
| download | bcm5719-llvm-a3ea407d48eba34c712399c8885a49861ea9a741.tar.gz bcm5719-llvm-a3ea407d48eba34c712399c8885a49861ea9a741.zip | |
[X86] Use the correct alignment for COMDAT constant pool entries
COFF doesn't have sections with mergeable contents. Instead, each
constant pool entry ends up in a COMDAT section. The linker, when
choosing between COMDAT sections, doesn't choose the max alignment of
the two sections. You just get whatever alignment was on the section.
If one constant needed a higher alignment in one object file from
another one, then we will get into trouble if the linker chooses the
lower alignment one.
Instead, lets promote the alignment of the constant pool entry to make
sure we don't use an under aligned constant with an instruction which
assumed otherwise.
This fixes PR26680.
llvm-svn: 261462
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetObjectFile.h')
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetObjectFile.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86TargetObjectFile.h b/llvm/lib/Target/X86/X86TargetObjectFile.h index 6b2448cc9de..81207ad6304 100644 --- a/llvm/lib/Target/X86/X86TargetObjectFile.h +++ b/llvm/lib/Target/X86/X86TargetObjectFile.h @@ -59,7 +59,8 @@ namespace llvm { /// \brief Given a mergeable constant with the specified size and relocation /// information, return a section that it should be placed in. MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind, - const Constant *C) const override; + const Constant *C, + unsigned &Align) const override; }; } // end namespace llvm |

