Index: test/ELF/edata-etext.s =================================================================== --- test/ELF/edata-etext.s +++ test/ELF/edata-etext.s @@ -18,7 +18,6 @@ # CHECK-NEXT: 2 .data 00000002 0000000000202000 DATA # CHECK-NEXT: 3 .bss 00000006 0000000000202004 BSS # CHECK: SYMBOL TABLE: -# CHECK-NEXT: 0000000000000000 *UND* 00000000 # CHECK-NEXT: 0000000000202002 .data 00000000 _edata # CHECK-NEXT: 000000000020200a .bss 00000000 _end # CHECK-NEXT: 0000000000201001 .text 00000000 _etext Index: test/ELF/linkerscript/align4.test =================================================================== --- test/ELF/linkerscript/align4.test +++ test/ELF/linkerscript/align4.test @@ -4,7 +4,6 @@ # RUN: llvm-objdump -t %t | FileCheck %s # CHECK-LABEL: SYMBOL TABLE: -# CHECK-NEXT: 0000000000000000 *UND* 00000000 # CHECK-NEXT: 0000000000014008 .text 00000000 _start # CHECK-NEXT: 0000000000010000 *ABS* 00000000 __code_base__ # CHECK-NEXT: 0000000000001000 *ABS* 00000000 VAR Index: test/ELF/linkerscript/sizeof.s =================================================================== --- test/ELF/linkerscript/sizeof.s +++ test/ELF/linkerscript/sizeof.s @@ -18,7 +18,6 @@ # CHECK-NEXT: 2 .bbb 00000010 # CHECK-NEXT: 3 .ccc 00000018 # CHECK: SYMBOL TABLE: -# CHECK-NEXT: 0000000000000000 *UND* 00000000 # CHECK-NEXT: .text 00000000 _start # CHECK-NEXT: 0000000000000008 *ABS* 00000000 _aaa # CHECK-NEXT: 0000000000000010 *ABS* 00000000 _bbb Index: test/ELF/linkerscript/sizeofheaders.s =================================================================== --- test/ELF/linkerscript/sizeofheaders.s +++ test/ELF/linkerscript/sizeofheaders.s @@ -9,7 +9,6 @@ # RUN: llvm-objdump -t %t1 | FileCheck %s #CHECK: SYMBOL TABLE: -#CHECK-NEXT: 0000000000000000 *UND* 00000000 #CHECK-NEXT: 00000000000000e8 .text 00000000 _start #CHECK-NEXT: 00000000000000e8 *ABS* 00000000 _size Index: test/ELF/linkerscript/symbol-assignexpr.s =================================================================== --- test/ELF/linkerscript/symbol-assignexpr.s +++ test/ELF/linkerscript/symbol-assignexpr.s @@ -25,7 +25,6 @@ # RUN: llvm-objdump -t %t1 | FileCheck %s # CHECK: SYMBOL TABLE: -# CHECK-NEXT: 0000000000000000 *UND* 00000000 # CHECK-NEXT: 0000000000000000 .text 00000000 _start # CHECK-NEXT: 0000000000005678 *ABS* 00000000 bar # CHECK-NEXT: 0000000000009abc *ABS* 00000000 baz Index: test/ELF/linkerscript/symbol-memoryexpr.s =================================================================== --- test/ELF/linkerscript/symbol-memoryexpr.s +++ test/ELF/linkerscript/symbol-memoryexpr.s @@ -13,7 +13,6 @@ # RUN: llvm-objdump -t %t1 | FileCheck %s # CHECK: SYMBOL TABLE: -# CHECK-NEXT: 0000000000000000 *UND* 00000000 # CHECK-NEXT: 0000000000008000 .text 00000000 _start # CHECK-NEXT: 0000000000008000 *ABS* 00000000 origin # CHECK-NEXT: 0000000000040000 *ABS* 00000000 length Index: test/ELF/wrap-no-real.s =================================================================== --- test/ELF/wrap-no-real.s +++ test/ELF/wrap-no-real.s @@ -18,8 +18,7 @@ // RUN: llvm-objdump -t %t | FileCheck -check-prefix=SYM %s -// SYM: 0000000000000000 *UND* 00000000 -// SYM-NEXT: 0000000000202000 .dynamic 00000000 .hidden _DYNAMIC +// SYM: 0000000000202000 .dynamic 00000000 .hidden _DYNAMIC // SYM-NEXT: 0000000000011000 *ABS* 00000000 __real_foo // SYM-NEXT: 0000000000011010 *ABS* 00000000 __wrap_foo // SYM-NEXT: 0000000000201000 .text 00000000 _start Index: test/tools/llvm-objdump/X86/demangle.s =================================================================== --- test/tools/llvm-objdump/X86/demangle.s +++ test/tools/llvm-objdump/X86/demangle.s @@ -6,7 +6,6 @@ ## Check we demangle symbols when printing symbol table. # CHECK: SYMBOL TABLE: -# CHECK-NEXT: 0000000000000000 *UND* 00000000 # CHECK-NEXT: 0000000000000000 g F .text 00000000 foo() ## Check the case when relocations are inlined into disassembly. Index: test/tools/llvm-objdump/X86/out-of-section-sym.test =================================================================== --- test/tools/llvm-objdump/X86/out-of-section-sym.test +++ test/tools/llvm-objdump/X86/out-of-section-sym.test @@ -6,7 +6,6 @@ CHECK-NEXT: _start: CHECK-NEXT: 10: c3 retl CHECK-NEXT: SYMBOL TABLE: -CHECK-NEXT: 00000000 *UND* 00000000 CHECK-NEXT: 00000010 l d .text 00000000 .text CHECK-NEXT: 00000010 .text 00000000 _start CHECK-NEXT: 00000020 .text 00000000 _fdata Index: test/tools/llvm-objdump/symbol-table-elf.test =================================================================== --- test/tools/llvm-objdump/symbol-table-elf.test +++ test/tools/llvm-objdump/symbol-table-elf.test @@ -5,7 +5,6 @@ # RUN: FileCheck %s --input-file=%t1 # CHECK: SYMBOL TABLE: -# CHECK-NEXT: 0000000000000000 *UND* 00000000 # CHECK-NEXT: 0000000000001004 l F .text 00000000 lfoo # CHECK-NEXT: 0000000000001008 l O .text 00000000 lbar # CHECK-NEXT: 0000000000001004 g F .text 00000000 foo Index: tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- tools/llvm-objdump/llvm-objdump.cpp +++ tools/llvm-objdump/llvm-objdump.cpp @@ -1972,7 +1972,14 @@ printCOFFSymbolTable(coff); return; } - for (const SymbolRef &Symbol : o->symbols()) { + + for (auto I = o->symbol_begin(), E = o->symbol_end(); I != E; ++I) { + // Skip printing the special zero symbol when dumping ELF file. + // This makes output to be consistent with the GNU objdump. + if (I == o->symbol_begin() && isa(o)) + continue; + + const SymbolRef &Symbol = *I; Expected AddressOrError = Symbol.getAddress(); if (!AddressOrError) report_error(ArchiveName, o->getFileName(), AddressOrError.takeError(),