struct libimg
{
Elf32_Phdr ph;
};
struct libimg limg = {
{
p_type: PT_LOAD,
p_memsz: 2 * PAGE_SIZE
}
};
static void makelib(void *r)
{
limg.ph.p_vaddr = r;
}
And Elf32_Phdr is defined in linux/elf.h
typedef struct elf32_phdr{
Elf32_Addr p_vaddr;
....
} Elf32_Phdr;
I want to assign p_vaddr value from the argument. But I get this warning assignment makes integer from pointer without a cast. I use gdb to check and print r shows (void *)0x08040000
Elf32_Phdrtype.void*to another pointer type without a cast (unlessp_vaddrisn't a pointer).