From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23019 invoked by alias); 4 Jul 2002 15:03:27 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22993 invoked from network); 4 Jul 2002 15:03:25 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.114.42) by sources.redhat.com with SMTP; 4 Jul 2002 15:03:25 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.11.6/8.11.6) with ESMTP id g64F3Mx00973; Thu, 4 Jul 2002 17:03:22 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.11.6/8.11.6) id g64F3Mj08511; Thu, 4 Jul 2002 17:03:22 +0200 (CEST) (envelope-from kettenis) Date: Thu, 04 Jul 2002 08:15:00 -0000 From: Mark Kettenis Message-Id: <200207041503.g64F3Mj08511@elgar.kettenis.dyndns.org> To: binutils@sources.redhat.com CC: gdb-patches@sources.redhat.com Subject: [RFA/PATCH] Fix recognition of NT_PRXFREG notes X-SW-Source: 2002-07/txt/msg00081.txt.bz2 After Alan's 2002-06-25 change some tests in GDB's testsuite have been failing on Linux. Turns out the current code that reads NT_PRXFREG notes expects note->namesz to be 5, but with the trailing 0, the length of "LINUX" is 6. Turns out the Linux kernel doesn't include the trailing 0 in the name size. According to the Systemm V ABI the trailing 0 should be included, so Alan's change is correct and Linux is wrong here. But since changing the Linux kernel isn't going to happen overnight, I propose the attached fix. Ok to check this in? Mark Index: ChangeLog from Mark Kettenis * elf.c (elfcore_grok_note): Fix recognition of NT_PRXFREG notes. Index: elf.c =================================================================== RCS file: /cvs/src/src/bfd/elf.c,v retrieving revision 1.152 diff -u -p -r1.152 elf.c --- elf.c 4 Jul 2002 13:26:30 -0000 1.152 +++ elf.c 4 Jul 2002 14:54:36 -0000 @@ -6718,8 +6718,7 @@ elfcore_grok_note (abfd, note) #endif case NT_PRXFPREG: /* Linux SSE extension */ - if (note->namesz == 5 - && ! strcmp (note->namedata, "LINUX")) + if (strncmp (note->namedata, "LINUX", 5) == 0) return elfcore_grok_prxfpreg (abfd, note); else return true;