Lines Matching defs:oc
167 static void addProddableBlock ( ObjectCode* oc, void* start, int size )
172 fprintf(stderr, "aPB oc=%p %p %d (%p .. %p)\n", oc, start, size,
177 pb->next = oc->proddables;
178 oc->proddables = pb;
181 static void checkProddableBlock ( ObjectCode* oc, void* addr )
184 for (pb = oc->proddables; pb != NULL; pb = pb->next) {
353 char* alloc_fixup_bytes ( ObjectCode* oc, int nbytes )
358 res = &(oc->fixup[oc->fixup_used]);
359 oc->fixup_used += nbytes;
360 if (oc->fixup_used >= oc->fixup_size) {
361 fprintf(stderr, "fixup area too small for %s\n", oc->fileName);
419 do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
472 oc->fileName, symbol);
482 checkProddableBlock ( oc, pP );
496 char* fixup = alloc_fixup_bytes(oc, 8);
534 oc->fileName, ELF_R_TYPE(info));
545 do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
612 belch("%s: function %s with addend %p", oc->fileName, symbol, (void *)A);
616 fprintf(stderr,"%s: unknown symbol `%s'\n", oc->fileName, symbol);
624 /* checkProddableBlock ( oc, (void*)P ); */
688 ia64_reloc_pcrel21(P, S, oc);
698 oc->fileName, ELF_R_TYPE(info));
708 ocResolve_ELF ( ObjectCode* oc )
713 char* ehdrC = (char*)(oc->image);
725 fprintf(stderr,"%s: can't find string or symbol table\n", oc->fileName);
740 ok = do_Elf_Rel_relocations ( oc, ehdrC, shdr,
746 ok = do_Elf_Rela_relocations ( oc, ehdrC, shdr,
753 delete_StringMap(oc->lochash);
754 oc->lochash = NULL;
767 ocVerifyImage_ELF ( ObjectCode* oc )
775 char* ehdrC = (char*)(oc->image);
782 fprintf(stderr,"%s: not an ELF object\n", oc->fileName);
787 fprintf(stderr,"%s: unsupported ELF format\n", oc->fileName);
799 fprintf(stderr,"%s: unknown endiannness\n", oc->fileName);
804 fprintf(stderr,"%s: not a relocatable object (.o) file\n", oc->fileName);
820 fprintf(stderr,"%s: unknown architecture\n", oc->fileName);
833 fprintf(stderr,"%s: no section header string table\n", oc->fileName);
882 fprintf(stderr,"%s: no string tables, or too many\n", oc->fileName);
901 oc->fileName);
936 fprintf(stderr,"%s: didn't find any symbol tables\n", oc->fileName);
951 ocGetNames_ELF ( ObjectCode* oc )
956 char* ehdrC = (char*)(oc->image);
967 fprintf(stderr,"%s: no strtab\n", oc->fileName);
1033 addProddableBlock(oc, ehdrC + shdr[i].sh_offset, shdr[i].sh_size);
1034 //addSection(oc, kind, ehdrC + shdr[i].sh_offset,
1044 oc->n_symbols = nent;
1045 oc->symbols = malloc(oc->n_symbols * sizeof(char*));
1103 ad, oc->fileName, nm );
1112 oc->symbols[j] = nm;
1117 //ghciInsertStrHashTable(oc->fileName, global_symbol_table, nm, ad);
1133 oc->symbols[j] = NULL;
1158 ObjectCode* oc;
1187 oc = malloc(sizeof(ObjectCode));
1189 oc->formatName = "ELF";
1195 oc->fileName = malloc( strlen(path)+1 );
1196 strcpy(oc->fileName, path);
1198 oc->fileSize = st.st_size;
1199 oc->symbols = NULL;
1200 oc->sections = NULL;
1201 oc->lochash = new_StringMap();
1202 oc->proddables = NULL;
1203 oc->fixup = NULL;
1204 oc->fixup_used = 0;
1205 oc->fixup_size = 0;
1208 oc->next = global_object_list;
1209 global_object_list = oc;
1223 + oc->fileSize);
1230 oc->fixup = p;
1231 oc->fixup_size = N_FIXUP_PAGES * pagesize;
1232 oc->fixup_used = 0;
1233 oc->image = &(p[ oc->fixup_size ]);
1235 r = read(fd, oc->image, oc->fileSize);
1236 if (r != oc->fileSize) {
1242 oc->fileName, oc->image, oc->fixup );
1247 r = ocVerifyImage_ELF ( oc );
1251 r = ocGetNames_ELF ( oc );
1255 oc->status = OBJECT_LOADED;
1270 ObjectCode *oc;
1275 for (oc = global_object_list; oc; oc = oc->next) {
1276 if (oc->status != OBJECT_RESOLVED) {
1277 r = ocResolve_ELF ( oc );
1279 oc->status = OBJECT_RESOLVED;