From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2550 invoked by alias); 18 Nov 2002 15:20:45 -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 2535 invoked from network); 18 Nov 2002 15:20:41 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 18 Nov 2002 15:20:41 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gAIEv1w19715; Mon, 18 Nov 2002 09:57:01 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gAIFKdD00896; Mon, 18 Nov 2002 10:20:39 -0500 Received: from north-pole.nickc.cambridge.redhat.com.redhat.com (vpn50-24.rdu.redhat.com [172.16.50.24]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gAIFKaq31984; Mon, 18 Nov 2002 10:20:38 -0500 To: newlib@sources.redhat.com Cc: gdb-patches@sources.redhat.com Subject: ARM crt0.o: Add NULL to end of argv[] From: Nick Clifton Date: Mon, 18 Nov 2002 07:20:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-11/txt/msg00455.txt.bz2 Hi Guys, I am applying the patch below to fix a small bug in the ARM crt0.o file for newlib. The code was creating an argv[] array from the command line, but it was not terminating the array with a NULL pointer. This is required by the ISO C specification, and this patch fixes the problem. Cheers Nick 2002-11-18 Nick Clifton * libc/sys/arm/crt0.S: Add NULL to end of argv array. Index: newlib/libc/sys/arm/crt0.S =================================================================== RCS file: /cvs/src/src/newlib/libc/sys/arm/crt0.S,v retrieving revision 1.6 diff -c -3 -p -w -r1.6 crt0.S *** newlib/libc/sys/arm/crt0.S 30 Apr 2002 18:23:38 -0000 1.6 --- newlib/libc/sys/arm/crt0.S 18 Nov 2002 15:19:11 -0000 *************** __change_mode: *** 181,186 **** --- 181,193 ---- bhi .LC13 #endif + /* Push a NULL argument onto the end of the list. */ + mov r2, #0 + #ifdef __thumb__ + push {r2} + #else + stmfd sp!, {r1} + #endif #endif #ifdef __USES_INITFINI__