Lines Matching defs:data

359 			sec->data = elf_getdata(s, NULL);
360 if (!sec->data) {
364 if (sec->data->d_off != 0 ||
365 sec->data->d_size != sec->sh.sh_size) {
366 WARN("unexpected data attributes for %s",
448 shndx_data = symtab_shndx->data;
475 if (!gelf_getsymshndx(symtab->data, shndx_data, i, &sym->sym,
590 * The libelf API is terrible; gelf_update_sym*() takes a data block relative
591 * index value, *NOT* the symbol index. As such, iterate the data blocks and
594 * If no data block is found, allow adding a new data block provided the index
626 /* get next data descriptor for the relevant sections */
687 WARN("zero size data");
896 WARN("bad call to %s() for data symbol %s",
1055 Elf_Data *data;
1072 data = elf_newdata(s);
1073 if (!data) {
1078 data->d_buf = str;
1079 data->d_size = strlen(str) + 1;
1080 data->d_align = 1;
1083 strtab->sh.sh_size += data->d_size;
1120 sec->data = elf_newdata(s);
1121 if (!sec->data) {
1126 sec->data->d_size = size;
1127 sec->data->d_align = 1;
1130 sec->data->d_buf = malloc(size);
1131 if (!sec->data->d_buf) {
1135 memset(sec->data->d_buf, 0, size);
1190 rsec->data->d_type = ELF_T_RELA;
1229 Elf_Data *data = sec->data;
1231 if (data->d_type != ELF_T_BYTE || data->d_off) {
1232 WARN("write to unexpected data for section: %s", sec->name);
1236 memcpy(data->d_buf + offset, insn, len);
1247 * A) adhere to the section header and truncate the data, or
1248 * B) ignore the section header and write out all the data you've got?
1250 * Yes, libelf sucks and we need to manually truncate if we over-allocate data.
1256 Elf_Data *data = NULL;
1266 /* get next data descriptor for the relevant section */
1267 data = elf_getdata(s, data);
1269 if (!data) {
1271 WARN("end of section data but non-zero size left\n");
1279 WARN("truncated; but more data\n");
1283 if (!data->d_size) {
1284 WARN("zero size data");
1288 if (data->d_size > size) {
1290 data->d_size = size;
1293 size -= data->d_size;