Damaged PPC_REL24 handling
Daniel Jacobowitz
drow+@cs.cmu.edu
Fri Nov 13 14:49:00 GMT 1998
Something is wrong with the handling of R_PPC_REL24 relocations. This
error keeps getting triggered:
case R_PPC_REL24:
{
Elf32_Sword delta = finaladdr - (Elf32_Word) (char *) reloc_addr;
if (delta << 6 >> 6 != delta)
{
_dl_signal_error(0, map->l_name,
"R_PPC_REL24 relocation out of range");
}
*reloc_addr = *reloc_addr & 0xfc000003 | delta & 0x3fffffc;
}
break;
What the problem is I'm not quite sure - it could be binutils, but I
think the test is at fault. From what I can see this should be an
Elf32_Word, or cast to one for the range check. This way, if the
seventh MSB is set (within the valid range), sign extension breaks the
test. Am I misunderstanding?
Dan
More information about the Libc-hacker
mailing list