forked from ptitSeb/box86
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
106 additions
and
14 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 @@ | ||
2, 2/2 |
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 @@ | ||
2, 2/2 |
Binary file not shown.
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,32 @@ | ||
/* | ||
* Compile with (on x86_64 archs): | ||
* gcc -m32 -DV1 -shared -o test15_v1.so test15.c | ||
* gcc -m32 -DV2 -shared -o test15_v2.so test15.c -Wl,--version-script=test15_version.map | ||
* gcc -m32 -shared -o test15_dv1.so test15.c -L. -Wl,-rpath=. -l:test15_v1.so | ||
* gcc -m32 -DMAIN -o test15 test15.c -L. -Wl,-rpath=. -l:test15_dv1.so -l:test15_v2.so | ||
*/ | ||
|
||
#if defined(MAIN) | ||
int returnVersion(); | ||
int acquireVersion1(); | ||
int acquireVersion2(); | ||
#include <stdio.h> | ||
|
||
int main(int argc, char **argv) { printf("%d, %d/%d\n", returnVersion(), acquireVersion1(), acquireVersion2()); return 0; } | ||
|
||
#elif defined(V2) | ||
int __attribute__((noinline)) getVersion() { asm(""); return 2; } | ||
int returnVersion() { return getVersion(); } | ||
|
||
#elif defined(V1) | ||
int __attribute__((noinline)) getVersion() { asm(""); return 1; } | ||
int acquireVersion() { return getVersion(); } | ||
|
||
#else | ||
int getVersion(); | ||
int acquireVersion(); | ||
|
||
int acquireVersion1() { return getVersion(); } | ||
int acquireVersion2() { return acquireVersion(); } | ||
|
||
#endif |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,8 @@ | ||
LIBV2 { | ||
global: | ||
getVersion; | ||
returnVersion; | ||
|
||
local: | ||
*; | ||
}; |
Binary file not shown.
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,32 @@ | ||
/* | ||
* Compile with (on x86_64 archs): | ||
* gcc -m32 -DV1 -shared -o test16_v1.so test16.c -Wl,--version-script=test16_version.map | ||
* gcc -m32 -DV2 -shared -o test16_v2.so test16.c | ||
* gcc -m32 -shared -o test16_dv1.so test16.c -L. -Wl,-rpath=. -l:test16_v1.so | ||
* gcc -m32 -DMAIN -o test16 test16.c -L. -Wl,-rpath=. -l:test16_dv1.so -l:test16_v2.so | ||
*/ | ||
|
||
#if defined(MAIN) | ||
int returnVersion(); | ||
int acquireVersion1(); | ||
int acquireVersion2(); | ||
#include <stdio.h> | ||
|
||
int main(int argc, char **argv) { printf("%d, %d/%d\n", returnVersion(), acquireVersion1(), acquireVersion2()); return 0; } | ||
|
||
#elif defined(V1) | ||
int __attribute__((noinline)) getVersion() { asm(""); return 1; } | ||
int acquireVersion() { return getVersion(); } | ||
|
||
#elif defined(V2) | ||
int __attribute__((noinline)) getVersion() { asm(""); return 2; } | ||
int returnVersion() { return getVersion(); } | ||
|
||
#else | ||
int getVersion(); | ||
int returnVersion(); | ||
|
||
int acquireVersion1() { return getVersion(); } | ||
int acquireVersion2() { return returnVersion(); } | ||
|
||
#endif |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,8 @@ | ||
LIBV1 { | ||
global: | ||
getVersion; | ||
acquireVersion; | ||
|
||
local: | ||
*; | ||
}; |