OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [linux/] [uClibc/] [test/] [dlopen/] [libtest1.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
#include <stdio.h>
2
 
3
extern int libtest2_func(const char *s);
4
 
5
 
6
void __attribute__((constructor)) libtest1_ctor(void)
7
{
8
    printf("libtest1: constructor!\n");
9
}
10
 
11
void __attribute__((destructor)) libtest1_dtor(void)
12
{
13
    printf("libtest1: destructor!\n");
14
}
15
 
16
void __attribute__((weak)) function1(void)
17
{
18
    printf("libtest1: I am weak function1!\n");
19
}
20
 
21
void function2(void)
22
{
23
    printf("libtest1: I am function2!\n");
24
}
25
 
26
 
27
int dltest(const char *s)
28
{
29
    printf( "libtest1: function1 = %p\n"
30
            "libtest1: function2 = %p\n",
31
            function1, function2);
32
    function1();
33
    function2();
34
    return(libtest2_func(s));
35
}
36
 
37
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.