+2003-09-24 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/ia64/dl-machine.h (RTLD_START): Remove setting of
+ __libc_stack_end. Patch by David Mosberger.
+
+2003-09-24 Jakub Jelinek <jakub@redhat.com>
+
+ * elf/Versions (ld): Export __libc_stack_end@GLIBC_2.1 instead of
+ __libc_stack_end@GLIBC_PRIVATE.
+
+ * sysdeps/generic/dl-sysdep.c (DL_STACK_END): Define if not defined.
+ (_dl_sysdep_start): Set __libc_stack_end here.
+ * sysdeps/alpha/dl-machine.h (RTLD_START): Remove setting of
+ __libc_stack_end.
+ * sysdeps/arm/dl-machine.h (RTLD_START): Likewise.
+ * sysdeps/cris/dl-machine.h (RTLD_START): Likewise.
+ * sysdeps/i386/dl-machine.h (RTLD_START): Likewise.
+ * sysdeps/m68k/dl-machine.h (RTLD_START): Likewise.
+ * sysdeps/s390/s390-32/dl-machine.h (RTLD_START): Likewise.
+ * sysdeps/s390/s390-64/dl-machine.h (RTLD_START): Likewise.
+ * sysdeps/sh/dl-machine.h (RTLD_START): Likewise.
+ * sysdeps/x86_64/dl-machine.h (RTLD_START): Likewise.
+ * sysdeps/ia64/dl-machine.h (DL_STACK_END): Define.
+ * sysdeps/sparc/sparc32/dl-machine.h (DL_STACK_END): Define.
+ (RTLD_START): Remove setting of __libc_stack_end.
+ * sysdeps/sparc/sparc64/dl-machine.h (DL_STACK_END): Define.
+ (RTLD_START): Remove setting of __libc_stack_end.
+
+2003-09-24 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/sys/sysmacros.h: Add gnu_dev_ prefix to
+ function definitions. Adjust macro expansions accordingly.
+ * sysdeps/unix/sysv/linux/Versions: Add gnu_dev_ prefix to major,
+ minor, makedev name.
+ * sysdeps/unix/sysv/linux/makedev.c: Likewise.
+
+2003-09-24 Jakub Jelinek <jakub@redhat.com>
+
+ * sysdeps/unix/sysv/linux/sys/sysmacros.h (major, minor, makedev):
+ Add __THROW.
+
2003-09-24 Jakub Jelinek <jakub@redhat.com>
* nscd/Makefile (others): Add nscd before including ../Rules.
GLIBC_2.1 {
# functions used in other libraries
_dl_mcount;
+ # historically used by Garbage Collectors
+ __libc_stack_end;
}
GLIBC_2.3 {
# runtime interface to TLS
}
GLIBC_PRIVATE {
# Those are in the dynamic linker, but used by libc.so.
- __libc_enable_secure; __libc_stack_end;
+ __libc_enable_secure;
_dl_argv; _dl_catch_error; _dl_check_map_versions;
_dl_debug_printf; _dl_debug_state; _dl_dst_count;
_dl_dst_substitute; _dl_init; _dl_lookup_symbol; _dl_lookup_symbol_skip;
.prologue 0 \n\
/* Save the user entry point address in s0. */ \n\
mov $0, $9 \n\
- /* Store the highest stack address. */ \n\
- stq $30, __libc_stack_end \n\
/* See if we were run as a command with the executable \n\
file name as an extra leading argument. */ \n\
ldl $1, _dl_skip_args($gp) !gprel \n\
ldr sl, .L_GET_GOT\n\
add sl, pc, sl\n\
.L_GOT_GOT:\n\
- @ Store the highest stack address\n\
- ldr r1, .L_STACK_END\n\
- ldr r1, [sl, r1]\n\
- str sp, [r1]\n\
@ See if we were run as a command with the executable file\n\
@ name as an extra leading argument.\n\
ldr r4, .L_SKIP_ARGS\n\
.word _dl_starting_up(GOT)\n\
.L_FINI_PROC:\n\
.word _dl_fini(GOT)\n\
-.L_STACK_END:\n\
- .word __libc_stack_end(GOT)\n\
.L_LOADED:\n\
.word _rtld_local(GOT)\n\
.previous\n\
; Point R0 at the GOT.\n\
move.d $pc,$r0\n\
sub.d .:GOTOFF,$r0\n\
- ; Remember the highest stack address.\n\
- move.d [$r0+__libc_stack_end:GOT16],$r13\n\
- move.d $sp,[$r13]\n\
; See if we were run as a command with the executable file\n\
; name as an extra leading argument.\n\
move.d [$r0+_dl_skip_args:GOT16],$r13\n\
} while (0)
#endif
+#ifndef DL_STACK_END
+# define DL_STACK_END(cookie) ((void *) (cookie))
+#endif
ElfW(Addr)
_dl_sysdep_start (void **start_argptr,
ElfW(Word) new_sysinfo = 0;
#endif
+ __libc_stack_end = DL_STACK_END (start_argptr);
DL_FIND_ARG_COMPONENTS (start_argptr, _dl_argc, INTUSE(_dl_argv), _environ,
_dl_auxv);
.globl _start\n\
.globl _dl_start_user\n\
_start:\n\
- # Point %ebx at the GOT.\n\
- call 0b\n\
- addl $_GLOBAL_OFFSET_TABLE_, %ebx\n\
# Note that _dl_start gets the parameter in %eax.\n\
movl %esp, %eax\n\
- # Store the highest stack address\n\
- movl %eax, __libc_stack_end@GOTOFF(%ebx)\n\
call _dl_start\n\
_dl_start_user:\n\
# Save the user entry point address in %edi.\n\
movl %eax, %edi\n\
+ # Point %ebx at the GOT.\n\
+ call 0b\n\
+ addl $_GLOBAL_OFFSET_TABLE_, %ebx\n\
# See if we were run as a command with the executable file\n\
# name as an extra leading argument.\n\
movl _dl_skip_args@GOTOFF(%ebx), %eax\n\
strong_alias (_dl_runtime_resolve, _dl_runtime_profile);
#endif
+/* Undo the adds out0 = 16, sp below to get at the value we want in
+ __libc_stack_end. */
+#define DL_STACK_END(cookie) \
+ ((void *) (((long) (cookie)) - 16))
/* Initial entry point code for the dynamic linker.
The C function `_dl_start' is the real entry point;
" .save ar.pfs, r32\n" \
" .body\n" \
" { .mii\n" \
-" /* Save the pointer to the user entry point fptr in loc2. */\n" \
-" mov loc2 = ret0\n" \
-" /* Store the highest stack address. */\n" \
-" addl r2 = @ltoff(__libc_stack_end#), gp\n" \
" addl r3 = @gprel(_dl_skip_args), gp\n" \
-" ;;\n" \
-" }\n" \
-" { .mmi\n" \
-" ld8 r2 = [r2]\n" \
-" ld4 r3 = [r3]\n" \
" adds r11 = 24, sp /* Load the address of argv. */\n" \
+" /* Save the pointer to the user entry point fptr in loc2. */\n" \
+" mov loc2 = ret0\n" \
" ;;\n" \
" }\n" \
" { .mii\n" \
-" st8 [r2] = sp\n" \
+" ld4 r3 = [r3]\n" \
" adds r10 = 16, sp /* Load the address of argc. */\n" \
" mov out2 = r11\n" \
" ;;\n" \
" br.call.sptk.many b0 = _dl_init_internal#\n" \
" ;;\n" \
" }\n" \
-" /* Pass our finializer function to the user,\n" \
+" /* Pass our finalizer function to the user,\n" \
" and jump to the user's entry point. */\n" \
" { .mmi\n" \
" ld8 r3 = [loc2], 8\n" \
_dl_start_user:\n\
| Save the user entry point address in %a4.\n\
move.l %d0, %a4\n\
- | Remember the highest stack address.\n\
- move.l __libc_stack_end@GOTPC(%pc), %a0\n\
- move.l %sp, (%a0)\n\
| See if we were run as a command with the executable file\n\
| name as an extra leading argument.\n\
move.l _dl_skip_args(%pc), %d0\n\
# Point %r12 at the GOT.\n\
l %r12,.Ladr0-.Llit(%r13)\n\
ar %r12,%r13\n\
- # Store the highest stack address\n\
- l %r1,__libc_stack_end@GOT(%r12)\n\
- st %r15, 0(%r1)\n\
# See if we were run as a command with the executable file\n\
# name as an extra leading argument.\n\
l %r1,_dl_skip_args@GOT12(0,%r12)\n\
lgr %r8,%r2\n\
# Point %r12 at the GOT.\n\
larl %r12,_GLOBAL_OFFSET_TABLE_\n\
- # Store the highest stack address\n\
- lghi %r1,__libc_stack_end@GOT\n\
- lg %r1,0(%r1,%r12)\n\
- stg %r15, 0(%r1)\n\
# See if we were run as a command with the executable file\n\
# name as an extra leading argument.\n\
lghi %r1,_dl_skip_args@GOT\n\
add r0,r12\n\
.align 2\n\
1: .long _GLOBAL_OFFSET_TABLE_\n\
-2: ! Store the highest stack address\n\
- mov.l .L_stack_end,r0\n\
- mov.l @(r0,r12),r0\n\
- mov.l r15,@r0\n\
- ! See if we were run as a command with the executable file\n\
+2: ! See if we were run as a command with the executable file\n\
! name as an extra leading argument.\n\
mov.l .L_dl_skip_args,r0\n\
mov.l @(r0,r12),r0\n\
.align 2\n\
.L_dl_start:\n\
.long _dl_start@PLT\n\
-.L_stack_end:\n\
- .long __libc_stack_end@GOT\n\
.L_dl_skip_args:\n\
.long _dl_skip_args@GOT\n\
.L_dl_init:\n\
/* The SPARC overlaps DT_RELA and DT_PLTREL. */
#define ELF_MACHINE_PLTREL_OVERLAP 1
+/* Undo the sub %sp, 6*4, %sp; add %sp, 22*4, %o0 below to get at the
+ value we want in __libc_stack_end. */
+#define DL_STACK_END(cookie) \
+ ((void *) (((long) (cookie)) - (22 - 6) * 4))
+
/* Initial entry point code for the dynamic linker.
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
add %l7, %o7, %l7\n\
/* Save the user entry point address in %l0 */\n\
mov %o0, %l0\n\
- /* Store the highest stack address. */\n\
- sethi %hi(__libc_stack_end), %g2\n\
- or %g2, %lo(__libc_stack_end), %g2\n\
- ld [%l7 + %g2], %l1\n\
- sethi %hi(_dl_skip_args), %g2\n\
- add %sp, 6*4, %l2\n\
- or %g2, %lo(_dl_skip_args), %g2\n\
- st %l2, [%l1]\n\
/* See if we were run as a command with the executable file name as an\n\
extra leading argument. If so, adjust the contents of the stack. */\n\
+ sethi %hi(_dl_skip_args), %g2\n\
+ or %g2, %lo(_dl_skip_args), %g2\n\
ld [%l7+%g2], %i0\n\
ld [%i0], %i0\n\
tst %i0\n\
/* The PLT uses Elf64_Rela relocs. */
#define elf_machine_relplt elf_machine_rela
+/* Undo the sub %sp, 6*8, %sp; add %sp, STACK_BIAS + 22*8, %o0 below
+ to get at the value we want in __libc_stack_end. */
+#define DL_STACK_END(cookie) \
+ ((void *) (((long) (cookie)) - (22 - 6) * 8 - STACK_BIAS))
+
/* Initial entry point code for the dynamic linker.
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
"1: call 11f\n" \
" sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7\n" \
"11: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7\n" \
-" /* Store the highest stack address. */\n" \
-" sethi %hi(__libc_stack_end), %g5\n" \
+" sethi %hi(_dl_skip_args), %g5\n" \
" add %l7, %o7, %l7\n" \
-" or %g5, %lo(__libc_stack_end), %g5\n" \
+" or %g5, %lo(_dl_skip_args), %g5\n" \
" /* Save the user entry point address in %l0. */\n" \
" mov %o0, %l0\n" \
-" ldx [%l7 + %g5], %l1\n" \
-" sethi %hi(_dl_skip_args), %g5\n" \
-" add %sp, 6*8, %l2\n" \
" /* See if we were run as a command with the executable file name as an\n" \
" extra leading argument. If so, we must shift things around since we\n" \
" must keep the stack doubleword aligned. */\n" \
-" or %g5, %lo(_dl_skip_args), %g5\n" \
-" stx %l2, [%l1]\n" \
" ldx [%l7 + %g5], %i0\n" \
" ld [%i0], %i0\n" \
" brz,pt %i0, 2f\n" \
epoll_create; epoll_ctl; epoll_wait;
}
GLIBC_2.3.3 {
- major; minor; makedev;
+ gnu_dev_major; gnu_dev_minor; gnu_dev_makedev;
}
GLIBC_PRIVATE {
# needed by libpthread.
#include <sys/sysmacros.h>
unsigned int
-major (unsigned long long int dev)
+gnu_dev_major (unsigned long long int dev)
{
return ((dev >> 8) & 0xfff) | ((unsigned int) (dev >> 32) & ~0xfff);
}
unsigned int
-minor (unsigned long long int dev)
+gnu_dev_minor (unsigned long long int dev)
{
return (dev & 0xff) | ((unsigned int) (dev >> 12) & ~0xff);
}
unsigned long long int
-makedev (unsigned int major, unsigned int minor)
+gnu_dev_makedev (unsigned int major, unsigned int minor)
{
return ((minor & 0xff) | ((major & 0xfff) << 8)
| (((unsigned long long int) (minor & ~0xff)) << 12)
not going to hack weird hacks to support the dev_t representation
they need. */
#ifdef __GLIBC_HAVE_LONG_LONG
-extern unsigned int inline major (unsigned long long int __dev) __THROW;
-extern unsigned int inline minor (unsigned long long int __dev) __THROW;
-extern unsigned long long int inline makedev (unsigned int __major,
- unsigned int __minor) __THROW;
+extern unsigned int inline gnu_dev_major (unsigned long long int __dev)
+ __THROW;
+extern unsigned int inline gnu_dev_minor (unsigned long long int __dev)
+ __THROW;
+extern unsigned long long int inline gnu_dev_makedev (unsigned int __major,
+ unsigned int __minor)
+ __THROW;
# if defined __GNUC__ && __GNUC__ >= 2
extern inline unsigned int
-major (unsigned long long int __dev)
+gnu_dev_major (unsigned long long int __dev) __THROW
{
return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
}
extern inline unsigned int
-minor (unsigned long long int __dev)
+gnu_dev_minor (unsigned long long int __dev) __THROW
{
return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
}
extern inline unsigned long long int
-makedev (unsigned int __major, unsigned int __minor)
+gnu_dev_makedev (unsigned int __major, unsigned int __minor) __THROW
{
return ((__minor & 0xff) | ((__major & 0xfff) << 8)
| (((unsigned long long int) (__minor & ~0xff)) << 12)
# endif
-/* Historically the three symbols were macros. In case some programs
- use #ifdef to check for definition provide some dummy macros. */
-# define major(dev) major (dev)
-# define minor(dev) minor (dev)
-# define makedev(maj, min) makedev (maj, min)
+/* Access the functions with their traditional names. */
+# define major(dev) gnu_dev_major (dev)
+# define minor(dev) gnu_dev_minor (dev)
+# define makedev(maj, min) gnu_dev_makedev (maj, min)
#endif
#endif /* sys/sysmacros.h */
.globl _start\n\
.globl _dl_start_user\n\
_start:\n\
- # Store the highest stack address\n\
- movq %rsp, __libc_stack_end(%rip)\n\
movq %rsp, %rdi\n\
call _dl_start\n\
_dl_start_user:\n\