This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/15781] New: ARM ELF - incorrectly aligned .comm data


	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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]