~ubuntu-branches/ubuntu/utopic/binutils-arm64-cross/utopic

« back to all changes in this revision

Viewing changes to binutils-2.23.52.20130611/ld/testsuite/ld-ifunc/lib.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-06-20 17:38:09 UTC
  • Revision ID: package-import@ubuntu.com-20130620173809-app8lzgvymy5fg6c
Tags: 0.7
Build-depend on binutils-source (>= 2.23.52.20130620-1~).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
int
 
2
library_func1 (void)
 
3
{
 
4
  return 2;
 
5
}
 
6
 
 
7
int global = 1;
 
8
 
 
9
#ifdef WITH_IFUNC
 
10
 
 
11
static int minus_one (void) { return -1; }
 
12
static int zero (void) { return 0; }
 
13
 
 
14
void * library_func2_ifunc (void) __asm__ ("library_func2");
 
15
void * library_func2_ifunc (void) { return global ? minus_one : zero ; }
 
16
__asm__(".type library_func2, %gnu_indirect_function");
 
17
 
 
18
extern int library_func2 (int);
 
19
extern __typeof (library_func2) library_func2 __asm__ ("__GI_library_func2");
 
20
 
 
21
__asm__(".global __GI_library_func2");
 
22
__asm__(".hidden __GI_library_func2");
 
23
__asm__(".set __GI_library_func2, library_func2");
 
24
 
 
25
int
 
26
library_func (int x)
 
27
{
 
28
  return library_func2 (x);
 
29
}
 
30
 
 
31
#else /* WITHOUT_IFUNC */
 
32
 
 
33
int
 
34
library_func2 (void)
 
35
{
 
36
  return 3;
 
37
}
 
38
 
 
39
#endif