-
-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ELF] Export symbols defined by
--defsym
Previously, symbols defined by `--defsym` would never be exported because we created a dynamic symbol table before processing `--defsym`.
- Loading branch information
Showing
5 changed files
with
83 additions
and
58 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
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,22 @@ | ||
#!/bin/bash | ||
export LC_ALL=C | ||
set -e | ||
CC="${TEST_CC:-cc}" | ||
CXX="${TEST_CXX:-c++}" | ||
GCC="${TEST_GCC:-gcc}" | ||
GXX="${TEST_GXX:-g++}" | ||
OBJDUMP="${OBJDUMP:-objdump}" | ||
MACHINE="${MACHINE:-$(uname -m)}" | ||
testname=$(basename "$0" .sh) | ||
echo -n "Testing $testname ... " | ||
t=out/test/elf/$MACHINE/$testname | ||
mkdir -p $t | ||
|
||
cat <<EOF | $CC -fPIC -o $t/a.o -c -xc - | ||
void foo() {} | ||
EOF | ||
|
||
$CC -B. -o $t/b.so -shared -Wl,-defsym=bar=foo $t/a.o | ||
nm -D $t/b.so | ||
|
||
echo OK |