x86_64: R_X86_64_PC32 and R_X86_64_DTPOFF32 are 32-bit wide relocations.
Change-Id: I9c4e6c5ae77f4c17c2b6901f2b133db4b9dc48e3 Reviewed-on: https://review.haiku-os.org/445 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
fe8b46fb0d
commit
ee692b38b2
@ -239,7 +239,7 @@ arch_elf_relocate_rela(struct elf_image_info *image,
|
|||||||
|
|
||||||
// Calculate the relocation value.
|
// Calculate the relocation value.
|
||||||
Elf64_Addr relocValue;
|
Elf64_Addr relocValue;
|
||||||
switch(type) {
|
switch (type) {
|
||||||
case R_X86_64_NONE:
|
case R_X86_64_NONE:
|
||||||
continue;
|
continue;
|
||||||
case R_X86_64_64:
|
case R_X86_64_64:
|
||||||
@ -269,7 +269,10 @@ arch_elf_relocate_rela(struct elf_image_info *image,
|
|||||||
return B_BAD_ADDRESS;
|
return B_BAD_ADDRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(Elf64_Addr *)relocAddr = relocValue;
|
if (type == R_X86_64_PC32)
|
||||||
|
*(Elf32_Addr *)relocAddr = relocValue;
|
||||||
|
else
|
||||||
|
*(Elf64_Addr *)relocAddr = relocValue;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ relocate_rela(image_t* rootImage, image_t* image, Elf64_Rela* rel,
|
|||||||
|
|
||||||
// Calculate the relocation value.
|
// Calculate the relocation value.
|
||||||
Elf64_Addr relocValue;
|
Elf64_Addr relocValue;
|
||||||
switch(type) {
|
switch (type) {
|
||||||
case R_X86_64_NONE:
|
case R_X86_64_NONE:
|
||||||
continue;
|
continue;
|
||||||
case R_X86_64_64:
|
case R_X86_64_64:
|
||||||
@ -70,7 +70,10 @@ relocate_rela(image_t* rootImage, image_t* image, Elf64_Rela* rel,
|
|||||||
return B_BAD_DATA;
|
return B_BAD_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(Elf64_Addr *)relocAddr = relocValue;
|
if (type == R_X86_64_PC32 || type == R_X86_64_DTPOFF32)
|
||||||
|
*(Elf32_Addr *)relocAddr = relocValue;
|
||||||
|
else
|
||||||
|
*(Elf64_Addr *)relocAddr = relocValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user