if (data_text) {
// hdump("code", data_text->d_buf, data_text->d_size);
memcpy(firmware->flash + offset, data_text->d_buf, data_text->d_size);
- AVR_LOG(NULL, LOG_TRACE, "Loaded %u .text at address 0x%x\n",
+ AVR_LOG(NULL, LOG_TRACE, "Loaded %zu .text at address 0x%x\n",
(unsigned int)data_text->d_size, firmware->flashbase);
offset += data_text->d_size;
}
if (data_data) {
// hdump("data", data_data->d_buf, data_data->d_size);
memcpy(firmware->flash + offset, data_data->d_buf, data_data->d_size);
- AVR_LOG(NULL, LOG_TRACE, "Loaded %u .data\n", (unsigned int)data_data->d_size);
+ AVR_LOG(NULL, LOG_TRACE, "Loaded %zu .data\n", data_data->d_size);
offset += data_data->d_size;
firmware->datasize = data_data->d_size;
}
if (data_ee) {
- // hdump("eeprom", data_ee->d_buf, data_ee->d_size);
- firmware->eeprom = malloc(data_ee->d_size);
- memcpy(firmware->eeprom, data_ee->d_buf, data_ee->d_size);
- AVR_LOG(NULL, LOG_TRACE, "Loaded %u .eeprom\n", (unsigned int)data_ee->d_size);
+ elf_copy_section(".eeprom", data_ee, &firmware->eeprom);
firmware->eesize = data_ee->d_size;
}
if (data_fuse) {