Lines Matching refs:data

34 // Random data string (16 bytes).
46 printf ("couldn't get data section: %s\n", elf_errmsg (-1));
50 Elf_Data *data = elf_newdata (scn);
51 if (data == NULL)
57 data->d_buf = buf;
58 data->d_type = ELF_T_BYTE;
59 data->d_size = len;
60 data->d_align = 1;
61 data->d_version = EV_CURRENT;
123 printf ("cannot get header for data section: %s\n", elf_errmsg (-1));
143 // Add some data to the section.
176 printf ("couldn't get data section: %s\n", elf_errmsg (-1));
199 check_section_data (Elf *elf, char *data, size_t len, size_t times)
204 printf ("couldn't get data section: %s\n", elf_errmsg (-1));
216 printf ("cannot get data for section item %zd: %s\n",
221 printf ("OK, section data item %zd (d_off: %" PRId64
225 printf ("%zd data (d_off: %" PRId64
228 if (memcmp (data, d_data, len) != 0)
230 printf ("Got bad data in section for item %zd.\n", i);
258 // Add some more data (won't be written to disk).
271 // Read the ELF from disk now. And add new data directly.
281 // But don't check contents, that would read the data...
283 // Add some more data.
301 // Read the ELF from disk now. And add new data after raw reading.
311 // But don't check contents, that would read the data...
313 // Get raw data before adding new data.
317 printf ("couldn't get data section: %s\n", elf_errmsg (-1));
322 Elf_Data *data = elf_rawdata (scn, NULL);
323 if (data == NULL)
325 printf ("couldn't get raw data from section: %s\n", elf_errmsg (-1));
329 if (data->d_size != DATA_LEN)
331 printf ("Unexpected Elf_Data: %zd", data->d_size);
335 // Now add more data.
353 // Read the ELF from disk now. And add new data after data reading.
363 // Get (converted) data before adding new data.
368 // Now add more data.
395 // Fill holes with something non-zero to more easily spot bad data.