From 7aafe467d2aa6307d34c5762b8c3bf843d713737 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 22 Nov 2021 13:59:23 -0800 Subject: [PATCH] [ELF] Simplify a condition with config->copyRelocs. NFC --- lld/ELF/InputFiles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index e8a4188..9399bb4 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -966,7 +966,7 @@ InputSectionBase *ObjFile::createInputSection(uint32_t idx, // `nullptr` for the normal case. However, if -r or --emit-relocs is // specified, we need to copy them to the output. (Some post link analysis // tools specify --emit-relocs to obtain the information.) - if (!config->relocatable && !config->emitRelocs) + if (!config->copyRelocs) return nullptr; InputSection *relocSec = make(*this, sec, name); // If the relocated section is discarded (due to /DISCARD/ or -- 2.7.4