Index: ELF/InputFiles.h =================================================================== --- ELF/InputFiles.h +++ ELF/InputFiles.h @@ -90,8 +90,8 @@ // Returns object file symbols. It is a runtime error to call this // function on files of other types. ArrayRef getSymbols() { - assert(FileKind == ObjKind || FileKind == BitcodeKind || - FileKind == ArchiveKind); + assert(FileKind == BinaryKind || FileKind == ObjKind || + FileKind == BitcodeKind || FileKind == ArchiveKind); return Symbols; } Index: ELF/InputFiles.cpp =================================================================== --- ELF/InputFiles.cpp +++ ELF/InputFiles.cpp @@ -1024,8 +1024,8 @@ void BinaryFile::parse() { ArrayRef Data = toArrayRef(MB.getBuffer()); - auto *Section = make(nullptr, SHF_ALLOC | SHF_WRITE, - SHT_PROGBITS, 8, Data, ".data"); + auto *Section = make(this, SHF_ALLOC | SHF_WRITE, SHT_PROGBITS, + 8, Data, ".data"); Sections.push_back(Section); // For each input file foo that is embedded to a result as a binary Index: test/ELF/duplicated-synthetic-sym.s =================================================================== --- test/ELF/duplicated-synthetic-sym.s +++ test/ELF/duplicated-synthetic-sym.s @@ -9,7 +9,7 @@ // CHECK: duplicate symbol: _binary_file_bin_start // CHECK-NEXT: defined at {{.*}}.o:(.text+0x0) -// CHECK-NEXT: defined at :(.data+0x0) +// CHECK-NEXT: defined at file.bin:(.data+0x0) .globl _binary_file_bin_start _binary_file_bin_start: