Deal with REL records that have the addend embedded variable sized targets

rather than the RELA table.  I dont know if bintutils will ever generate
REL records, but just in case.....
This commit is contained in:
Peter Wemm 2004-05-17 21:16:49 +00:00
parent 6106f45151
commit 910bb7dbe9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129361

View File

@ -119,9 +119,18 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data,
case ELF_RELOC_REL:
rel = (const Elf_Rel *)data;
where = (Elf_Addr *) (relocbase + rel->r_offset);
addend = *where;
rtype = ELF_R_TYPE(rel->r_info);
symidx = ELF_R_SYM(rel->r_info);
/* Addend is 32 bit on 32 bit relocs */
switch (rtype) {
case R_X86_64_PC32:
case R_X86_64_32S:
addend = *(Elf32_Addr *)where;
break;
default:
addend = *where;
break;
}
break;
case ELF_RELOC_RELA:
rela = (const Elf_Rela *)data;
@ -136,7 +145,6 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data,
switch (rtype) {
case R_X86_64_NONE: /* none */
break;