-
-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lower the priority of DSO symbols than in-archive symbols
Assume both `foo.a` and `bar.so` define the same symbol `baz`. If `baz`'s symbol visibility is hidden, it needs to be resolved within the output file, i.e., from `foo.a`. However, previously, such symbol was resolved to the one in `bar.so`. To fix the problem, we'll lower the symbol priority for DSOs. Fixes #1342
- Loading branch information
Showing
4 changed files
with
32 additions
and
6 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
Empty file.
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,21 @@ | ||
#!/bin/bash | ||
. $(dirname $0)/common.inc | ||
|
||
cat <<EOF | $CC -c -o $t/a.o -fPIC -xc - | ||
void foo() {} | ||
EOF | ||
|
||
rm -f $t/b.a | ||
ar rcs $t/b.a $t/a.o | ||
|
||
cat <<EOF | $CC -shared -o $t/c.so -fPIC -xc - | ||
void foo() {} | ||
EOF | ||
|
||
cat <<EOF | $CC -o $t/d.o -fPIC -c -xc - | ||
__attribute__((visibility("hidden"))) void foo(); | ||
int main() { foo(); } | ||
EOF | ||
|
||
$CC -B. -o $t/exe $t/d.o $t/c.so $t/b.a | ||
$QEMU $t/exe |
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