Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 332927
Collapse All | Expand All

(-)a/sysdeps/unix/sysv/linux/ia64/Makefile (-6 lines)
Lines 12-23 sysdep_headers += sys/io.h Link Here
12
sysdep_routines += ioperm clone2
12
sysdep_routines += ioperm clone2
13
endif
13
endif
14
14
15
ifeq ($(subdir),elf)
16
sysdep-dl-routines += dl-static
17
sysdep_routines += $(sysdep-dl-routines)
18
sysdep-rtld-routines += $(sysdep-dl-routines)
19
endif
20
21
ifeq ($(subdir),rt)
15
ifeq ($(subdir),rt)
22
librt-routines += rt-sysdep
16
librt-routines += rt-sysdep
23
endif
17
endif
(-)a/sysdeps/unix/sysv/linux/Makefile (-1 / +3 lines)
Lines 147-153 sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \ Link Here
147
endif
147
endif
148
148
149
ifeq ($(subdir),elf)
149
ifeq ($(subdir),elf)
150
sysdep-rtld-routines += dl-brk dl-sbrk
150
sysdep-dl-routines += dl-static
151
sysdep_routines += dl-static
152
sysdep-rtld-routines += dl-brk dl-sbrk dl-static
151
153
152
CPPFLAGS-lddlibc4 += -DNOT_IN_libc
154
CPPFLAGS-lddlibc4 += -DNOT_IN_libc
153
endif
155
endif
(-)a/sysdeps/unix/sysv/linux/ia64/dl-static.c (-69 lines)
Lines 1-69 Link Here
1
/* Variable initialization.  IA-64 version.
2
   Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
3
   This file is part of the GNU C Library.
4
5
   The GNU C Library is free software; you can redistribute it and/or
6
   modify it under the terms of the GNU Lesser General Public
7
   License as published by the Free Software Foundation; either
8
   version 2.1 of the License, or (at your option) any later version.
9
10
   The GNU C Library is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Lesser General Public License for more details.
14
15
   You should have received a copy of the GNU Lesser General Public
16
   License along with the GNU C Library; if not, write to the Free
17
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18
   02111-1307 USA.  */
19
20
#include <ldsodefs.h>
21
22
#ifdef SHARED
23
24
void
25
_dl_var_init (void *array[])
26
{
27
  /* It has to match "variables" below. */
28
  enum
29
    {
30
      DL_PAGESIZE = 0,
31
      DL_CLKTCK
32
    };
33
34
  GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
35
  GLRO(dl_clktck) = *((int *) array[DL_CLKTCK]);
36
}
37
38
#else
39
#include <bits/libc-lock.h>
40
41
__libc_lock_define_initialized_recursive (static, _dl_static_lock)
42
43
static void *variables[] =
44
{
45
  &GLRO(dl_pagesize),
46
  &GLRO(dl_clktck)
47
};
48
49
void
50
_dl_static_init (struct link_map *map)
51
{
52
  const ElfW(Sym) *ref = NULL;
53
  lookup_t loadbase;
54
  void (*f) (void *[]);
55
56
  __libc_lock_lock_recursive (_dl_static_lock);
57
58
  loadbase = _dl_lookup_symbol_x ("_dl_var_init", map, &ref,
59
				  map->l_local_scope, NULL, 0, 1, NULL);
60
  if (ref != NULL)
61
    {
62
      f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
63
      f (variables);
64
    }
65
66
  __libc_lock_unlock_recursive (_dl_static_lock);
67
}
68
69
#endif
(-)a/sysdeps/unix/sysv/linux/dl-static.c (+69 lines)
Line 0 Link Here
1
/* Variable initialization.
2
   Copyright (C) 2001, 2002, 2003, 2004, 2010 Free Software Foundation, Inc.
3
   This file is part of the GNU C Library.
4
5
   The GNU C Library is free software; you can redistribute it and/or
6
   modify it under the terms of the GNU Lesser General Public
7
   License as published by the Free Software Foundation; either
8
   version 2.1 of the License, or (at your option) any later version.
9
10
   The GNU C Library is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Lesser General Public License for more details.
14
15
   You should have received a copy of the GNU Lesser General Public
16
   License along with the GNU C Library; if not, write to the Free
17
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18
   02111-1307 USA.  */
