diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-07-17 00:34:35 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-07-17 00:34:35 +0000 |
commit | 11fa51b8f64823ae4acb844d782540d72e130f40 (patch) | |
tree | 1c046af07c67ad58b6239473abc85ecceae9e65b /elf | |
parent | d747a0a564d522ab31944eac60e923e4596b3684 (diff) | |
download | glibc-11fa51b8f64823ae4acb844d782540d72e130f40.tar.gz |
Update.
2002-07-01 H.J. Lu <hjl@gnu.org>
* elf/circleload1.c (load_dso): Call "circlemod1" and check
return value.
* elf/circlemod1.c (circlemod1): Return int.
* elf/circlemod2.c (circlemod2): Likewise.
* elf/circlemod2a.c (circlemod2): Likewise.
* elf/circlemod3.c (circlemod3): Likewise.
(circlemod3a): A new function.
Diffstat (limited to 'elf')
-rw-r--r-- | elf/circleload1.c | 18 | ||||
-rw-r--r-- | elf/circlemod1.c | 6 | ||||
-rw-r--r-- | elf/circlemod2.c | 6 | ||||
-rw-r--r-- | elf/circlemod2a.c | 6 | ||||
-rw-r--r-- | elf/circlemod3.c | 15 |
5 files changed, 37 insertions, 14 deletions
diff --git a/elf/circleload1.c b/elf/circleload1.c index 60f8fb5bad..7ac101a799 100644 --- a/elf/circleload1.c +++ b/elf/circleload1.c @@ -102,6 +102,24 @@ load_dso (const char **loading, int undef, int flag) printf ("ERRORS: dlopen shouldn't work for RTLD_NOW\n"); } + if (!undef) + { + int (*func) (void); + + func = dlsym (obj, "circlemod1"); + if (func == NULL) + { + ++errors; + printf ("ERRORS: cannot get address of \"circlemod1\": %s\n", + dlerror ()); + } + else if (func () != 3) + { + ++errors; + printf ("ERRORS: function \"circlemod1\" returned wrong result\n"); + } + } + loaded[0] = loading [0]; loaded[1] = loading [1]; loaded[2] = loading [2]; diff --git a/elf/circlemod1.c b/elf/circlemod1.c index 6b61a4d577..933ccd3c02 100644 --- a/elf/circlemod1.c +++ b/elf/circlemod1.c @@ -1,7 +1,7 @@ -extern void circlemod2 (void); +extern int circlemod2 (void); -void +int circlemod1 (void) { - circlemod2 (); + return circlemod2 (); } diff --git a/elf/circlemod2.c b/elf/circlemod2.c index 1c67abceef..ed8c1175fb 100644 --- a/elf/circlemod2.c +++ b/elf/circlemod2.c @@ -1,9 +1,9 @@ extern void circlemod2_undefined (void); -extern void circlemod3 (void); +extern int circlemod3 (void); -void +int circlemod2 (void) { circlemod2_undefined (); - circlemod3 (); + return circlemod3 (); } diff --git a/elf/circlemod2a.c b/elf/circlemod2a.c index f8664a9260..dc6410b28b 100644 --- a/elf/circlemod2a.c +++ b/elf/circlemod2a.c @@ -1,7 +1,7 @@ -extern void circlemod3 (void); +extern int circlemod3 (void); -void +int circlemod2 (void) { - circlemod3 (); + return circlemod3 (); } diff --git a/elf/circlemod3.c b/elf/circlemod3.c index 6ac00a0296..8d16fe682f 100644 --- a/elf/circlemod3.c +++ b/elf/circlemod3.c @@ -1,9 +1,14 @@ -extern void circlemod1 (void); -extern void circlemod2 (void); +extern int circlemod1 (void); +extern int circlemod2 (void); -void +int circlemod3 (void) { - circlemod1 (); - circlemod2 (); + return 3; +} + +int +circlemod3a (void) +{ + return circlemod1 () + circlemod2 (); } |