29 ROSE_ASSERT(NULL != symver);
45 sprintf(p,
"%sElfSymverEntry[%zd].", prefix, idx);
47 sprintf(p,
"%sElfSymver.", prefix);
51 fprintf(f,
"%s%-*s = %zu", p, w,
"",
p_value);
53 case 0: fprintf(f,
" (local)\n");
break;
54 case 1: fprintf(f,
" (global)\n");
break;
55 default: fprintf(f,
"\n");
break;
74 ROSE_ASSERT(fhdr!=NULL);
76 ROSE_ASSERT(shdr!=NULL);
78 size_t entry_size, struct_size, extra_size, nentries;
83 for (
size_t i=0; i<nentries; ++i) {
97 std::vector<size_t> extra_sizes;
101 entsize, required, optional, entcount);
112 size_t entry_size, struct_size, extra_size, nentries;
119 for (
size_t i=0; i<nentries; i++) {
126 spos =
write(f, spos, struct_size, &val);
137 sprintf(p,
"%sElfSymverSection[%zd].", prefix, idx);
139 sprintf(p,
"%sElfSymverSection.", prefix);
166 ROSE_ASSERT(strsec!=NULL);
172 ROSE_ASSERT(NULL != entry);
187 sprintf(p,
"%sElfSymverDefinedAux[%zd].", prefix, idx);
189 sprintf(p,
"%sElfSymverDefinedAux.", prefix);
193 fprintf(f,
"%s%-*s = %s \n", p, w,
"name",
get_name()->get_string(
true).c_str());
218 ROSE_ASSERT(NULL != section);
260 sprintf(p,
"%sElfSymverDefinedEntry[%zd].", prefix, idx);
262 sprintf(p,
"%sElfSymverDefinedEntry.", prefix);
268 fprintf(f,
"%s%-*s %-8s %6s %10s %6s %-6s \n", p, w,
"",
"Version",
"Index",
"Hash",
"Flags",
"Names");
271 for (
size_t i=0; i < entries.size(); ++i)
272 fprintf(f,
"%s %s", 0==i?
"":
",", entries[i]->
get_name()->get_string(
true).c_str());
283 ROSE_ASSERT(NULL != strings);
359 ROSE_ASSERT(NULL!=fhdr);
361 ROSE_ASSERT(NULL!=shdr);
363 ROSE_ASSERT(NULL!=strsec);
371 while (entry_addr < this->
get_size()) {
375 entry->
parse(sex, &entryDisk);
383 for (
size_t i=0; i < num_aux; ++i) {
397 entry_addr += next_entry;
410 size_t extra_size = 0;
411 size_t entry_size = 0;
416 entry_size = struct_size;
420 for (
size_t i=0; i<nentries; ++i) {
421 size_t numAux = entries[i]->get_entries()->get_entries().size();
422 extra_size =
std::max(extra_size, numAux * aux_size);
423 total_size += (struct_size + (numAux* aux_size));
429 *entsize = entry_size;
431 *required = struct_size;
433 *optional = extra_size;
435 *entcount = nentries;
444 ROSE_ASSERT(NULL != fhdr);
455 for (
size_t ent=0; ent < nentries; ++ent) {
458 entry->
encode(sex, &entryDisk);
463 size_t num_aux = auxes.size();
464 size_t first_aux = entry_size;
465 size_t next_entry = first_aux + ( num_aux * aux_size );
466 if (nentries -1 == ent) {
474 write(f, entry_addr, entry_size,&entryDisk);
477 for (
size_t i=0; i < num_aux; ++i) {
481 aux->
encode(sex, &auxDisk);
483 size_t next_aux = aux_size;
484 if (num_aux-1 == i) {
489 write(f,aux_addr,aux_size, &auxDisk);
493 entry_addr += next_entry;
505 sprintf(p,
"%sElfSymverDefinedSection[%zd].", prefix, idx);
507 sprintf(p,
"%sElfSymverDefinedSection.", prefix);
512 fprintf(f,
"%s%-*s = %zu entries\n", p, w,
"ElfSymverDefined.size",
p_entries->
get_entries().size());
535 ROSE_ASSERT(NULL != strsec);
540 ROSE_ASSERT(NULL != entry);
558 sprintf(p,
"%sElfSymverNeededAux[%zd].", prefix, idx);
560 sprintf(p,
"%sElfSymverNeededAux.", prefix);
563 fprintf(f,
"%s%-*s = %04zx\n", p, w,
"other",
get_other());
564 fprintf(f,
"%s%-*s = 0x%08x\n", p, w,
"hash",
get_hash());
565 fprintf(f,
"%s%-*s = 0x%04x\n", p, w,
"flags",
get_flags());
566 fprintf(f,
"%s%-*s = %s \n", p, w,
"name",
get_name()->get_string(
true).c_str());
599 ROSE_ASSERT(NULL != section);
607 ROSE_ASSERT(NULL != strsec);
647 sprintf(p,
"%sElfSymverNeededEntry[%zd].", prefix, idx);
649 sprintf(p,
"%sElfSymverNeededEntry.", prefix);
655 fprintf(f,
"%s%-*s %-8s %-22s %6s %10s %6s %s\n", p, w,
"",
"Version",
"File",
"Other",
"Hash",
"Flags",
"Name");
658 if (entries.empty()) {
659 fprintf(f,
"<no auxiliary entries>\n");
663 for (
size_t i=0; i<entries.size(); ++i) {
666 sprintf(auxname,
"aux[%zu]", i);
667 fprintf(f,
"%s%-*s = 0x%04zx 0x%08x 0x%04x %s\n", p, w, auxname,
680 ROSE_ASSERT(NULL != strings);
699 ROSE_ASSERT(NULL!=fhdr);
701 ROSE_ASSERT(NULL!=shdr);
709 while (entry_addr < this->
get_size()) {
713 entry->
parse(sex, &entryDisk);
721 for (
size_t i=0; i < num_aux; ++i) {
725 aux->
parse(sex, &auxDisk);
735 entry_addr += next_entry;
747 size_t extra_size = 0;
748 size_t entry_size = 0;
753 entry_size = struct_size;
757 for (
size_t i=0; i<nentries; ++i) {
758 size_t numAux = entries[i]->get_entries()->get_entries().size();
759 extra_size =
std::max(extra_size, numAux * aux_size);
760 total_size += (struct_size + (numAux* aux_size));
766 *entsize = entry_size;
768 *required = struct_size;
770 *optional = extra_size;
772 *entcount = nentries;
781 ROSE_ASSERT(NULL != fhdr);
793 for (
size_t ent=0; ent < nentries; ++ent) {
796 entry->
encode(sex, &entryDisk);
801 size_t num_aux = auxes.size();
802 size_t first_aux = entry_size;
803 size_t next_entry = first_aux + ( num_aux * aux_size );
804 if (nentries -1 == ent) {
812 write(f, entry_addr, entry_size,&entryDisk);
815 for (
size_t i=0; i < num_aux; ++i) {
819 aux->
encode(sex, &auxDisk);
821 size_t next_aux = aux_size;
822 if (num_aux-1 == i) {
827 write(f,aux_addr,aux_size, &auxDisk);
830 entry_addr += next_entry;
841 sprintf(p,
"%sElfSymverNeededSection[%zd].", prefix, idx);
843 sprintf(p,
"%sElfSymverNeededSection.", prefix);
848 fprintf(f,
"%s%-*s = %zu entries\n", p, w,
"ElfSymverNeeded.size",
p_entries->
get_entries().size());