summaryrefslogtreecommitdiff
path: root/tests/bionic/libc/bionic/lib_relocs.c
blob: af4cf6f8684440328b2c80f5950fe98b3e1038da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* this is part of the test_relocs.c test, which is used to check that
 * the relocations generated in a shared object are properly handled
 * by the Bionic dynamic linker
 */

struct foo { int first, second; };
struct foo Foo = {1, 2};

int* FooPtr[] = { &Foo.first, &Foo.second };

int func1( void )
{
    return *FooPtr[0];
}

int  func2( void )
{
    return *FooPtr[1];
}