From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16528 invoked by alias); 16 Apr 2010 13:29:16 -0000 Received: (qmail 16516 invoked by uid 22791); 16 Apr 2010 13:29:14 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from portal.icerasemi.com (HELO pOrtaL.icerasemi.com) (213.249.204.90) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Apr 2010 13:29:05 +0000 X-ASG-Debug-ID: 1271424541-1fa000020000-Lwtx7q X-Barracuda-URL: http://192.168.1.243:80/cgi-bin/mark.cgi Received: from Exchangevs.Icerasemi.com (cluster1.icerasemi.local [192.168.1.203]) by pOrtaL.icerasemi.com (Spam & Virus Firewall) with ESMTP id 2E75DE3CC6 for ; Fri, 16 Apr 2010 13:29:01 +0000 (GMT) Received: from Exchangevs.Icerasemi.com (cluster1.icerasemi.local [192.168.1.203]) by pOrtaL.icerasemi.com with ESMTP id 1fvFqlGBbPxSbXPO for ; Fri, 16 Apr 2010 13:29:01 +0000 (GMT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-ASG-Orig-Subj: VMA section overlap warnings for overlays Subject: VMA section overlap warnings for overlays Date: Fri, 16 Apr 2010 13:29:00 -0000 Message-ID: <4D60B0700D1DB54A8C0C6E9BE69163700E67DFD1@EXCHANGEVS.IceraSemi.local> From: "David Stubbs" To: X-Barracuda-Connect: cluster1.icerasemi.local[192.168.1.203] X-Barracuda-Start-Time: 1271424541 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.27589 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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-04/txt/msg00199.txt.bz2 Hi, I have an issue with overlays that seems to have come about as a result of this patch (http://sourceware.org/ml/binutils/2008-05/msg00235.html): --- 2008-05-28 Jan Kratochvil * elf.c (assign_file_positions_for_load_sections): Adjust pre-section gaps based on VMA and P_VADDR instead of LMA and P_PADDR addresses. --- Consider the following simplified code: --- brsbs01 0>cat over.S .section SEC_NAME,"ax",@progbits nop =20=20=20=20=20=20=20=20 brsbs01 0>cat start.s .section .text,"ax",@progbits .globl _start .type _start, @function _start: nop .section .imem,"ax",@progbits nop brsbs01 0>cat ldscript.x=20 OUTPUT_FORMAT("elf32-i386") OUTPUT_ARCH(i386) ENTRY(_start) PHDRS { mem PT_LOAD; imem PT_LOAD; } SECTIONS { .text 0x1000: { *(.text) } :mem .imem 0x2000 : AT (LOADADDR (.text) + SIZEOF (.text)) { *(.imem) } :imem .overlay1 ADDR (.imem) + SIZEOF (.imem)=20 : AT (LOADADDR (.imem) + SIZEOF (.imem)) { *(.overlay.1) } :imem =20=20=20=20=20=20=20 .overlay2 ADDR (.imem) + SIZEOF (.imem)=20 : AT (LOADADDR (.overlay1) + SIZEOF (.overlay1)) { *(.overlay.2) } :imem .overlay3 ADDR (.imem) + SIZEOF (.imem)=20 : AT (LOADADDR (.overlay2) + SIZEOF (.overlay2)) { *(.overlay.3) } :imem } --- Built with: --- gcc over.S -DSEC_NAME=3D".overlay.1" -c -o over1.o gcc over.S -DSEC_NAME=3D".overlay.2" -c -o over2.o gcc over.S -DSEC_NAME=3D".overlay.3" -c -o over3.o gcc start.s -c -o start.o ld over1.o over2.o over3.o start.o -T ldscript.x -o test.exe=20 --- Using an old version of GNU ld (2.17) I don't get any linker warnings, and the executable looks as I'd expect. When using the latest code from CVS, I get the following warnings when linking: --- brsbs01 0>ld-new over1.o over2.o over3.o start.o -T ldscript.x -o test.exe ld-new: test.exe: section .overlay2 vma 0x2001 overlaps previous sections ld-new: test.exe: section .overlay3 vma 0x2001 overlaps previous sections --- As it happens, the executable actually looks correct in this case, but the warnings can't be a good thing. Also, I have a larger case where we're getting these warnings and our overlays aren't working (whereas they used to with an older linker) - I just haven't managed to reproduce this problem in a smaller test yet... Am I doing something wrong or unusual in my linker script, or does it look like there's a problem in the linker? Thanks for any advice, Dave.