From 0e0cd5be403a83de607f88e469a4de06051ac39c Mon Sep 17 00:00:00 2001 From: George Rimar Date: Mon, 26 Nov 2018 10:07:10 +0000 Subject: [PATCH] [LLD][ELF] - Add llvm_unreachable. NFC. We never should call writeTo() for BSS section. llvm-svn: 347540 --- lld/ELF/SyntheticSections.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h index f35a8bb..3458bdf 100644 --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -170,7 +170,9 @@ private: class BssSection final : public SyntheticSection { public: BssSection(StringRef Name, uint64_t Size, uint32_t Alignment); - void writeTo(uint8_t *) override {} + void writeTo(uint8_t *) override { + llvm_unreachable("unexpected writeTo() call for SHT_NOBITS section"); + } bool empty() const override { return getSize() == 0; } size_t getSize() const override { return Size; } -- 2.7.4