From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25255 invoked by alias); 22 May 2008 11:23:21 -0000 Received: (qmail 25245 invoked by uid 22791); 22 May 2008 11:23:20 -0000 X-Spam-Check-By: sourceware.org Received: from anchor-post-31.mail.demon.net (HELO anchor-post-31.mail.demon.net) (194.217.242.89) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 May 2008 11:22:53 +0000 Received: from calivar.demon.co.uk ([83.104.54.243] helo=xl5.calivar.com) by anchor-post-31.mail.demon.net with esmtp (Exim 4.67) id 1Jz8sh-000Ftr-3j; Thu, 22 May 2008 11:22:47 +0000 Received: from xl5.calivar.com (localhost [127.0.0.1]) by xl5.calivar.com (Postfix) with ESMTP id 6E8391387B6; Thu, 22 May 2008 12:22:44 +0100 (BST) To: "Frank Lin" Cc: References: <004101c8bbe0$96ba7690$9c1efea9@self9873de9bd3> From: Nick Garnett Original-Sender: nickg@ecoscentric.com Date: Thu, 22 May 2008 11:23:00 -0000 In-Reply-To: <004101c8bbe0$96ba7690$9c1efea9@self9873de9bd3> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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] compiled result not align to 4 bytes X-SW-Source: 2008-05/txt/msg00082.txt.bz2 "Frank Lin" writes: > I developed an application, but has problem, I use arm-elf-object -D > ??? to got latter result, I find these code compiled from assembly > file context.s not aligh to 4 bytes. > > My global compiler flags is: > mcpu=arm7tdmi -mno-short-load-words -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -gdwarf-2 -g3 -O0 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority > > My global linker flags is: > -mcpu=arm7tdmi -mno-short-load-words -Wl,--gc-sections -Wl,-static -gdwarf-2 -g3 -nostdlib > > Whether it is caused by gcc bug? To solve this problem, whether I > should place .align 4 to every assembly file, or any simple way > exists? > I doubt that this is a GCC bug. If the asm files needed .align 4 they would have it. In any case all text sections will be 4 byte aligned by default. The following is not code but ASCII text: "DEFINE(sym, val) asm volatile"... This seems to be part of the source of hal_mk_defs.c. The compiled code of this file shouldn't make it into the executable, let alone the source! > c110318: 49464544 stmmidb r6, {r2, r6, r8, sl, lr}^ ----------------------- > c11031c: 7328454e teqvc r8, #327155712 ; 0x13800000 ^ > c110320: 762c6d79 undefined | > c110324: 20296c61 eorcs r6, r9, r1, ror #24 | > c110328: 206d7361 rsbcs r7, sp, r1, ror #6 | > c11032c: 616c6f76 cmnvs ip, r6, ror pc I do not know which souce code > c110330: 656c6974 strvsb r6, [ip, -#2420]! compile to these code > c110334: 6e5c2228 cdpvs 2, 5, cr2, cr12, cr8, {1} | > c110338: 652e745c strvs r7, [lr, -#1116]! | > c11033c: 745c7571 ldrvcb r7, [ip], -#1393 | > c110340: 79732022 ldmvcdb r3!, {r1, r5, sp}^ v > c110344: 4dc0146d cfstrdmi mvd1, [r0, #436] ----------------------- The following code doesn't seem to correspond to the current version in anoncvs. Are you using V2.0 or anoncvs? > 0c110345 : <-----------not aligh to 4 bytes > c110345: e24dc014 sub ip, sp, #20 ; 0x14 > c110349: e92c6000 stmdb ip!, {sp, lr} > c11034d: e1a0d00c mov sp, ip > c110351: e92d1fff stmdb sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, ip} > c110355: e10f2000 mrs r2, CPSR > c110359: e58d2040 str r2, [sp, #64] > c11035d: e581d000 str sp, [r1] > > 0c110361 : > c110361: e590b000 ldr fp, [r0] > c110365: e10f0000 mrs r0, CPSR > c110369: e38000c0 orr r0, r0, #192 ; 0xc0 > c11036d: e129f000 msr CPSR_fc, r0 Basically, something has gone horribly wrong with your build. I would advise getting the current anoncvs and make sure you can build all the test programs before building your own application. -- Nick Garnett eCos Kernel Architect eCosCentric Limited http://www.eCosCentric.com The eCos experts Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No: 4422071 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss