[PATCH] D42635: [ELF] - Report valid binary filename when reporting error.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 01:49:51 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL324217: [ELF] - Report valid binary filename when reporting error. (authored by grimar, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D42635?vs=132563&id=132792#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D42635

Files:
  lld/trunk/ELF/InputFiles.cpp
  lld/trunk/ELF/InputFiles.h
  lld/trunk/test/ELF/duplicated-synthetic-sym.s


Index: lld/trunk/test/ELF/duplicated-synthetic-sym.s
===================================================================
--- lld/trunk/test/ELF/duplicated-synthetic-sym.s
+++ lld/trunk/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 <internal>:(.data+0x0)
+// CHECK-NEXT: defined at file.bin:(.data+0x0)
 
 .globl  _binary_file_bin_start
 _binary_file_bin_start:
Index: lld/trunk/ELF/InputFiles.h
===================================================================
--- lld/trunk/ELF/InputFiles.h
+++ lld/trunk/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<Symbol *> getSymbols() {
-    assert(FileKind == ObjKind || FileKind == BitcodeKind ||
-           FileKind == ArchiveKind);
+    assert(FileKind == BinaryKind || FileKind == ObjKind ||
+           FileKind == BitcodeKind || FileKind == ArchiveKind);
     return Symbols;
   }
 
Index: lld/trunk/ELF/InputFiles.cpp
===================================================================
--- lld/trunk/ELF/InputFiles.cpp
+++ lld/trunk/ELF/InputFiles.cpp
@@ -1032,8 +1032,8 @@
 
 void BinaryFile::parse() {
   ArrayRef<uint8_t> Data = toArrayRef(MB.getBuffer());
-  auto *Section = make<InputSection>(nullptr, SHF_ALLOC | SHF_WRITE,
-                                     SHT_PROGBITS, 8, Data, ".data");
+  auto *Section = make<InputSection>(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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42635.132792.patch
Type: text/x-patch
Size: 1746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180205/f496be05/attachment.bin>


More information about the llvm-commits mailing list