public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] SH: dl-machine.h change to use GLRO
@ 2004-03-10 13:10 Kaz Kojima
  2004-03-10 19:06 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Kaz Kojima @ 2004-03-10 13:10 UTC (permalink / raw)
  To: libc-hacker

Hi,

The attached patch is an SH portion to fix the use for GL macro
in dl-machine.h.  It also removes cast used as lvalue from
sh/dl-machine.h.

Regards,
	kaz
--
2004-03-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/sh/dl-machine.h: Don't use GL macro if not appropriate.
	(COPY_UNALIGNED_WORD): Remove cast used as lvalue.

diff -u3prN ORIG/libc/sysdeps/sh/dl-machine.h LOCAL/libc/sysdeps/sh/dl-machine.h
--- ORIG/libc/sysdeps/sh/dl-machine.h	Mon Oct  6 15:22:10 2003
+++ LOCAL/libc/sysdeps/sh/dl-machine.h	Wed Mar 10 21:25:26 2004
@@ -1,5 +1,6 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  SH version.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 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
@@ -417,9 +418,9 @@ _dl_start_user:\n\
 static inline void __attribute__ ((unused))
 dl_platform_init (void)
 {
-  if (GL(dl_platform) != NULL && *GL(dl_platform) == '\0')
+  if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
     /* Avoid an empty string which would disturb us.  */
-    GL(dl_platform) = NULL;
+    GLRO(dl_platform) = NULL;
 }
 
 static inline Elf32_Addr
@@ -460,20 +461,23 @@ elf_machine_rela (struct link_map *map, 
 #define COPY_UNALIGNED_WORD(swp, twp, align) \
   { \
     void *__s = (swp), *__t = (twp); \
+    unsigned char *__s1 = __s, *__t1 = __t; \
+    unsigned short *__s2 = __s, *__t2 = __t; \
+    unsigned long *__s4 = __s, *__t4 = __t; \
     switch ((align)) \
     { \
     case 0: \
-      *(unsigned long *) __t = *(unsigned long *) __s; \
+      *__t4 = *__s4; \
       break; \
     case 2: \
-      *((unsigned short *) __t)++ = *((unsigned short *) __s)++; \
-      *((unsigned short *) __t) = *((unsigned short *) __s); \
+      *__t2++ = *__s2++; \
+      *__t2 = *__s2; \
       break; \
     default: \
-      *((unsigned char *) __t)++ = *((unsigned char *) __s)++; \
-      *((unsigned char *) __t)++ = *((unsigned char *) __s)++; \
-      *((unsigned char *) __t)++ = *((unsigned char *) __s)++; \
-      *((unsigned char *) __t) = *((unsigned char *) __s); \
+      *__t1++ = *__s1++; \
+      *__t1++ = *__s1++; \
+      *__t1++ = *__s1++; \
+      *__t1 = *__s1; \
       break; \
     } \
   }
@@ -525,7 +529,7 @@ elf_machine_rela (struct link_map *map, 
 	       found.  */
 	    break;
 	  if (sym->st_size > refsym->st_size
-	      || (sym->st_size < refsym->st_size && GL(dl_verbose)))
+	      || (sym->st_size < refsym->st_size && GLRO(dl_verbose)))
 	    {
 	      const char *strtab;
 
@@ -593,7 +597,7 @@ elf_machine_rela (struct link_map *map, 
 	      rtld.c contains the common defn for _dl_rtld_map, which
 	      is incompatible with a weak decl in the same file.  */
 # ifndef SHARED
-	    weak_extern (GL(dl_rtld_map));
+	    weak_extern (_dl_rtld_map);
 # endif
 	    if (map == &GL(dl_rtld_map))
 	      /* Undo the relocation done here during bootstrapping.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] SH: dl-machine.h change to use GLRO
  2004-03-10 13:10 [PATCH] SH: dl-machine.h change to use GLRO Kaz Kojima
@ 2004-03-10 19:06 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2004-03-10 19:06 UTC (permalink / raw)
  To: Kaz Kojima; +Cc: libc-hacker

Kaz Kojima wrote:

> 	* sysdeps/sh/dl-machine.h: Don't use GL macro if not appropriate.
> 	(COPY_UNALIGNED_WORD): Remove cast used as lvalue.

Applied.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-10 19:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-10 13:10 [PATCH] SH: dl-machine.h change to use GLRO Kaz Kojima
2004-03-10 19:06 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).