about summary refs log tree commit diff
path: root/sysdeps/arm/dl-machine.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-02-05 06:01:54 +0000
committerUlrich Drepper <drepper@redhat.com>2001-02-05 06:01:54 +0000
commit0c8b61e64fb6542d4f4d40a44659a126049f07c7 (patch)
tree09d18077defd9ceb294baeb4f25ac520ab1f33f0 /sysdeps/arm/dl-machine.h
parent93693c4d820dac2f218e144f5126a5a761f1cfbf (diff)
downloadglibc-0c8b61e64fb6542d4f4d40a44659a126049f07c7.tar.gz
glibc-0c8b61e64fb6542d4f4d40a44659a126049f07c7.tar.xz
glibc-0c8b61e64fb6542d4f4d40a44659a126049f07c7.zip
Update.
2001-02-04  Philip Blundell  <philb@gnu.org>

	* configure.in: Distinguish ARM from Thumb.

2001-02-04  Philip Blundell  <philb@gnu.org>

	* sysdeps/arm/dl-machine.h (elf_machine_rel): Correct handling of
	PC24 relocs with negative value.
Diffstat (limited to 'sysdeps/arm/dl-machine.h')
-rw-r--r--sysdeps/arm/dl-machine.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index 9b40e6f98b..36ae4cf47c 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -478,17 +478,25 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
 	case R_ARM_PC24:
 	  {
 	     Elf32_Sword addend;
-	     Elf32_Addr newvalue;
+	     Elf32_Addr newvalue, topbits;
 
 	     addend = *reloc_addr & 0x00ffffff;
 	     if (addend & 0x00800000) addend |= 0xff000000;
 
 	     newvalue = value - (Elf32_Addr)reloc_addr + (addend << 2);
-	     if (newvalue & 0xfc000003)
-	       newvalue = fix_bad_pc24(reloc_addr, value)
-		 - (Elf32_Addr)reloc_addr + (addend << 2);
-
-	     newvalue = newvalue >> 2;
+	     topbits = newvalue & 0xfe000000;
+	     if (topbits != 0xfe000000 && topbits != 0x00000000)
+	       {
+		 newvalue = fix_bad_pc24(reloc_addr, value)
+		   - (Elf32_Addr)reloc_addr + (addend << 2);
+		 topbits = newvalue & 0xfe000000;
+		 if (topbits != 0xfe000000 && topbits != 0x00000000)
+		   {
+		     _dl_signal_error (0, map->l_name,
+				       "R_ARM_PC24 relocation out of range");
+		   }
+	       }
+	     newvalue >>= 2;
 	     value = (*reloc_addr & 0xff000000) | (newvalue & 0x00ffffff);
 	     *reloc_addr = value;
 	  }