[PATCH] Fix R_X86_64_PC32 overflow detection
Richard Guenther
rguenther@suse.de
Tue Mar 2 14:18:00 GMT 2010
Commit e7f110cdbd6e9c5a48b378ba7b30a3ad1dc04314 accidentially
changed the R_X86_64_PC32 overflow check from checking proper
sign-extension to zero-extension. The following patch reverts
that change and fixes dynamic loading of the IBM JRE.
Please commit.
Thanks,
Richard.
2010-03-02 Richard Guenther <rguenther@suse.de>
* sysdeps/x86_64/dl-machine.h (elf_machine_rela): R_X86_64_PC32
is sign-extending.
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 61a0556..3f531f1 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -419,7 +419,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
case R_X86_64_PC32:
value += reloc->r_addend - (Elf64_Addr) reloc_addr;
*(unsigned int *) reloc_addr = value;
- if (__builtin_expect (value != (unsigned int) value, 0))
+ if (__builtin_expect (value != (int) value, 0))
{
fmt = "\
%s: Symbol `%s' causes overflow in R_X86_64_PC32 relocation\n";
More information about the Libc-alpha
mailing list