summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2005-12-17 23:48:07 +0000
committermarcel <marcel@FreeBSD.org>2005-12-17 23:48:07 +0000
commit97487f135aa2816df6f55580ab5835f034ec4ec3 (patch)
treefaaad6a7d279ea2f04f9eea7c9a73865da11faea
parentc9778a66ea822f4243d1ca8bbb95ab49386b0e23 (diff)
downloadFreeBSD-src-97487f135aa2816df6f55580ab5835f034ec4ec3.zip
FreeBSD-src-97487f135aa2816df6f55580ab5835f034ec4ec3.tar.gz
Fix the ELF64_R_TYPE and ELF64_R_INFO macros. The symbol type is an
32-bit entity. Also, don't cast the resulting symbol type value to a datatype smaller than the st_info field type as a quick way to mask off the upper bits as it may cause inconsistent behaviour when the macro is used (without explicit casting) on varargs functions. MFC after: 1 week
-rw-r--r--sys/sys/elf64.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/elf64.h b/sys/sys/elf64.h
index 9118d43..feb8f0a 100644
--- a/sys/sys/elf64.h
+++ b/sys/sys/elf64.h
@@ -141,10 +141,10 @@ typedef struct {
/* Macros for accessing the fields of r_info. */
#define ELF64_R_SYM(info) ((info) >> 32)
-#define ELF64_R_TYPE(info) ((unsigned char)(info))
+#define ELF64_R_TYPE(info) ((info) & 0xffffffffL)
/* Macro for constructing r_info from field values. */
-#define ELF64_R_INFO(sym, type) (((sym) << 32) + (unsigned char)(type))
+#define ELF64_R_INFO(sym, type) (((sym) << 32) + ((type) & 0xffffffffL))
/*
* Symbol table entries.
OpenPOWER on IntegriCloud