Преглед изворни кода

Whine about R_PPC_REL24 relocations, and tell people to compile
shared libraries with -fPIC

Eric Andersen пре 21 година
родитељ
комит
4a296e9ef1
1 измењених фајлова са 15 додато и 10 уклоњено
  1. 15 10
      ldso/ldso/powerpc/elfinterp.c

+ 15 - 10
ldso/ldso/powerpc/elfinterp.c

@@ -349,17 +349,22 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
 		*(short *)reloc_addr = finaladdr;
 		break;
 	case R_PPC_REL24:
-	{
-		Elf32_Sword delta = finaladdr - (Elf32_Word)reloc_addr;
-		if(unlikely(delta<<6>>6 != delta)) {
-			_dl_dprintf(2, "%s: symbol '%s' R_PPC_REL24 is out of range.\n\t"
-					"Compile shared libraries with -fPIC!\n",
-				    _dl_progname, symname);
-			_dl_exit(1);
+#if 0
+		{
+			Elf32_Sword delta = finaladdr - (Elf32_Word)reloc_addr;
+			if(unlikely(delta<<6>>6 != delta)) {
+				_dl_dprintf(2, "%s: symbol '%s' R_PPC_REL24 is out of range.\n\t"
+						"Compile shared libraries with -fPIC!\n",
+						_dl_progname, symname);
+				_dl_exit(1);
+			}
+			*reloc_addr = (*reloc_addr & 0xfc000003) | (delta & 0x3fffffc);
+			break;
 		}
-		*reloc_addr = (*reloc_addr & 0xfc000003) | (delta & 0x3fffffc);
-		break;
-	}
+#else
+		_dl_dprintf(2,"R_PPC_REL24: Compile shared libraries with -fPIC!\n");
+		_dl_exit(1);
+#endif
 	default:
 		_dl_dprintf(2, "%s: can't handle reloc type ", _dl_progname);
 #if defined (__SUPPORT_LD_DEBUG__)