From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9857 invoked by alias); 2 Jun 2004 18:19:35 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 9849 invoked by alias); 2 Jun 2004 18:19:34 -0000 Date: Wed, 02 Jun 2004 18:19:00 -0000 From: "gcc-bugzilla at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20040602181930.15781.vak@hanoi.cronyx.ru> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug target/15781] New: ARM ELF - incorrectly aligned .comm data X-Bugzilla-Reason: CC X-SW-Source: 2004-06/txt/msg00226.txt.bz2 List-Id: Global data (.comm) are improperly aligned on 32-byte boundary. As a result, 4-byte variables occupy 32 bytes - 78% memory loss. Environment: System: Linux hanum.cronyx.ru 2.4.18-5aspsmp #1 SMP Sat Jul 6 19:58:36 EEST 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: /soft/gnu/gcc-3.3.3/configure --prefix=/usr/local/gcc333 --disable-nls --enable-languages=c,c++,ada,java --enable-shared How-To-Repeat: Compile and link the following file: long x; long y; _start(){} Look at "nm -n" output: 00008000 T _start 00008114 A __bss_start 00008114 A __bss_start__ 00008114 D __data_start 00008114 A _edata 00008120 B x 00008140 B y 00008144 A __bss_end__ 00008144 A _bss_end__ 00008144 A _end 00008144 A __end__ 00080000 ? _stack You can see that "x" variable takes 0x20 bytes. ------- Additional Comments From vak at hanoi dot cronyx dot ru 2004-06-02 18:19 ------- Fix: GCC generates ".comm" directive with alignment in bits, while GAS expects alignment in bytes. Fix gcc/config/arm/elf.h, macro ASM_OUTPUT_ALIGNED_COMMON() - divide ALIGN by 8. -- Summary: ARM ELF - incorrectly aligned .comm data Product: gcc Version: 3.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: vak at hanoi dot cronyx dot ru CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15781