patches/glibc/2.3.3/fixup.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
yann@1
     1
Fixes
yann@1
     2
dl-runtime.c:56: error: conflicting types for 'fixup'
yann@1
     3
../sysdeps/i386/dl-machine.h:158: error: previous declaration of 'fixup' was here
yann@1
     4
when building with gcc-3.4.0
yann@1
     5
yann@1
     6
First hunk:
yann@1
     7
Define ARCH_FIXUP_ATTRIBUTE and use it in the fixup function declarations.
yann@1
     8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/dl-machine.h.diff?r1=1.124&r2=1.125&cvsroot=glibc
yann@1
     9
yann@1
    10
Second hunk:
yann@1
    11
If ARCH_FIXUP_ATTRIBUTE is not defined, provide dummy definition.
yann@1
    12
Use macro in fixup function definitions.
yann@1
    13
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/elf/dl-runtime.c.diff?r1=1.64&r2=1.65&cvsroot=glibc
yann@1
    14
[rediffed against glibc-2.3.2]
yann@1
    15
yann@1
    16
===================================================================
yann@1
    17
RCS file: /cvs/glibc/libc/sysdeps/i386/dl-machine.h,v
yann@1
    18
retrieving revision 1.124
yann@1
    19
retrieving revision 1.125
yann@1
    20
diff -u -r1.124 -r1.125
yann@1
    21
--- libc/sysdeps/i386/dl-machine.h	2004/03/05 10:14:49	1.124
yann@1
    22
+++ libc/sysdeps/i386/dl-machine.h	2004/03/09 07:42:29	1.125
yann@1
    23
@@ -154,11 +154,14 @@
yann@1
    24
    destroys the passed register information.  */
yann@1
    25
 /* GKM FIXME: Fix trampoline to pass bounds so we can do
yann@1
    26
    without the `__unbounded' qualifier.  */
yann@1
    27
-static ElfW(Addr) fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset)
yann@1
    28
-     __attribute__ ((regparm (2), unused));
yann@1
    29
+#define ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), unused))
yann@1
    30
+
yann@1
    31
+static ElfW(Addr) fixup (struct link_map *__unbounded l,
yann@1
    32
+			 ElfW(Word) reloc_offset)
yann@1
    33
+     ARCH_FIXUP_ATTRIBUTE;
yann@1
    34
 static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
yann@1
    35
 				 ElfW(Addr) retaddr)
yann@1
    36
-     __attribute__ ((regparm (3), unused));
yann@1
    37
+     ARCH_FIXUP_ATTRIBUTE;
yann@1
    38
 # endif
yann@1
    39
 
yann@1
    40
 /* This code is used in dl-runtime.c to call the `fixup' function
yann@1
    41
===================================================================
yann@1
    42
--- /home/dank/downloads/glibc-2.3.2/elf/dl-runtime.c	Fri Feb  7 11:41:12 2003
yann@1
    43
+++ glibc-2.3.2/elf/dl-runtime.c	Thu Apr  8 22:24:26 2004
yann@1
    44
@@ -36,6 +36,12 @@
yann@1
    45
 # define VERSYMIDX(sym)	(DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym))
yann@1
    46
 #endif
yann@1
    47
 
yann@1
    48
+/* The fixup functions might have need special attributes.  If none
yann@1
    49
+   are provided define the macro as empty.  */
yann@1
    50
+#ifndef ARCH_FIXUP_ATTRIBUTE
yann@1
    51
+# define ARCH_FIXUP_ATTRIBUTE
yann@1
    52
+#endif
yann@1
    53
+
yann@1
    54
 
yann@1
    55
 /* This function is called through a special trampoline from the PLT the
yann@1
    56
    first time each PLT entry is called.  We must perform the relocation
yann@1
    57
@@ -45,7 +51,7 @@
yann@1
    58
    function.  */
yann@1
    59
 
yann@1
    60
 #ifndef ELF_MACHINE_NO_PLT
yann@1
    61
-static ElfW(Addr) __attribute_used__
yann@1
    62
+static ElfW(Addr) __attribute_used__ ARCH_FIXUP_ATTRIBUTE
yann@1
    63
 fixup (
yann@1
    64
 # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
yann@1
    65
         ELF_MACHINE_RUNTIME_FIXUP_ARGS,
yann@1
    66
@@ -132,7 +138,7 @@
yann@1
    67
 
yann@1
    68
 #if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__
yann@1
    69
 
yann@1
    70
-static ElfW(Addr) __attribute_used__
yann@1
    71
+static ElfW(Addr) __attribute_used__ ARCH_FIXUP_ATTRIBUTE
yann@1
    72
 profile_fixup (
yann@1
    73
 #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
yann@1
    74
        ELF_MACHINE_RUNTIME_FIXUP_ARGS,