relocations across several places - the "standard" ones such as
q->addend and bfd_section_vma(), but also embeds small offsets in the
actual text (code) itself. Thus, it is necessary to examine the text to
get an initial offset, then add that to the others to get the final
fixup location.
This is required for at least MICROBLAZE_64 and MICROBLAZE_32 - others
may also need it.
Patch from John Williams <jwilliams@itee.uq.edu.au>
continue;
}
case R_MICROBLAZE_32:
- relocation_needed = 1;
+ {
+ unsigned char *p = r_mem;
+ unsigned long offset;
+
+ /* grab any offset from the text */
+ offset = (p[0]<<24) + (p[1] << 16) + (p[2] << 8) + (p[3]);
//sym_addr = (*(q->sym_ptr_ptr))->value;
sym_vma = bfd_section_vma(abs_bfd, sym_section);
- sym_addr += sym_vma + q->addend;
- break;
+ sym_addr += offset + sym_vma + q->addend;
+ relocation_needed = 1;
+ break;
+ }
case R_MICROBLAZE_64_PCREL:
sym_vma = 0;
//sym_addr = (*(q->sym_ptr_ptr))->value;