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