This is the mail archive of the libc-alpha@sourceware.org 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]
Other format: [Raw text]

[PATCH] Fix R_X86_64_PC32 overflow detection


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";


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