From: Roland McGrath Date: Mon, 9 Dec 2002 20:37:24 +0000 (+0000) Subject: 2002-12-08 Roland McGrath X-Git-Tag: glibc-2.16-ports-before-merge~1514 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f8a26bed6f428d063fb335d3bb5ee51de91779b3;p=thirdparty%2Fglibc.git 2002-12-08 Roland McGrath * elf/Makefile (tests): Uncomment tst-array[123]. * Makeconfig (CPPFLAGS-.oS): Add -DLIBC_NONSHARED=1. * csu/elf-init.c: New file. * csu/Makefile (routines, static-only-routines): Add elf-init. * sysdeps/alpha/elf/start.S: Use __libc_csu_init in place of _init and __libc_csu_fini in place of _fini. * sysdeps/arm/elf/start.S: Likewise. * sysdeps/cris/elf/start.S: Likewise. * sysdeps/hppa/elf/start.S: Likewise. * sysdeps/i386/elf/start.S: Likewise. * sysdeps/ia64/elf/start.S: Likewise. * sysdeps/m68k/elf/start.S: Likewise. * sysdeps/mach/hurd/powerpc/static-start.S: Likewise. * sysdeps/mips/elf/start.S: Likewise. * sysdeps/powerpc/powerpc32/elf/start.S: Likewise. * sysdeps/powerpc/powerpc64/elf/start.S: Likewise. * sysdeps/s390/s390-32/elf/start.S: Likewise. * sysdeps/s390/s390-64/elf/start.S: Likewise. * sysdeps/sh/elf/start.S: Likewise. * sysdeps/sparc/sparc32/elf/start.S: Likewise. * sysdeps/sparc/sparc64/elf/start.S: Likewise. * sysdeps/x86_64/elf/start.S: Likewise. --- diff --git a/sysdeps/alpha/elf/start.S b/sysdeps/alpha/elf/start.S index b0cf119feb6..3f98111fd97 100644 --- a/sysdeps/alpha/elf/start.S +++ b/sysdeps/alpha/elf/start.S @@ -1,5 +1,5 @@ /* Startup code for Alpha/ELF. - Copyright (C) 1993,1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1993,1995,1996,1997,1998,2000,2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson @@ -40,8 +40,8 @@ _start: lda a2, 24(sp) /* get argv */ /* Load address of our own entry points to .fini and .init. */ - lda a3, _init - lda a4, _fini + lda a3, __libc_csu_init + lda a4, __libc_csu_fini /* Store address of the shared library termination function. */ mov v0, a5 diff --git a/sysdeps/arm/elf/start.S b/sysdeps/arm/elf/start.S index 8d60b3d8d59..90a62f6d9a5 100644 --- a/sysdeps/arm/elf/start.S +++ b/sysdeps/arm/elf/start.S @@ -1,5 +1,5 @@ /* Startup code for ARM & ELF - Copyright (C) 1995, 1996, 1997, 1998, 2001 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -54,12 +54,12 @@ _start: /* Push the last arguments to main() onto the stack */ stmfd sp!, {a1} - ldr a1, =_fini + ldr a1, =__libc_csu_fini stmfd sp!, {a1} /* Set up the other arguments for main() that go in registers */ ldr a1, =main - ldr a4, =_init + ldr a4, =__libc_csu_init /* __libc_start_main (main, argc, argv, init, fini, rtld_fini) */ diff --git a/sysdeps/cris/elf/start.S b/sysdeps/cris/elf/start.S index e7f1d6750d7..dbe408a0762 100644 --- a/sysdeps/cris/elf/start.S +++ b/sysdeps/cris/elf/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF CRIS ABI (to-be-written). - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -89,15 +89,15 @@ _start: move.d pc,r0 sub.d .:GOTOFF,r0 - move.d _init:PLTG,r13 + move.d __libc_csu_init:PLTG,r13 add.d r0,r13 - move.d _fini:PLTG,r9 + move.d __libc_csu_fini:PLTG,r9 add.d r0,r9 move.d main:PLTG,r10 add.d r0,r10 #else - move.d _init,r13 - move.d _fini,r9 + move.d __libc_csu_init,r13 + move.d __libc_csu_fini,r9 move.d main,r10 #endif push r9 diff --git a/sysdeps/hppa/elf/start.S b/sysdeps/hppa/elf/start.S index b2f0bd2ad13..c7e300c543e 100644 --- a/sysdeps/hppa/elf/start.S +++ b/sysdeps/hppa/elf/start.S @@ -1,3 +1,21 @@ +/* ELF startup code for HPPA. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ .text @@ -6,12 +24,9 @@ .import main, code .import $global$, data .import __libc_start_main, code - .import _fini, code - .import _init, code + .import __libc_csu_fini, code + .import __libc_csu_init, code - - - .globl _start .export _start, ENTRY .type _start,@function @@ -28,17 +43,17 @@ _start: /* Expand the stack to store the 5th through 7th args */ ldo 64(%sp), %sp - + /* void (*rtld_fini) (void) (actually the 6th arg) */ stw %r23, -56(%sp) - + /* void (*init) (void) */ - ldil LP%_init, %r23 - ldo RP%_init(%r23), %r23 + ldil LP%__libc_csu_init, %r23 + ldo RP%__libc_csu_init(%r23), %r23 /* void (*fini) (void) */ - ldil LP%_fini, %r22 - ldo RP%_fini(%r22), %r22 + ldil LP%__libc_csu_fini, %r22 + ldo RP%__libc_csu_fini(%r22), %r22 stw %r22, -52(%sp) /* void *stack_end */ diff --git a/sysdeps/m68k/elf/start.S b/sysdeps/m68k/elf/start.S index eda735583de..f65cda75cd4 100644 --- a/sysdeps/m68k/elf/start.S +++ b/sysdeps/m68k/elf/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF m68k ABI. - Copyright (C) 1996, 1997, 1998, 2001 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -60,8 +60,8 @@ _start: /* Push the address of our own entry points to `.fini' and `.init'. */ - pea _fini - pea _init + pea __libc_csu_fini + pea __libc_csu_init pea (%a0) /* Push second argument: argv. */ move.l %d0, -(%sp) /* Push first argument: argc. */ diff --git a/sysdeps/mips/elf/start.S b/sysdeps/mips/elf/start.S index 01908e28dbb..e85e9f535ef 100644 --- a/sysdeps/mips/elf/start.S +++ b/sysdeps/mips/elf/start.S @@ -83,8 +83,8 @@ ENTRY_POINT: the stack is aligned to double words (8 bytes). */ and $29, 0xfffffff8 subu $29, 32 - la $7, _init /* init */ - la $8, _fini + la $7, __libc_csu_init /* init */ + la $8, __libc_csu_fini sw $8, 16($29) /* fini */ sw $2, 20($29) /* rtld_fini */ sw $29, 24($29) /* stack_end */