This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Damaged PPC_REL24 handling


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]