tags:

views:

26

answers:

1

What is the best way to access the low-order and high-order 4 bits of the char type and binding field in the elf symbol struct so that I may compare it to STT_FUNC, STT_OBJECT, STB_LOCAL, etc.?

+1  A: 

The ELF definition actually gives C macros for doing this:

#define ELF_ST_BIND(i)   ((i)>>4)
#define ELF_ST_TYPE(i)   ((i)&0xf)

(Note that these expect that you have defined the st_info field as unsigned char, not just char).

caf