[lld] r268229 - Copy thin archive members with --reproduce.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon May 2 06:54:10 PDT 2016
Author: rafael
Date: Mon May 2 08:54:10 2016
New Revision: 268229
URL: http://llvm.org/viewvc/llvm-project?rev=268229&view=rev
Log:
Copy thin archive members with --reproduce.
Added:
lld/trunk/test/ELF/reproduce-thin-archive.s
Modified:
lld/trunk/ELF/InputFiles.cpp
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=268229&r1=268228&r2=268229&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Mon May 2 08:54:10 2016
@@ -372,6 +372,9 @@ MemoryBufferRef ArchiveFile::getMember(c
if (!Seen.insert(C.getChildOffset()).second)
return MemoryBufferRef();
+ if (!Config->Reproduce.empty() && C.getParent()->isThin())
+ copyInputFile(check(C.getFullName()));
+
return check(C.getMemoryBufferRef(),
"could not get the buffer for the member defining symbol " +
Sym->getName());
Added: lld/trunk/test/ELF/reproduce-thin-archive.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/reproduce-thin-archive.s?rev=268229&view=auto
==============================================================================
--- lld/trunk/test/ELF/reproduce-thin-archive.s (added)
+++ lld/trunk/test/ELF/reproduce-thin-archive.s Mon May 2 08:54:10 2016
@@ -0,0 +1,14 @@
+# REQUIRES: x86, shell
+
+# RUN: rm -rf %t.dir
+# RUN: mkdir -p %t.dir
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.dir/foo.o
+# RUN: cd %t.dir
+# RUN: llvm-ar rcT foo.a foo.o
+# RUN: ld.lld -m elf_x86_64 foo.a -o bar --reproduce repro
+# RUN: diff foo.a repro/%:t.dir/foo.a
+# RUN: diff foo.o repro/%:t.dir/foo.o
+
+.globl _start
+_start:
+ nop
More information about the llvm-commits
mailing list