Home | History | Annotate | Download | only in nanoapp_postprocess

Lines Matching full:relocs

93     struct ElfAppSection relocs;
170 fprintf(stderr, "Unaligned relocs are not possible!\n");
272 fprintf(stderr, " Relocs (flash): %6" PRIu32 " bytes\n", relocsSz);
291 struct RelocEntry *relocs;
301 //make buffer 50% bigger than bufUsed in case relocs grow out of hand
322 relocs = (struct RelocEntry*)(buf + sect->rel_start - FLASH_BASE);
329 fprintf(stderr, "Relocs of nonstandard size\n");
341 fprintf(stderr, "Found %" PRIu32 " relocs and a %" PRIu32 "-entry symbol table\n", numRelocs, numSyms);
343 //handle relocs
351 uint32_t relocType = relocs[i].info & 0xff;
352 uint32_t whichSym = relocs[i].info >> 8;
361 i, relocs[i].where, relocs[i].info & 0xff, whichSym);
369 i, relocs[i].where, relocs[i].info & 0xff, whichSym, syms[whichSym].addr);
371 if (IS_IN_RANGE_E(relocs[i].where, sect->bss_start, sect->bss_end))
373 else if (IS_IN_RANGE_E(relocs[i].where, sect->data_start, sect->data_end))
375 else if (IS_IN_RANGE_E(relocs[i].where, sect->got_start, sect->got_end))
377 else if (IS_IN_RANGE_E(relocs[i].where, FLASH_BASE, FLASH_BASE + sizeof(struct BinHdr)))
384 /* handle relocs inside the header */
385 if (IS_IN_FLASH(relocs[i].where) && relocs[i].where - FLASH_BASE < sizeof(struct BinHdr) && relocType == RELOC_TYPE_SECT) {
386 /* relocs in header are special - runtime corrects for them */
393 valThereP = (uint32_t*)(buf + relocs[i].where - FLASH_BASE);
400 i, relocs[i].where, relocType, whichSym, syms[whichSym].addr);
417 if (!IS_IN_RAM(relocs[i].where)) {
423 i, relocs[i].where, relocType, whichSym, syms[whichSym].addr);
427 valThereP = (uint32_t*)(buf + relocs[i].where + sect->data_data - RAM_BASE - FLASH_BASE);
429 nanoRelocs[outNumRelocs].ofstInRam = relocs[i].where - RAM_BASE;
494 //overwrite original relocs and symtab with nanorelocs and adjust sizes
495 memcpy(relocs, packedNanoRelocs, packedNanoRelocSz);
504 fprintf(stderr, "Relocs end and file end not coincident\n");
540 // RW data in .data, that relocs for .data are included in .rel.data, and
556 .offset = offsetof(struct ElfNanoApp, relocs),
692 ERR(".data loadaddr, or .relocs not in flash address space!");
715 size_t numDataRelocs = app->relocs.size / sizeof(Elf32_Rel);
723 ERR("Couldn't allocate memory for nano relocs! Needed %zu bytes",
729 const Elf32_Rel *relocs = (const Elf32_Rel *) app->relocs.data;
733 DBG("Parsing relocs for .data (%zu):", numDataRelocs);
735 uint32_t type = ELF32_R_TYPE(relocs[i].r_info);
736 uint32_t sym = ELF32_R_SYM(relocs[i].r_info);
739 " --> 0x%08" PRIx32, i, relocs[i].r_offset, type, sym,
745 if (!IS_IN_RAM(relocs[i].r_offset)) {
749 uint32_t offset = relocs[i].r_offset - RAM_BASE;