11 ROSE_ASSERT(dynsec!=NULL);
70 p_name->set_parent(NULL);
75 p_name->set_parent(
this);
86 sprintf(p,
"%sElfDynamicEntry[%zd].", prefix, idx);
88 sprintf(p,
"%sElfDynamicEntry.", prefix);
93 strcpy(label, to_string(p_d_tag).c_str());
94 for (
char *s=label; *s; s++) *s = tolower(*s);
96 fprintf(f,
"%s%-*s = %s", p, w, label, p_d_val.to_string().c_str());
98 fprintf(f,
" \"%s\"", p_name->get_string(
true).c_str());
101 if (p_extra.size()>0) {
102 fprintf(f,
"%s%-*s = %zu bytes\n", p, w,
"extra", p_extra.size());
103 hexdump(f, 0, std::string(p)+
"extra at ", p_extra);
113 ROSE_ASSERT(strings!=NULL);
114 p_linked_section = strings;
128 ROSE_ASSERT(strsec!=NULL);
130 size_t entry_size, struct_size, extra_size, nentries;
131 calculate_sizes(&entry_size, &struct_size, &extra_size, &nentries);
135 for (
size_t i=0; i<nentries; i++) {
140 read_content_local(i*entry_size, &disk, struct_size);
145 read_content_local(i*entry_size, &disk, struct_size);
151 entry->
get_extra() = read_content_local_ucl(i*entry_size+struct_size, extra_size);
155 ROSE_ASSERT(entry->
get_name()==NULL);
158 name->set_parent(entry);
172 std::vector<size_t> extra_sizes;
173 for (
size_t i=0; i<p_entries->get_entries().size(); i++)
174 extra_sizes.push_back(p_entries->get_entries()[i]->get_extra().size());
178 entsize, required, optional, entcount);
186 ROSE_ASSERT(fhdr!=NULL);
188 for (
size_t i=0; i<p_entries->get_entries().size(); i++) {
227 for (SgAsmGenericSectionPtrList::iterator i=containers.begin(); i!=containers.end(); ++i) {
228 if ((*i)->is_mapped()) {
264 for (
size_t i=0; i<p_entries->get_entries().size(); i++) {
291 size_t entry_size, struct_size, extra_size, nentries;
292 calculate_sizes(&entry_size, &struct_size, &extra_size, &nentries);
295 get_section_entry()->set_sh_entsize(entry_size);
298 for (
size_t i=0; i<nentries; i++) {
306 disk = entry->
encode(sex, &disk32);
308 disk = entry->
encode(sex, &disk64);
310 ROSE_ASSERT(!
"unsupported word size");
314 spos = write(f, spos, struct_size, disk);
316 ROSE_ASSERT(entry->
get_extra().size()<=extra_size);
330 sprintf(p,
"%sDynamicSection[%zd].", prefix, idx);
332 sprintf(p,
"%sDynamicSection.", prefix);
337 for (
size_t i=0; i<p_entries->get_entries().size(); i++) {
340 dump_containing_sections(f, std::string(p)+
"...", ent->
get_d_val(), get_header()->get_sections()->get_sections());
344 hexdump(f, 0, std::string(p)+
"data at ", p_data);