-
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.
2000-03-16 Ulrich Drepper <drepper@redhat.com> * elf/Makefile: Add rules to compile and rune constload1 test. * elf/constload1.c: New file. * elf/constload2.c: New file. * elf/constload3.c: New file.
- Loading branch information
Ulrich Drepper
committed
Mar 17, 2000
1 parent
13a8360
commit 19cf43b
Showing
5 changed files
with
65 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <dlfcn.h> | ||
#include <errno.h> | ||
#include <error.h> | ||
#include <stdlib.h> | ||
|
||
int | ||
main (void) | ||
{ | ||
int (*foo) (void); | ||
void *h; | ||
int ret; | ||
|
||
h = dlopen ("constload2.so", RTLD_LAZY | RTLD_GLOBAL); | ||
if (h == NULL) | ||
error (EXIT_FAILURE, errno, "cannot load module \"constload2.so\""); | ||
foo = dlsym (h, "foo"); | ||
ret = foo (); | ||
dlclose (h); | ||
return ret; | ||
} |
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,24 @@ | ||
#include <dlfcn.h> | ||
|
||
extern int bar (void); | ||
|
||
void *h; | ||
|
||
int | ||
foo (void) | ||
{ | ||
return 42 + bar (); | ||
} | ||
|
||
int | ||
baz (void) | ||
{ | ||
return -21; | ||
} | ||
|
||
void | ||
__attribute__ ((__constructor__)) | ||
init (void) | ||
{ | ||
h = dlopen ("constload3.so", RTLD_GLOBAL | RTLD_LAZY); | ||
} |
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,7 @@ | ||
extern int baz (void); | ||
|
||
int | ||
bar (void) | ||
{ | ||
return -21 + baz (); | ||
} |