diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-12-31 16:06:48 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-12-31 16:06:48 +0000 |
| commit | d4da9040de63913319ffffeef4f3b9b4e7558284 (patch) | |
| tree | 4b2c33ffa227077d7c25bcd3fe7202623c827e36 /llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp | |
| parent | 94272611ac9fcebc5ec87e3cb866fcecc4fb7ea2 (diff) | |
| download | bcm5719-llvm-d4da9040de63913319ffffeef4f3b9b4e7558284.tar.gz bcm5719-llvm-d4da9040de63913319ffffeef4f3b9b4e7558284.zip | |
Revert "Remove doesSectionRequireSymbols."
This reverts commit r224985.
I am investigating why it made an Apple bot unhappy.
llvm-svn: 225044
Diffstat (limited to 'llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp index 719b761084f..164b4192ae6 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp @@ -777,6 +777,19 @@ public: MachO::CPU_TYPE_X86_64, Subtype); } + bool doesSectionRequireSymbols(const MCSection &Section) const override { + // Temporary labels in the string literals sections require symbols. The + // issue is that the x86_64 relocation format does not allow symbol + + // offset, and so the linker does not have enough information to resolve the + // access to the appropriate atom unless an external relocation is used. For + // non-cstring sections, we expect the compiler to use a non-temporary label + // for anything that could have an addend pointing outside the symbol. + // + // See <rdar://problem/4765733>. + const MCSectionMachO &SMO = static_cast<const MCSectionMachO&>(Section); + return SMO.getType() == MachO::S_CSTRING_LITERALS; + } + /// \brief Generate the compact unwind encoding for the CFI instructions. uint32_t generateCompactUnwindEncoding( ArrayRef<MCCFIInstruction> Instrs) const override { |

