• Home
  • Raw
  • Download

Lines Matching refs:elf

64 write_file (Elf *elf, off_t size, int change_bo, size_t shnum)  in write_file()  argument
66 int class = elf->class; in write_file()
70 if (unlikely (fstat (elf->fildes, &st) != 0)) in write_file()
81 if (elf->parent == NULL in write_file()
82 && (elf->maximum_size == ~((size_t) 0) in write_file()
83 || (size_t) size > elf->maximum_size) in write_file()
84 && unlikely (ftruncate (elf->fildes, size) != 0)) in write_file()
91 if (elf->map_address == NULL && elf->cmd == ELF_C_WRITE_MMAP) in write_file()
96 elf->map_address = mmap (NULL, size, PROT_READ | PROT_WRITE, in write_file()
97 MAP_SHARED, elf->fildes, 0); in write_file()
98 if (unlikely (elf->map_address == MAP_FAILED)) in write_file()
99 elf->map_address = NULL; in write_file()
103 if (elf->map_address != NULL) in write_file()
107 ? __elf32_updatemmap (elf, change_bo, shnum) in write_file()
108 : __elf64_updatemmap (elf, change_bo, shnum)) != 0) in write_file()
116 ? __elf32_updatefile (elf, change_bo, shnum) in write_file()
117 : __elf64_updatefile (elf, change_bo, shnum)) != 0) in write_file()
123 && elf->parent == NULL in write_file()
124 && elf->maximum_size != ~((size_t) 0) in write_file()
125 && (size_t) size < elf->maximum_size in write_file()
126 && unlikely (ftruncate (elf->fildes, size) != 0)) in write_file()
138 && unlikely (fchmod (elf->fildes, st.st_mode) != 0)) in write_file()
144 if (size != -1 && elf->parent == NULL) in write_file()
145 elf->maximum_size = size; in write_file()
152 elf_update (elf, cmd) in elf_update() argument
153 Elf *elf; in elf_update()
168 if (elf == NULL)
171 if (elf->kind != ELF_K_ELF)
177 rwlock_wrlock (elf->lock);
180 if (elf->state.elf.ehdr == NULL)
188 shnum = (elf->state.elf.scns_last->cnt == 0
190 : 1 + elf->state.elf.scns_last->data[elf->state.elf.scns_last->cnt - 1].index);
195 size = (elf->class == ELFCLASS32
196 ? __elf32_updatenull_wrlock (elf, &change_bo, shnum)
197 : __elf64_updatenull_wrlock (elf, &change_bo, shnum));
202 if (elf->cmd != ELF_C_RDWR
203 && elf->cmd != ELF_C_RDWR_MMAP
204 && elf->cmd != ELF_C_WRITE
205 && unlikely (elf->cmd != ELF_C_WRITE_MMAP))
210 else if (unlikely (elf->fildes == -1))
217 size = write_file (elf, size, change_bo, shnum);
221 rwlock_unlock (elf->lock);