This repository has been archived by the owner on Feb 5, 2019. It is now read-only.
forked from llvm-mirror/lld
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ELF: Add libcall symbols to the link when LTO is being used.
If any of our inputs are bitcode files, the LTO code generator may create references to certain library functions that might not be explicit in the bitcode file's symbol table. If any of those library functions are defined in a bitcode file in an archive member, we need to arrange to use LTO to compile those archive members by adding them to the link beforehand. Differential Revision: https://reviews.llvm.org/D50017 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@338434 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
3 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
define void @memcpy() { | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; RUN: rm -f %t.a | ||
; RUN: llvm-as -o %t.o %s | ||
; RUN: llvm-as -o %t2.o %S/Inputs/libcall-archive.ll | ||
; RUN: llvm-ar rcs %t.a %t2.o | ||
; RUN: ld.lld -o %t %t.o %t.a | ||
; RUN: llvm-nm %t | FileCheck %s | ||
|
||
; CHECK: T _start | ||
; CHECK: T memcpy | ||
|
||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
define void @_start(i8* %a, i8* %b) { | ||
entry: | ||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 1024, i1 false) | ||
ret void | ||
} | ||
|
||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) |