Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Use uint32_t casts, rather than Elf_Byte, in ELF_ST_...



details:   https://anonhg.NetBSD.org/src/rev/74f3d6bf2ea7
branches:  trunk
changeset: 572262:74f3d6bf2ea7
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Dec 28 00:07:31 2004 +0000

description:
Use uint32_t casts, rather than Elf_Byte, in ELF_ST_BIND() and ELF_ST_TYPE()
so we don't get screwed by promotion rules (and makes nlist_elf32.ln build
again).

diffstat:

 sys/sys/exec_elf.h |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (25 lines):

diff -r 01864436e06e -r 74f3d6bf2ea7 sys/sys/exec_elf.h
--- a/sys/sys/exec_elf.h        Mon Dec 27 21:35:03 2004 +0000
+++ b/sys/sys/exec_elf.h        Tue Dec 28 00:07:31 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_elf.h,v 1.78 2004/12/27 21:35:03 christos Exp $   */
+/*     $NetBSD: exec_elf.h,v 1.79 2004/12/28 00:07:31 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -453,10 +453,11 @@
 #define        STV_PROTECTED           3       /* visible, not preemptible */
 
 /* st_info/st_other utility macros */
-#define        ELF_ST_BIND(info)               ((Elf_Byte)(info) >> 4)
-#define        ELF_ST_TYPE(info)               ((Elf_Byte)(info) & 0xf)
-#define        ELF_ST_INFO(bind,type)          ((Elf_Byte)(((bind) << 4) | ((type) & 0xf)))
-#define        ELF_ST_VISIBILITY(other)        ((Elf_Byte)(other) & 3)
+#define        ELF_ST_BIND(info)               ((uint32_t)(info) >> 4)
+#define        ELF_ST_TYPE(info)               ((uint32_t)(info) & 0xf)
+#define        ELF_ST_INFO(bind,type)          ((Elf_Byte)(((bind) << 4) | \
+                                        ((type) & 0xf)))
+#define        ELF_ST_VISIBILITY(other)        ((uint32_t)(other) & 3)
 
 /*
  * Special section indexes



Home | Main Index | Thread Index | Old Index