From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3269 invoked by alias); 30 Nov 2010 14:55:45 -0000 Received: (qmail 3258 invoked by uid 22791); 30 Nov 2010 14:55:44 -0000 X-SWARE-Spam-Status: No, hits=0.9 required=5.0 tests=AWL,BAYES_50,RDNS_DYNAMIC,T_FILL_THIS_FORM_SHORT X-Spam-Check-By: sourceware.org Received: from host-82-135-62-35.customer.m-online.net (HELO mail.embedded-brains.de) (82.135.62.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Nov 2010 14:55:36 +0000 Received: by mail.embedded-brains.de (Postfix, from userid 65534) id 563CE65F2E2; Tue, 30 Nov 2010 15:55:31 +0100 (CET) Received: from [192.168.96.31] (eb0011.eb.z [192.168.96.31]) by mail.embedded-brains.de (Postfix) with ESMTP id DA47F65F2E1 for ; Tue, 30 Nov 2010 15:55:29 +0100 (CET) Message-ID: <4CF51061.2040405@embedded-brains.de> Date: Tue, 30 Nov 2010 17:00:00 -0000 From: Sebastian Huber User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101026 SUSE/3.0.10 Lightning/1.0b1 Thunderbird/3.0.10 MIME-Version: 1.0 To: binutils@sourceware.org Subject: Re: Strange LMA/VMA behavior with regions References: <4CF39E98.3090009@embedded-brains.de> In-Reply-To: <4CF39E98.3090009@embedded-brains.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00499.txt.bz2 Hi, I tried to figure out why LD produced this gap. If I change the LD behavior like this Index: ld/ldlang.c =================================================================== RCS file: /cvs/src/src/ld/ldlang.c,v retrieving revision 1.348 diff -u -r1.348 ldlang.c --- ld/ldlang.c 21 Nov 2010 20:36:24 -0000 1.348 +++ ld/ldlang.c 30 Nov 2010 14:46:50 -0000 @@ -4919,6 +4919,7 @@ { bfd_vma savedot = newdot; newdot = align_power (newdot, align); + os->region->current = newdot; if (newdot != savedot && (config.warn_section_align the problem disappears. The section begin alignment consumes now also space in the run-time region. In case the run-time and load-time regions are equal this will prevent the artificial offsets. Please note that the test case "TLS -fno-pic -shared" in "ld/testsuite/ld-i386/i386.exp" fails now. Readelf dump without patch: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .hash HASH 000000b4 0000b4 00003c 04 A 2 0 4 [ 2] .dynsym DYNSYM 000000f0 0000f0 0000a0 10 A 3 1 4 [ 3] .dynstr STRTAB 00000190 000190 000031 00 A 0 0 1 [ 4] .rel.dyn REL 000001c4 0001c4 0000a0 08 A 2 0 4 [ 5] .text PROGBITS 00001000 001000 0000f4 00 AX 0 0 4096 [ 6] .tbss NOBITS 000020f4 0010f4 000024 00 WAT 0 0 1 [ 7] .dynamic DYNAMIC 000020f4 0010f4 000080 08 WA 3 0 4 [ 8] .got PROGBITS 00002174 001174 000018 04 WA 0 0 4 [ 9] .got.plt PROGBITS 0000218c 00118c 00000c 04 WA 0 0 4 [10] .shstrtab STRTAB 00000000 001198 00005d 00 0 0 1 [11] .symtab SYMTAB 00000000 001400 0001e0 10 12 21 4 [12] .strtab STRTAB 00000000 0015e0 000074 00 0 0 1 Readelf dump with patch: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .hash HASH 000000b4 0000b4 00003c 04 A 2 0 4 [ 2] .dynsym DYNSYM 000000f0 0000f0 0000a0 10 A 3 1 4 [ 3] .dynstr STRTAB 00000190 000190 000031 00 A 0 0 1 [ 4] .rel.dyn REL 000001c4 0001c4 0000a0 08 A 2 0 4 [ 5] .text PROGBITS 00001000 001000 0000f4 00 AX 0 0 4096 [ 6] .tbss NOBITS 00002000 002000 000024 00 WAT 0 0 1 [ 7] .dynamic DYNAMIC 00002000 002000 000080 08 WA 3 0 4 [ 8] .got PROGBITS 00002080 002080 000018 04 WA 0 0 4 [ 9] .got.plt PROGBITS 00002098 002098 00000c 04 WA 0 0 4 [10] .shstrtab STRTAB 00000000 0020a4 00005d 00 0 0 1 [11] .symtab SYMTAB 00000000 00230c 0001e0 10 12 21 4 [12] .strtab STRTAB 00000000 0024ec 000074 00 0 0 1 Is this a problem? It would be nice if we can use this patch, because this simplifies linker command files for embedded devices with a scattered memory map considerable. Have a nice day! -- Sebastian Huber, embedded brains GmbH Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany Phone : +49 89 18 90 80 79-6 Fax : +49 89 18 90 80 79-9 E-Mail : sebastian.huber@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.