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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [test/] [dlopen/] [libtest2.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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