From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18618 invoked by alias); 10 Dec 2002 17:43:11 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 18596 invoked from network); 10 Dec 2002 17:43:10 -0000 Received: from unknown (HELO sccrmhc01.attbi.com) (204.127.202.61) by sources.redhat.com with SMTP; 10 Dec 2002 17:43:10 -0000 Received: from lucon.org (12-234-88-146.client.attbi.com[12.234.88.146]) by sccrmhc01.attbi.com (sccrmhc01) with ESMTP id <2002121017430900100pv4hae>; Tue, 10 Dec 2002 17:43:09 +0000 Received: by lucon.org (Postfix, from userid 1000) id F0B012C698; Tue, 10 Dec 2002 09:43:08 -0800 (PST) Date: Tue, 10 Dec 2002 09:43:00 -0000 From: "H. J. Lu" To: Jakub Jelinek Cc: Roland McGrath , Ulrich Drepper , Glibc hackers , binutils@sources.redhat.com Subject: Re: [PATCH] Fix tst-array* on x86_64 Message-ID: <20021210094308.A11254@lucon.org> References: <20021210145250.M1310@sunsite.ms.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20021210145250.M1310@sunsite.ms.mff.cuni.cz>; from jakub@redhat.com on Tue, Dec 10, 2002 at 02:52:50PM +0100 X-SW-Source: 2002-12/txt/msg00018.txt.bz2 On Tue, Dec 10, 2002 at 02:52:50PM +0100, Jakub Jelinek wrote: > Hi! > > This is actually the same crap as I had to work around in test-string.h, > ie. x86_64 aligns preinit_array etc. to 16 bytes because they are >= > 16 bytes, yet its actual size is 24 bytes. > /* x86-64 ABI requires arrays greater than 16 bytes to be aligned > to 16byte boundary. */ > Linker script of course doesn't expect .init_array/.fini_array/.preinit_array > sections to be more than word aligned and thus the labels around them > are on wrong positions. > > 2002-12-10 Jakub Jelinek > > * elf/tst-array1.c (preinit_array, init_array, fini_array): > Explicitely align the array to sizeof (void *). > * elf/tst-array2dep.c (init_array, fini_array): Likewise. > > --- libc/elf/tst-array1.c.jj 2002-11-07 23:28:04.000000000 +0100 > +++ libc/elf/tst-array1.c 2002-12-10 16:01:54.000000000 +0100 > @@ -35,7 +35,7 @@ preinit_2 (void) > } > > void (*const preinit_array []) (void) > - __attribute__ ((section (".preinit_array"))) = > + __attribute__ ((section (".preinit_array"), aligned (sizeof (void *)))) = > { > &preinit_0, > &preinit_1, I assume size of void * is 8 byte for x86_64. Will it align at 16 byte? Those *_array sections are special sections. Should they be handled by gas/ld automatically? H.J.