Endian bug in check-textrel

Andreas Schwab schwab@suse.de
Sat Dec 21 13:32:00 GMT 2002


p_type is a word, thus must be swapped.

Andreas.

2002-12-21  Andreas Schwab  <schwab@suse.de>

	* elf/check-textrel.c (handle_file): Swap p_type.

--- elf/check-textrel.c.~1.3.~	2002-12-14 00:17:43.000000000 +0100
+++ elf/check-textrel.c	2002-12-21 22:23:28.000000000 +0100
@@ -78,7 +78,7 @@ AB(handle_file) (const char *fname, int 
   /* Search for the PT_DYNAMIC entry.  */
   size_t cnt;
   for (cnt = 0; cnt < phnum; ++cnt)
-    if (phdr[cnt].p_type == PT_DYNAMIC)
+    if (SWAP (phdr[cnt].p_type) == PT_DYNAMIC)
       break;
 
   if (cnt == phnum)



More information about the Libc-hacker mailing list