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
This commit is contained in:
marcel 2005-12-17 23:48:07 +00:00
parent c9778a66ea
commit 97487f135a

View File

@ -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.