From 1c2edd03f4eb411a517240ce1ea72dbfd9359657 Mon Sep 17 00:00:00 2001
From: Matteo Cicuttin <datafl4sh@toxicnet.eu>
Date: Wed, 19 May 2021 14:50:33 +0200
Subject: [PATCH] better example.

---
 testdupsym/compile.sh | 2 +-
 testdupsym/lib1.c     | 4 ++++
 testdupsym/lib2.c     | 4 ++++
 testdupsym/main.c     | 4 ++++
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/testdupsym/compile.sh b/testdupsym/compile.sh
index bed9614..4e4b42e 100644
--- a/testdupsym/compile.sh
+++ b/testdupsym/compile.sh
@@ -1,4 +1,4 @@
 gcc -shared -o libl1.so lib1.c 
 gcc -shared -o libl2.so lib2.c
-gcc -o main main.c -L. -ll1 -ll2
+gcc -o main main.c -L. -ll2 -ll1
 
diff --git a/testdupsym/lib1.c b/testdupsym/lib1.c
index b70867f..2211720 100644
--- a/testdupsym/lib1.c
+++ b/testdupsym/lib1.c
@@ -3,3 +3,7 @@ int testfun(int x)
     return x+1;
 }
 
+int abc(int x)
+{
+    return x+11;
+}
diff --git a/testdupsym/lib2.c b/testdupsym/lib2.c
index 00ca0e6..3ef77f7 100644
--- a/testdupsym/lib2.c
+++ b/testdupsym/lib2.c
@@ -3,3 +3,7 @@ int testfun(int x)
     return x+2;
 }
 
+int def(int x)
+{
+    return x+22;
+}
diff --git a/testdupsym/main.c b/testdupsym/main.c
index 1757ac7..4b9c1db 100644
--- a/testdupsym/main.c
+++ b/testdupsym/main.c
@@ -1,10 +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;
 }
 
-- 
GitLab