patches/glibc/2.2.5/dl-machine-m68k.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 Retrieved with
     2  wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/m68k/dl-machine.h.diff?r1=1.53&r2=1.55&cvsroot=glibc'
     3 
     4 Fixes error
     5 
     6 In file included from dynamic-link.h:21,
     7                  from dl-load.c:32:
     8 ../sysdeps/m68k/dl-machine.h:108: error: parse error before '.' token
     9 ../sysdeps/m68k/dl-machine.h:109: error: stray '@' in program
    10 ../sysdeps/m68k/dl-machine.h:120: error: syntax error at '#' token
    11 ../sysdeps/m68k/dl-machine.h:123: error: stray '\' in program
    12 ../sysdeps/m68k/dl-machine.h:123: error: missing terminating " character
    13 ../sysdeps/m68k/dl-machine.h:148: error: stray '@' in program
    14 ../sysdeps/m68k/dl-machine.h:152: error: syntax error at '#' token
    15 ../sysdeps/m68k/dl-machine.h:156: error: stray '@' in program
    16 ../sysdeps/m68k/dl-machine.h:161: error: stray '@' in program
    17 ../sysdeps/m68k/dl-machine.h:163: error: stray '@' in program
    18 ../sysdeps/m68k/dl-machine.h:166: error: stray '@' in program
    19 In file included from dynamic-link.h:21,
    20                  from dl-load.c:32:
    21 ../sysdeps/m68k/dl-machine.h:175:4: invalid preprocessing directive #Call
    22 ../sysdeps/m68k/dl-machine.h:179: error: stray '@' in program
    23 ../sysdeps/m68k/dl-machine.h:180: error: stray '@' in program
    24 ../sysdeps/m68k/dl-machine.h:181: error: syntax error at '#' token
    25 ../sysdeps/m68k/dl-machine.h:182: error: syntax error at '#' token
    26 ../sysdeps/m68k/dl-machine.h:184: error: stray '@' in program
    27 ../sysdeps/m68k/dl-machine.h:187: error: missing terminating ' character
    28 ../sysdeps/m68k/dl-machine.h:190: error: missing terminating " character
    29 dl-load.c: In function `_dl_map_object_from_fd':
    30 dl-load.c:1089: warning: use of cast expressions as lvalues is deprecated
    31 dl-load.c:1089: warning: use of cast expressions as lvalues is deprecated
    32 dl-load.c:1109: warning: use of cast expressions as lvalues is deprecated
    33 dl-load.c:1109: warning: use of cast expressions as lvalues is deprecated
    34 make[2]: *** [/home/dank/wk/crosstool-0.28-rc24/build/m68k-unknown-linux-gnu/gcc-3.4.0-glibc-2.2.5/build-glibc/elf/dl-load.o] Error 1
    35 
    36 ===================================================================
    37 RCS file: /cvs/glibc/libc/sysdeps/m68k/dl-machine.h,v
    38 retrieving revision 1.53
    39 retrieving revision 1.55
    40 diff -u -r1.53 -r1.55
    41 --- libc/sysdeps/m68k/dl-machine.h	2001/08/26 22:26:36	1.53
    42 +++ libc/sysdeps/m68k/dl-machine.h	2002/02/01 10:28:20	1.55
    43 @@ -1,5 +1,5 @@
    44  /* Machine-dependent ELF dynamic relocation inline functions.  m68k version.
    45 -   Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
    46 +   Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
    47     This file is part of the GNU C Library.
    48  
    49     The GNU C Library is free software; you can redistribute it and/or
    50 @@ -85,11 +85,11 @@
    51  	{
    52  	  got[2] = (Elf32_Addr) &_dl_runtime_profile;
    53  
    54 -	  if (_dl_name_match_p (_dl_profile, l))
    55 +	  if (_dl_name_match_p (GL(dl_profile), l))
    56  	    {
    57  	      /* This is the object we are looking for.  Say that we really
    58  		 want profiling and the timers are started.  */
    59 -	      _dl_profile_map = l;
    60 +	      GL(dl_profile_map) = l;
    61  	    }
    62  	}
    63        else
    64 @@ -104,22 +104,22 @@
    65  /* This code is used in dl-runtime.c to call the `fixup' function
    66     and then redirect to the address it returns.  */
    67  #define TRAMPOLINE_TEMPLATE(tramp_name, fixup_name) \
    68 -"| Trampoline for " #fixup_name "
    69 -	.globl " #tramp_name "
    70 -	.type " #tramp_name ", @function
    71 -" #tramp_name ":
    72 -	| Save %a0 (struct return address) and %a1.
    73 -	move.l %a0, -(%sp)
    74 -	move.l %a1, -(%sp)
    75 -	| Call the real address resolver.
    76 -	jbsr " #fixup_name "
    77 -	| Restore register %a0 and %a1.
    78 -	move.l (%sp)+, %a1
    79 -	move.l (%sp)+, %a0
    80 -	| Pop parameters
    81 -	addq.l #8, %sp
    82 -	| Call real function.
    83 -	jmp (%d0)
    84 +"| Trampoline for " #fixup_name "\n\
    85 +	.globl " #tramp_name "\n\
    86 +	.type " #tramp_name ", @function\n\
    87 +" #tramp_name ":\n\
    88 +	| Save %a0 (struct return address) and %a1.\n\
    89 +	move.l %a0, -(%sp)\n\
    90 +	move.l %a1, -(%sp)\n\
    91 +	| Call the real address resolver.\n\
    92 +	jbsr " #fixup_name "\n\
    93 +	| Restore register %a0 and %a1.\n\
    94 +	move.l (%sp)+, %a1\n\
    95 +	move.l (%sp)+, %a0\n\
    96 +	| Pop parameters\n\
    97 +	addq.l #8, %sp\n\
    98 +	| Call real function.\n\
    99 +	jmp (%d0)\n\
   100  	.size " #tramp_name ", . - " #tramp_name "\n"
   101  #ifndef PROF
   102  #define ELF_MACHINE_RUNTIME_TRAMPOLINE \
   103 @@ -143,50 +143,50 @@
   104     its return value is the user program's entry point.  */
   105  
   106  #define RTLD_START asm ("\
   107 -	.text
   108 -	.globl _start
   109 -	.type _start,@function
   110 -_start:
   111 -	move.l %sp, -(%sp)
   112 -	jbsr _dl_start
   113 -	addq.l #4, %sp
   114 -	/* FALLTHRU */
   115 -
   116 -	.globl _dl_start_user
   117 -	.type _dl_start_user,@function
   118 -_dl_start_user:
   119 -	| Save the user entry point address in %a4.
   120 -	move.l %d0, %a4
   121 -	| Point %a5 at the GOT.
   122 -	lea _GLOBAL_OFFSET_TABLE_@GOTPC(%pc), %a5
   123 -	| Remember the highest stack address.
   124 -	move.l %sp, ([__libc_stack_end@GOT.w, %a5])
   125 -	| See if we were run as a command with the executable file
   126 -	| name as an extra leading argument.
   127 -	move.l ([_dl_skip_args@GOT.w, %a5]), %d0
   128 -	| Pop the original argument count
   129 -	move.l (%sp)+, %d1
   130 -	| Subtract _dl_skip_args from it.
   131 -	sub.l %d0, %d1
   132 -	| Adjust the stack pointer to skip _dl_skip_args words.
   133 -	lea (%sp, %d0*4), %sp
   134 -	| Push back the modified argument count.
   135 -	move.l %d1, -(%sp)
   136 -	# Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env)
   137 -	pea 8(%sp, %d1*4)
   138 -	pea 8(%sp)
   139 -	move.l %d1, -(%sp)
   140 -	move.l ([_dl_loaded@GOT.w, %a5]), -(%sp)
   141 -	jbsr _dl_init@PLTPC
   142 -	addq.l #8, %sp
   143 -	addq.l #8, %sp
   144 -	| Pass our finalizer function to the user in %a1.
   145 -	move.l _dl_fini@GOT.w(%a5), %a1
   146 -	| Initialize %fp with the stack pointer.
   147 -	move.l %sp, %fp
   148 -	| Jump to the user's entry point.
   149 -	jmp (%a4)
   150 -	.size _dl_start_user, . - _dl_start_user
   151 +	.text\n\
   152 +	.globl _start\n\
   153 +	.type _start,@function\n\
   154 +_start:\n\
   155 +	move.l %sp, -(%sp)\n\
   156 +	jbsr _dl_start\n\
   157 +	addq.l #4, %sp\n\
   158 +	/* FALLTHRU */\n\
   159 +\n\
   160 +	.globl _dl_start_user\n\
   161 +	.type _dl_start_user,@function\n\
   162 +_dl_start_user:\n\
   163 +	| Save the user entry point address in %a4.\n\
   164 +	move.l %d0, %a4\n\
   165 +	| Point %a5 at the GOT.\n\
   166 +	lea _GLOBAL_OFFSET_TABLE_@GOTPC(%pc), %a5\n\
   167 +	| Remember the highest stack address.\n\
   168 +	move.l %sp, ([__libc_stack_end@GOT.w, %a5])\n\
   169 +	| See if we were run as a command with the executable file\n\
   170 +	| name as an extra leading argument.\n\
   171 +	move.l ([_dl_skip_args@GOT.w, %a5]), %d0\n\
   172 +	| Pop the original argument count\n\
   173 +	move.l (%sp)+, %d1\n\
   174 +	| Subtract _dl_skip_args from it.\n\
   175 +	sub.l %d0, %d1\n\
   176 +	| Adjust the stack pointer to skip _dl_skip_args words.\n\
   177 +	lea (%sp, %d0*4), %sp\n\
   178 +	| Push back the modified argument count.\n\
   179 +	move.l %d1, -(%sp)\n\
   180 +	# Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env)\n\
   181 +	pea 8(%sp, %d1*4)\n\
   182 +	pea 8(%sp)\n\
   183 +	move.l %d1, -(%sp)\n\
   184 +	move.l ([_rtld_global@GOT.w, %a5]), -(%sp)\n\
   185 +	jbsr _dl_init@PLTPC\n\
   186 +	addq.l #8, %sp\n\
   187 +	addq.l #8, %sp\n\
   188 +	| Pass our finalizer function to the user in %a1.\n\
   189 +	move.l _dl_fini@GOT.w(%a5), %a1\n\
   190 +	| Initialize %fp with the stack pointer.\n\
   191 +	move.l %sp, %fp\n\
   192 +	| Jump to the user's entry point.\n\
   193 +	jmp (%a4)\n\
   194 +	.size _dl_start_user, . - _dl_start_user\n\
   195  	.previous");
   196  
   197  /* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
   198 @@ -251,7 +251,7 @@
   199  	       found.  */
   200  	    break;
   201  	  if (sym->st_size > refsym->st_size
   202 -	      || (sym->st_size < refsym->st_size && _dl_verbose))
   203 +	      || (sym->st_size < refsym->st_size && GL(dl_verbose)))
   204  	    {
   205  	      extern char **_dl_argv;
   206  	      const char *strtab;