History

ELF, uapi: fixup ELF_ST_TYPE definition

This is very theoretical compile failure: ELF_ST_TYPE(st_info = A) Cast will bind first and st_info will stop being lvalue: error: lvalue required as left operand of assignment Given that the only use of this macro is ELF_ST_TYPE(sym->st_info) where st_info is "unsigned char" I've decided to remove cast especially given that companion macro ELF_ST_BIND doesn't use cast.

Alexey Dobriyan committed 4 years ago

Commit c9b516f1 parent d60c4d01 file · +1 −1Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/elf.h+1−1
@@ -134,7 +134,7 @@ typedef __s64 Elf64_Sxword; · 133 unmodified lines
134134 #define STT_TLS 6
135135
136136 #define ELF_ST_BIND(x) ((x) >> 4)
137−#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
137+#define ELF_ST_TYPE(x) ((x) & 0xf)
138138 #define ELF32_ST_BIND(x) ELF_ST_BIND(x)
139139 #define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
140140 #define ELF64_ST_BIND(x) ELF_ST_BIND(x)