[PATCH] D33937: [ELF] - Allow producing -r output if only empty archive is given.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 08:43:21 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/Driver.cpp:188
     // we'll handle it as if it had a symbol table.
     if (!File->hasSymbolTable()) {
       for (const auto &P : getArchiveMembers(MBRef))
----------------
You should check for `!File->isEmpty() && !File->hasSymbolTable()` here instead of making an non-obvious change to LinkerDriver::createFiles.


================
Comment at: test/ELF/Inputs/relocatable-empty-archive.s:1
+!<arch>
----------------
This is not an .s file but .a. But you want to avoid checking in an .a file in general. Please create an empty file in the test file using the ar command.


================
Comment at: test/ELF/relocatable-empty-archive.s:1
+# RUN: ld.lld -m elf_x86_64 %S/Inputs/relocatable-empty-archive.s -o %t -r
----------------
Does this actually create a correct object file? Verify it using objdump.


https://reviews.llvm.org/D33937





More information about the llvm-commits mailing list