diff --git a/testdupsym/compile.sh b/testdupsym/compile.sh new file mode 100644 index 0000000000000000000000000000000000000000..4e4b42e122c1121167db5a59c22b94e5faeca296 --- /dev/null +++ b/testdupsym/compile.sh @@ -0,0 +1,4 @@ +gcc -shared -o libl1.so lib1.c +gcc -shared -o libl2.so lib2.c +gcc -o main main.c -L. -ll2 -ll1 + diff --git a/testdupsym/lib1.c b/testdupsym/lib1.c new file mode 100644 index 0000000000000000000000000000000000000000..2211720ba5561ef3fa1fa45cdb63d3303f44f088 --- /dev/null +++ b/testdupsym/lib1.c @@ -0,0 +1,9 @@ +int testfun(int x) +{ + return x+1; +} + +int abc(int x) +{ + return x+11; +} diff --git a/testdupsym/lib2.c b/testdupsym/lib2.c new file mode 100644 index 0000000000000000000000000000000000000000..3ef77f71910f26c4f1deda56e1726144cc3cfe60 --- /dev/null +++ b/testdupsym/lib2.c @@ -0,0 +1,9 @@ +int testfun(int x) +{ + return x+2; +} + +int def(int x) +{ + return x+22; +} diff --git a/testdupsym/main.c b/testdupsym/main.c new file mode 100644 index 0000000000000000000000000000000000000000..4b9c1db401173685c6b39aae31306403e65edade --- /dev/null +++ b/testdupsym/main.c @@ -0,0 +1,14 @@ +#include <stdio.h> + +int testfun(int); +int abc(int); +int def(int); + +int main(void) +{ + printf("%d\n", testfun(42)); + printf("%d\n", abc(42)); + printf("%d\n", def(42)); + return 0; +} +