From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30961 invoked by alias); 26 Mar 2008 18:25:00 -0000 Received: (qmail 30935 invoked by uid 22791); 26 Mar 2008 18:24:59 -0000 X-Spam-Check-By: sourceware.org Received: from mgcp1.bloomberg.com (HELO mgcp1.bloomberg.com) (208.22.56.39) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Mar 2008 18:24:38 +0000 Received: from ny2570.bloomberg.com ([172.20.72.138]) by mgcp1.bloomberg.com with ESMTP; 26 Mar 2008 14:24:36 -0400 Received: from ny2528.corp.bloomberg.com (ny2528.corp.bloomberg.com [172.20.85.39]) by ny2570.bloomberg.com (8.14.1/8.14.1) with ESMTP id m2QIOTeU021743; Wed, 26 Mar 2008 14:24:29 -0400 Received: from ny2545.corp.bloomberg.com ([172.20.73.98]) by ny2528.corp.bloomberg.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 26 Mar 2008 14:24:29 -0400 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 26 Mar 2008 18:32:00 -0000 Message-ID: In-Reply-To: <20080326181817.GB5705@lunn.ch> References: <20080326180616.GA5705@lunn.ch> <20080326181817.GB5705@lunn.ch> From: "Chris Zimman" To: "Andrew Lunn" Cc: X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: RE: [ECOS] ARM EABI port / static constructor priority removal X-SW-Source: 2008-03/txt/msg00155.txt.bz2 > This won't work. For example, some watchdog drivers need the I2C > subsystem to be initialized before they can be initialized. The IO > layer must be initialised before libc etc. If you get these in the > wrong order, expect bad things to happen. I don't understand why you think "this won't work" when "this" is exactly what the static constructors are doing, except instead of being in one translation unit, they're in multiple. Perhaps you're missing what I'm saying -- I understand that things have to happen in order. What I'm saying is that I don't think static constructors are necessarily the best way to accomplish this. > In general, it is assumed gcc is used and that the gcc extensions > work. There have been a few attempts to use compilers other than gcc, > but i don't remember anybody ever says they have it working well. It works fine outside of the aforementioned issue. The 'it requires GCC' limitation is just a self imposed one. There's nothing magic going on. > As a side question, how well does function sections work with your > compiler? This is another gcc extension which eCos heavily uses in > order to keep the image size down. Also HAL tables? These also rely on > sorting otherwise the start and end won't be in the right place. Everything seems to work fine with the exception of the static constructors. It shoots off into the flats because some of the ordering is wrong. I expect that when the __init_array linker issue is resolved, things will work more or less fine. See below, built under EABI: + RedBoot(tm) bootstrap and debug environment [ROMRAM] Non-certified release, version v2_0_52 - built 13:33:07, Mar 25 2008 Platform: BCM95890 (ARM9)=20 Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. Copyright (C) 2003, 2004, 2005, 2006 eCosCentric Limited RAM: 0x00000000-0x00200000, [0x00022dc0-0x001bd000] available FLASH: 0x10000000-0x101fffff, 1 x 0x4000 blocks, 2 x 0x2000 blocks, 1 x 0x38000 blocks, 7 x 0x40000 blocks RedBoot> go 0x40000 EABI constructors invoked __cxa_atexit called: 0x0004fa00 0x00063eec 0x0006161c __cxa_atexit called: 0x0004de80 0x00000000 0x0006161c __cxa_atexit called: 0x0004c4e0 0x00063ed4 0x0006161c __cxa_atexit called: 0x0005b338 0x000669b8 0x0006161c __cxa_atexit called: 0x00052d08 0x00063fb4 0x0006161c __cxa_atexit called: 0x00050114 0x00066990 0x0006161c __cxa_atexit called: 0x000500e0 0x000669a4 0x0006161c __cxa_atexit called: 0x0004dd78 0x000643c8 0x0006161c __cxa_atexit called: 0x00050114 0x00066490 0x0006161c __cxa_atexit called: 0x000535b8 0x00066a34 0x0006161c __cxa_atexit called: 0x00050114 0x00066b44 0x0006161c __cxa_atexit called: 0x000535b8 0x000664a4 0x0006161c __cxa_atexit called: 0x000535b8 0x000669f0 0x0006161c Init device '/dev/ser0' pl011 SERIAL init - dev: a0300000.7 Set output buffer - buf: 6327c len: 128 Set input buffer - buf: 632fc len: 128 Init device '/dev/ser1' pl011 SERIAL init - dev: a0301000.8 Set output buffer - buf: 6337c len: 128 Set input buffer - buf: 633fc len: 128 Init device '/dev/ttydiag' Init tty channel: 616d4 Init device '/dev/haldiag' HAL/diag SERIAL init Init device '/dev/flash/' INFO: 0x000602a4, CRC 2fd4> INFO: [crash] -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss