61 uint64_t info = (p_sym<<8) | (
p_type & 0xff);
70 uint64_t info = ((uint64_t)p_sym<<32) | (
p_type & 0xffffffff);
78 ROSE_ASSERT(0==p_r_addend);
79 uint64_t info = (p_sym<<8) | (
p_type & 0xff);
87 ROSE_ASSERT(0==p_r_addend);
88 uint64_t info = ((uint64_t)p_sym<<32) | (
p_type & 0xffffffff);
111 sprintf(p,
"%sElfRelocEntry[%zd]", prefix, idx);
113 sprintf(p,
"%sElfRelocEntry", prefix);
119 fprintf(f,
"%s%-*s %-10s %-20s %-10s %4s %-10s %s\n",
120 p, w,
"",
"Offset",
"Type",
"Addend",
"Sym",
"Value",
"Name + Addend");
124 fprintf(f,
"%s%-*s = 0x%08"PRIx64, p, w,
"", p_r_offset);
127 SgAsmGenericHeader* header = SageInterface::getEnclosingNode<SgAsmGenericHeader>(
this);
129 fprintf(f,
" %-20s", reloc_name().c_str());
131 fprintf(f,
" 0x%02zx ", (
size_t)
p_type);
136 fprintf(f,
" 0x%08"PRIx64, p_r_addend);
138 fprintf(f,
" %10s",
"");
142 fprintf(f,
" %4lu", p_sym);
146 fprintf(f,
" %10s <no symtab>",
"");
148 fprintf(f,
" %10s <out of range>",
"");
156 fprintf(f,
" + %"PRIu64, p_r_addend);
160 if (p_extra.size()>0) {
161 fprintf(f,
"%s%-*s = %zu bytes\n", p, w,
".extra", p_extra.size());
162 hexdump(f, 0, std::string(p)+
"extra at ", p_extra);
172 p_linked_section = symbols;
173 p_target_section = targetsec;
185 size_t entry_size, struct_size, extra_size, nentries;
186 calculate_sizes(&entry_size, &struct_size, &extra_size, &nentries);
187 ROSE_ASSERT(extra_size==0);
190 for (
size_t i=0; i<nentries; i++) {
195 read_content_local(i*entry_size, &disk, struct_size);
200 read_content_local(i*entry_size, &disk, struct_size);
207 read_content_local(i*entry_size, &disk, struct_size);
212 read_content_local(i*entry_size, &disk, struct_size);
220 entry->
get_extra() = read_content_local_ucl(i*entry_size+struct_size, extra_size);
230 std::vector<size_t> extra_sizes;
231 for (
size_t i=0; i<p_entries->get_entries().size(); i++)
232 extra_sizes.push_back(p_entries->get_entries()[i]->get_extra().size());
236 extra_sizes, entsize, required, optional, entcount);
240 extra_sizes, entsize, required, optional, entcount);
269 size_t entry_size, struct_size, extra_size, nentries;
270 calculate_sizes(&entry_size, &struct_size, &extra_size, &nentries);
273 get_section_entry()->set_sh_entsize(entry_size);
276 for (
size_t i=0; i<nentries; i++) {
287 disk = entry->
encode(sex, &diska32);
289 disk = entry->
encode(sex, &disk32);
293 disk = entry->
encode(sex, &diska64);
295 disk = entry->
encode(sex, &disk64);
298 ROSE_ASSERT(!
"unsupported word size");
302 spos = write(f, spos, struct_size, disk);
305 ROSE_ASSERT(entry->
get_extra().size()<=extra_size);
320 sprintf(p,
"%sRelocSection[%zd].", prefix, idx);
322 sprintf(p,
"%sRelocSection.", prefix);
328 fprintf(f,
"%s%-*s = %s\n", p, w,
"uses_addend", p_uses_addend ?
"yes" :
"no");
330 if (p_target_section) {
331 fprintf(f,
"%s%-*s = [%d] \"%s\"\n", p, w,
"target_section",
332 p_target_section->get_id(), p_target_section->get_name()->get_string(
true).c_str());
334 fprintf(f,
"%s%-*s = NULL\n", p, w,
"target_section");
337 for (
size_t i=0; i<p_entries->get_entries().size(); i++) {
339 ent->
dump(f, p, i, symtab);
343 hexdump(f, 0, std::string(p)+
"data at ", p_data);