(gdb) p cp + 1 $78 = 0x749ffa "gottpoff" (gdb) p gotrel[j].str $79 = 0x505cbe "GOTPLT" (gdb) p len $80 = 6 (gdb) call strncasecmp (cp + 1, gotrel[j].str, gotrel[j].len) $81 = 0 (gdb)
[hjl@gnu-35 junk-1]$ cat test.c #include <stdio.h> #include <stdlib.h> #include <string.h> static char cp [4096+16] __attribute__ ((aligned(4096))); static char gotrel[4096] __attribute__ ((aligned(4096))); int main () { char *p = cp + 0xffa; char *g = gotrel + 0xcbe; strcpy (p, "gottpoff"); strcpy (g, "GOTPLT"); printf ("%p: %s\n", p, p); printf ("%p: %s\n", g, g); if (strncasecmp (p, g, 6) <= 0) abort (); return 0; } [hjl@gnu-35 junk-1]$ make cc test.c -o test ./test 0x602ffa: gottpoff 0x604cbe: GOTPLT make: *** [all] Aborted [hjl@gnu-35 junk-1]$
Created attachment 5118 [details] A patch
A patch is at http://sourceware.org/ml/libc-alpha/2010-11/msg00031.html
Patch is in git.