19
20
#include <ldsodefs.h>
21
22
#ifdef SHARED
23
24
void
25
_dl_var_init (void *array[])
26
{
27
  /* It has to match "variables" below. */
28
  enum
29
    {
30
      DL_PAGESIZE = 0,
31
      DL_CLKTCK
32
    };
33
34
  GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
35
  GLRO(dl_clktck) = *((int *) array[DL_CLKTCK]);
36
}
37
38
#else
39
#include <bits/libc-lock.h>
40
41
__libc_lock_define_initialized_recursive (static, _dl_static_lock)
42
43
static void *variables[] =
44
{
45
  &GLRO(dl_pagesize),
46
  &GLRO(dl_clktck)
47
};
48
49
void
50
_dl_static_init (struct link_map *map)
51
{
52
  const ElfW(Sym) *ref = NULL;
53
  lookup_t loadbase;
54
  void (*f) (void *[]);
55
56
  __libc_lock_lock_recursive (_dl_static_lock);
57
58
  loadbase = _dl_lookup_symbol_x ("_dl_var_init", map, &ref,
59
				  map->l_local_scope, NULL, 0, 1, NULL);
60
  if (ref != NULL)
61
    {
62
      f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
63
      f (variables);
64
    }
65
66
  __libc_lock_unlock_recursive (_dl_static_lock);
67
}
68
69
#endif
(-)a/sysdeps/unix/sysv/linux/ia64/ldsodefs.h (-33 lines)
Lines 1-33 Link Here
1
/* Run-time dynamic linker data structures for loaded ELF shared objects. IA64.
2
   Copyright (C) 2001 Free Software Foundation, Inc.
3
   This file is part of the GNU C Library.
4
5
   The GNU C Library is free software; you can redistribute it and/or
6
   modify it under the terms of the GNU Lesser General Public
7
   License as published by the Free Software Foundation; either
8
   version 2.1 of the License, or (at your option) any later version.
9
10
   The GNU C Library is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Lesser General Public License for more details.
14
15
   You should have received a copy of the GNU Lesser General Public
16
   License along with the GNU C Library; if not, write to the Free
17
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18
   02111-1307 USA.  */
19
20
#ifndef	_LDSODEFS_H
21
22
/* Get the real definitions.  */
23
#include_next <ldsodefs.h>
24
25
/* Now define our stuff.  */
26
27
/* We need special support to initialize DSO loaded for statically linked
28
   binaries.  */
29
extern void _dl_static_init (struct link_map *map);
30
#undef DL_STATIC_INIT
31
#define DL_STATIC_INIT(map) _dl_static_init (map)
32
33
#endif /* ldsodefs.h */
(-)a/sysdeps/unix/sysv/linux/ldsodefs.h (+6 lines)
Lines 36-41 extern void _dl_aux_init (ElfW(auxv_t) *av) internal_function; Link Here
36
/* Initialization which is normally done by the dynamic linker.  */
36
/* Initialization which is normally done by the dynamic linker.  */
37
extern void _dl_non_dynamic_init (void) internal_function;
37
extern void _dl_non_dynamic_init (void) internal_function;
38
38
39
/* We need special support to initialize DSO loaded for statically linked
40
   binaries.  */
41
extern void _dl_static_init (struct link_map *map);
42
#undef DL_STATIC_INIT
43
#define DL_STATIC_INIT(map) _dl_static_init (map)
44
39
/* We can assume that the kernel always provides the AT_UID, AT_EUID,
45
/* We can assume that the kernel always provides the AT_UID, AT_EUID,
40
   AT_GID, and AT_EGID values in the auxiliary vector from 2.4.0 or so on.  */
46
   AT_GID, and AT_EGID values in the auxiliary vector from 2.4.0 or so on.  */
41
#if __ASSUME_AT_XID
47
#if __ASSUME_AT_XID
(-)a/sysdeps/unix/sysv/linux/ia64/getpagesize.c (-39 lines)
Lines 1-39 Link Here
1
/* Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
2
   This file is part of the GNU C Library.
3
4
   The GNU C Library is free software; you can redistribute it and/or
5
   modify it under the terms of the GNU Lesser General Public
6
   License as published by the Free Software Foundation; either
7
   version 2.1 of the License, or (at your option) any later version.
8
9
   The GNU C Library is distributed in the hope that it will be useful,
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
   Lesser General Public License for more details.
13
14
   You should have received a copy of the GNU Lesser General Public
15
   License along with the GNU C Library; if not, write to the Free
16
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17
   02111-1307 USA.  */
18
19
#include <assert.h>
20
#include <unistd.h>
21
#include <sys/param.h>
22
23
#include <ldsodefs.h>
24
#include <sysdep.h>
25
#include <sys/syscall.h>
26
27
/* Return the system page size.  The return value will depend on how
28
   the kernel is configured.  A program must use this call to
29
   determine the page size to ensure proper alignment for calls such
30
   as mmap and friends.  --davidm 99/11/30 */
31
32
int
33
__getpagesize ()
34
{
35
  assert (GLRO(dl_pagesize) != 0);
36
  return GLRO(dl_pagesize);
37
}
38
libc_hidden_def (__getpagesize)
39
weak_alias (__getpagesize, getpagesize)

Return to bug 332927