hrev52235 adds 1 changeset to branch 'master'
old head: fe8b46fb0d6850a76fa2a2a4775a7534d2f202fb
new head: ee692b38b25ce08f1fe691523a63cacd28f9dfc4
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=ee692b38b25c+%5Efe8b46fb0d68
----------------------------------------------------------------------------
ee692b38b25c: 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@xxxxxxxxx>
[ Jérôme Duval <jerome.duval@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev52235
Commit: ee692b38b25ce08f1fe691523a63cacd28f9dfc4
URL: https://git.haiku-os.org/haiku/commit/?id=ee692b38b25c
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Mon Aug 6 17:33:17 2018 UTC
Committer: waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Wed Aug 15 16:16:20 2018 UTC
----------------------------------------------------------------------------
2 files changed, 10 insertions(+), 4 deletions(-)
src/system/kernel/arch/x86/arch_elf.cpp | 7 +++++--
src/system/runtime_loader/arch/x86_64/arch_relocate.cpp | 7 +++++--
----------------------------------------------------------------------------
diff --git a/src/system/kernel/arch/x86/arch_elf.cpp
b/src/system/kernel/arch/x86/arch_elf.cpp
index f785e20645..cb1d0f2363 100644
--- a/src/system/kernel/arch/x86/arch_elf.cpp
+++ b/src/system/kernel/arch/x86/arch_elf.cpp
@@ -239,7 +239,7 @@ arch_elf_relocate_rela(struct elf_image_info *image,
// Calculate the relocation value.
Elf64_Addr relocValue;
- switch(type) {
+ switch (type) {
case R_X86_64_NONE:
continue;
case R_X86_64_64:
@@ -269,7 +269,10 @@ arch_elf_relocate_rela(struct elf_image_info *image,
return B_BAD_ADDRESS;
}
- *(Elf64_Addr *)relocAddr = relocValue;
+ if (type == R_X86_64_PC32)
+ *(Elf32_Addr *)relocAddr = relocValue;
+ else
+ *(Elf64_Addr *)relocAddr = relocValue;
#endif
}
diff --git a/src/system/runtime_loader/arch/x86_64/arch_relocate.cpp
b/src/system/runtime_loader/arch/x86_64/arch_relocate.cpp
index fda4c27c33..90a62bf237 100644
--- a/src/system/runtime_loader/arch/x86_64/arch_relocate.cpp
+++ b/src/system/runtime_loader/arch/x86_64/arch_relocate.cpp
@@ -43,7 +43,7 @@ relocate_rela(image_t* rootImage, image_t* image, Elf64_Rela*
rel,
// Calculate the relocation value.
Elf64_Addr relocValue;
- switch(type) {
+ switch (type) {
case R_X86_64_NONE:
continue;
case R_X86_64_64:
@@ -70,7 +70,10 @@ relocate_rela(image_t* rootImage, image_t* image,
Elf64_Rela* rel,
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;