diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 078b2c47996d..2898048f12bb 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -131,7 +131,7 @@ MipsAbiFlagsSection *MipsAbiFlagsSection::create() { bool Create = false; for (InputSectionBase *Sec : InputSections) { - if (!Sec->Live || Sec->Type != SHT_MIPS_ABIFLAGS) + if (Sec->Type != SHT_MIPS_ABIFLAGS) continue; Sec->Live = false; Create = true; @@ -200,7 +200,7 @@ MipsOptionsSection *MipsOptionsSection::create() { bool Create = false; for (InputSectionBase *Sec : InputSections) { - if (!Sec->Live || Sec->Type != SHT_MIPS_OPTIONS) + if (Sec->Type != SHT_MIPS_OPTIONS) continue; Sec->Live = false; Create = true; @@ -258,7 +258,7 @@ MipsReginfoSection *MipsReginfoSection::create() { bool Create = false; for (InputSectionBase *Sec : InputSections) { - if (!Sec->Live || Sec->Type != SHT_MIPS_REGINFO) + if (Sec->Type != SHT_MIPS_REGINFO) continue; Sec->Live = false; Create = true; diff --git a/lld/test/ELF/mips-elf-flags.s b/lld/test/ELF/mips-elf-flags.s index 4a33d5211824..f8f916c9353d 100644 --- a/lld/test/ELF/mips-elf-flags.s +++ b/lld/test/ELF/mips-elf-flags.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ # RUN: %S/Inputs/mips-dynamic.s -o %t-so.o -# RUN: ld.lld %t-so.o -shared -o %t.so +# RUN: ld.lld %t-so.o --gc-sections -shared -o %t.so # RUN: llvm-readobj -h -mips-abi-flags %t.so | FileCheck -check-prefix=SO %s # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o diff --git a/lld/test/ELF/mips-options.s b/lld/test/ELF/mips-options.s index edafd09c8da4..18f5af8ece6e 100644 --- a/lld/test/ELF/mips-options.s +++ b/lld/test/ELF/mips-options.s @@ -6,7 +6,7 @@ # RUN: echo "SECTIONS { \ # RUN: . = 0x100000000; \ # RUN: .got : { *(.got) } }" > %t.rel.script -# RUN: ld.lld %t1.o %t2.o --script %t.rel.script -shared -o %t.so +# RUN: ld.lld %t1.o %t2.o --gc-sections --script %t.rel.script -shared -o %t.so # RUN: llvm-readobj -symbols -mips-options %t.so | FileCheck %s # REQUIRES: mips diff --git a/lld/test/ELF/mips-reginfo.s b/lld/test/ELF/mips-reginfo.s index dd4771c98b8d..4024a2f6634f 100644 --- a/lld/test/ELF/mips-reginfo.s +++ b/lld/test/ELF/mips-reginfo.s @@ -3,7 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t1.o # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ # RUN: %S/Inputs/mips-dynamic.s -o %t2.o -# RUN: ld.lld %t1.o %t2.o -shared -o %t.so +# RUN: ld.lld %t1.o %t2.o --gc-sections -shared -o %t.so # RUN: llvm-readobj -symbols -mips-reginfo %t.so | FileCheck %s # REQUIRES: mips