Index: test/tools/llvm-objdump/X86/section-filter-relocs.test =================================================================== --- test/tools/llvm-objdump/X86/section-filter-relocs.test +++ test/tools/llvm-objdump/X86/section-filter-relocs.test @@ -18,7 +18,13 @@ # DISASM-NEXT: 400: e8 00 00 00 00 callq 0 <.text+0x5> # RELOC-NEXT: 00000401: R_X86_64_PC32 foo+1 # RELOC-NEXT: 00000401: R_X86_64_GOT32 foo - +# DISASM: Disassembly of section .rodata: +# DISASM-EMPTY: +# DISASM-NEXT: 0000000000000000 .rodata: +# DISASM-NEXT: 0: 00 00 addb %al, (%rax) +# RELOC-NEXT: 0000000000000000: R_X86_64_NONE foo +# DISASM-NEXT: 2: 00 00 addb %al, (%rax) + --- !ELF FileHeader: Class: ELFCLASS64 Index: tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- tools/llvm-objdump/llvm-objdump.cpp +++ tools/llvm-objdump/llvm-objdump.cpp @@ -1095,7 +1095,8 @@ array_pod_sort(AbsoluteSymbols.begin(), AbsoluteSymbols.end()); for (const SectionRef &Section : ToolSectionFilter(*Obj)) { - if (!DisassembleAll && (!Section.isText() || Section.isVirtual())) + if (FilterSections.empty() && !DisassembleAll && + (!Section.isText() || Section.isVirtual())) continue; uint64_t SectionAddr = Section.getAddress();