Home | History | Annotate | Download | only in libelf

Lines Matching refs:elf

1 /* Create new ELF header.
66 elfw2(LIBELFBITS,newehdr) (elf)
67 Elf *elf;
71 if (elf == NULL)
74 if (unlikely (elf->kind != ELF_K_ELF))
80 rwlock_wrlock (elf->lock);
82 if (elf->class == 0)
83 elf->class = ELFW(ELFCLASS,LIBELFBITS);
84 else if (unlikely (elf->class != ELFW(ELFCLASS,LIBELFBITS)))
91 /* Don't create an ELF header if one already exists. */
92 if (elf->state.ELFW(elf,LIBELFBITS).ehdr == NULL)
94 /* We use the memory in the ELF descriptor. */
95 elf->state.ELFW(elf,LIBELFBITS).ehdr =
96 &elf->state.ELFW(elf,LIBELFBITS).ehdr_mem;
99 memset (elf->state.ELFW(elf,LIBELFBITS).ehdr, '\0',
102 /* Mark the ELF header has modified. */
103 elf->state.ELFW(elf,LIBELFBITS).ehdr_flags |= ELF_F_DIRTY;
106 result = elf->state.ELFW(elf,LIBELFBITS).ehdr;
109 rwlock_unlock (elf->lock);