-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ELF: Compute used bit for --as-needed during symbol resolution.
We can now use this to decide whether to emit a verneed during the final pass over the symbols. We were previously wrongly creating a verneed entry in the case where all references to a DSO's symbols were weak. In a future change we may also want to use the used bit to control whether shared symbols are preemptible and appear in the dynsym. This seems a little tricky to do at the moment because isNeeded() is templated. The only other functional change here is that we emit a DT_NEEDED for DSOs whose symbols are all preempted by objects that appear later in the link. But that doesn't seem too important to me. Differential Revision: http://reviews.llvm.org/D21171 llvm-svn: 272282
- Loading branch information
Showing
3 changed files
with
26 additions
and
10 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
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,14 @@ | ||
# REQUIRES: x86 | ||
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o | ||
# RUN: ld.lld %t.o --as-needed %S/Inputs/verneed1.so -o %t | ||
# RUN: llvm-readobj -V %t | FileCheck %s | ||
|
||
# CHECK: SHT_GNU_verneed { | ||
# CHECK-NEXT: } | ||
|
||
.weak f1 | ||
|
||
.globl _start | ||
_start: | ||
.data | ||
.long f1 |