aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2004-04-29 20:09:32 +0000
committerRoland McGrath <roland@gnu.org>2004-04-29 20:09:32 +0000
commit420a2f8b8dfe796e5f38da1e233ee99be6ec028f (patch)
tree9ba554a10c2889c788634b3272137361e4667046
parent0c178dce67bce7ee569d52558abbaadc9eac2550 (diff)
downloadglibc-420a2f8b8dfe796e5f38da1e233ee99be6ec028f.tar
glibc-420a2f8b8dfe796e5f38da1e233ee99be6ec028f.tar.gz
glibc-420a2f8b8dfe796e5f38da1e233ee99be6ec028f.tar.bz2
glibc-420a2f8b8dfe796e5f38da1e233ee99be6ec028f.zip
[BZ #140]
2004-04-29 Philip Blundell <pb@nexus.co.uk> * sysdeps/arm/dl-machine.h (RTLD_START): Avoid unnecessary GOT entries. [BZ #140] * sysdeps/unix/sysv/linux/sys/sysctl.h: Remove linux/compiler.h include. (_LINUX_KERNEL_H, _LINUX_TYPES_H, _LINUX_LIST_H): Only define if not yet defined, #undef back after including linux/sysctl.h if defined here. (__LINUX_COMPILER_H, __user): Define if not yet defined, #undef back after including linux/sysctl.h if defined here.
-rw-r--r--ChangeLog14
-rw-r--r--sysdeps/arm/dl-machine.h33
-rw-r--r--sysdeps/unix/sysv/linux/sys/sysctl.h44
3 files changed, 64 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index a1e6a7a59a..9e1d3edde6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
+2004-04-29 Philip Blundell <pb@nexus.co.uk>
+
+ * sysdeps/arm/dl-machine.h (RTLD_START): Avoid unnecessary GOT
+ entries.
+
2004-04-29 Jakub Jelinek <jakub@redhat.com>
+ [BZ #140]
+ * sysdeps/unix/sysv/linux/sys/sysctl.h: Remove linux/compiler.h
+ include.
+ (_LINUX_KERNEL_H, _LINUX_TYPES_H, _LINUX_LIST_H): Only define if not
+ yet defined, #undef back after including linux/sysctl.h if defined
+ here.
+ (__LINUX_COMPILER_H, __user): Define if not yet defined, #undef
+ back after including linux/sysctl.h if defined here.
+
* sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c (_Qp_qtoi): Use %f31
for single precision register, add it to __asm clobbers [BZ #139].
* sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c (_Qp_qtoui): Use %f31
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index a131676d5a..5dfe3346f5 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -255,26 +255,27 @@ _dl_runtime_profile:\n\
.globl _start\n\
.globl _dl_start_user\n\
_start:\n\
+ @ we are PIC code, so get global offset table\n\
+ ldr sl, .L_GET_GOT\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\
@ at start time, all the args are on the stack\n\
mov r0, sp\n\
bl _dl_start\n\
@ returns user entry point in r0\n\
_dl_start_user:\n\
- mov r6, r0\n\
- @ we are PIC code, so get global offset table\n\
- ldr sl, .L_GET_GOT\n\
add sl, pc, sl\n\
.L_GOT_GOT:\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\
ldr r4, [sl, r4]\n\
@ get the original arg count\n\
ldr r1, [sp]\n\
- @ subtract _dl_skip_args from it\n\
- sub r1, r1, r4\n\
- @ adjust the stack pointer to skip them\n\
+ @ save the entry point in another register\n\
+ mov r6, r0\n\
+ @ adjust the stack pointer to skip the extra args\n\
add sp, sp, r4, lsl #2\n\
+ @ subtract _dl_skip_args from original arg count\n\
+ sub r1, r1, r4\n\
@ get the argv address\n\
add r2, sp, #4\n\
@ store the new argc in the new stack location\n\
@@ -286,29 +287,21 @@ _dl_start_user:\n\
@ now we call _dl_init\n\
ldr r0, .L_LOADED\n\
ldr r0, [sl, r0]\n\
- ldr r0, [r0]\n\
@ call _dl_init\n\
bl _dl_init_internal(PLT)\n\
- @ clear the startup flag\n\
- ldr r2, .L_STARTUP_FLAG\n\
- ldr r1, [sl, r2]\n\
- mov r0, #0\n\
- str r0, [r1]\n\
@ load the finalizer function\n\
ldr r0, .L_FINI_PROC\n\
- ldr r0, [sl, r0]\n\
+ add r0, sl, r0\n\
@ jump to the user_s entry point\n\
mov pc, r6\n\
.L_GET_GOT:\n\
.word _GLOBAL_OFFSET_TABLE_ - .L_GOT_GOT - 4\n\
.L_SKIP_ARGS:\n\
.word _dl_skip_args(GOTOFF)\n\
-.L_STARTUP_FLAG:\n\
- .word _dl_starting_up(GOT)\n\
.L_FINI_PROC:\n\
- .word _dl_fini(GOT)\n\
+ .word _dl_fini(GOTOFF)\n\
.L_LOADED:\n\
- .word _rtld_local(GOT)\n\
+ .word _rtld_local(GOTOFF)\n\
.previous\n\
");
diff --git a/sysdeps/unix/sysv/linux/sys/sysctl.h b/sysdeps/unix/sysv/linux/sys/sysctl.h
index 9dbb0fc078..110efaa769 100644
--- a/sysdeps/unix/sysv/linux/sys/sysctl.h
+++ b/sysdeps/unix/sysv/linux/sys/sysctl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1999, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1999, 2002, 2003, 2004 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
@@ -23,14 +23,44 @@
#define __need_size_t
#include <stddef.h>
/* Prevent more kernel headers than necessary to be included. */
-#define _LINUX_KERNEL_H 1
-#define _LINUX_TYPES_H 1
-#define _LINUX_LIST_H 1
-/* We do need this one for the declarations in <linux/sysctl.h>,
- since we've elided the inclusion of <linux/kernel.h> that gets them. */
-#include <linux/compiler.h>
+#ifndef _LINUX_KERNEL_H
+# define _LINUX_KERNEL_H 1
+# define __undef_LINUX_KERNEL_H
+#endif
+#ifndef _LINUX_TYPES_H
+# define _LINUX_TYPES_H 1
+# define __undef_LINUX_TYPES_H
+#endif
+#ifndef _LINUX_LIST_H
+# define _LINUX_LIST_H 1
+# define __undef_LINUX_LIST_H
+#endif
+#ifndef __LINUX_COMPILER_H
+# define __LINUX_COMPILER_H 1
+# define __user
+# define __undef__LINUX_COMPILER_H
+#endif
+
#include <linux/sysctl.h>
+#ifdef __undef_LINUX_KERNEL_H
+# undef _LINUX_KERNEL_H
+# undef __undef_LINUX_KERNEL_H
+#endif
+#ifdef __undef_LINUX_TYPES_H
+# undef _LINUX_TYPES_H
+# undef __undef_LINUX_TYPES_H
+#endif
+#ifdef __undef_LINUX_LIST_H
+# undef _LINUX_LIST_H
+# undef __undef_LINUX_LIST_H
+#endif
+#ifdef __undef__LINUX_COMPILER_H
+# undef __LINUX_COMPILER_H
+# undef __user
+# undef __undef__LINUX_COMPILER_H
+#endif
+
__BEGIN_DECLS
/* Read or write system parameters. */