From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7956 invoked by alias); 17 Dec 2013 16:19:56 -0000 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 Received: (qmail 7946 invoked by uid 89); 17 Dec 2013 16:19:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: nm2.access.bullet.mail.gq1.yahoo.com Received: from nm2.access.bullet.mail.gq1.yahoo.com (HELO nm2.access.bullet.mail.gq1.yahoo.com) (216.39.62.33) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 17 Dec 2013 16:19:55 +0000 Received: from [216.39.60.166] by nm2.access.bullet.mail.gq1.yahoo.com with NNFMP; 17 Dec 2013 16:19:53 -0000 Received: from [98.138.226.242] by tm2.access.bullet.mail.gq1.yahoo.com with NNFMP; 17 Dec 2013 16:19:53 -0000 Received: from [127.0.0.1] by smtp113.sbc.mail.ne1.yahoo.com with NNFMP; 17 Dec 2013 16:19:53 -0000 X-Yahoo-SMTP: 0h0Q7euswBD_g.kcEqbzJWRFfrba801gq1M1 X-Rocket-Received: from mistral.localnet (stilor@107.201.5.112 with plain [98.138.84.52]) by smtp113.sbc.mail.ne1.yahoo.com with SMTP; 17 Dec 2013 16:19:53 +0000 UTC From: Alexey Neyman To: Alan Modra Cc: binutils@sourceware.org Subject: Re: _bfd_elf_parse_eh_frame() should not assume relocation order? Date: Tue, 17 Dec 2013 16:19:00 -0000 Message-ID: <18499698.IioVzg3OJF@mistral> User-Agent: KMail/4.11.2 (Linux/3.11.0-12-generic; KDE/4.11.2; x86_64; ; ) In-Reply-To: <20131217113021.GA28733@bubble.grove.modra.org> References: <13342318.jQqOC5NQ3F@mistral> <20131217113021.GA28733@bubble.grove.modra.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2013-12/txt/msg00217.txt.bz2 On Tuesday, December 17, 2013 10:00:21 PM Alan Modra wrote: > On Tue, Dec 17, 2013 at 01:02:03AM -0800, Alexey Neyman wrote: > > The problem is that after 'ld -r' linking, the resulting .rela.eh_frame is > > not > > sorted by the r_offset: > Why are you using ld -r? Just to package up object files? Not a good > idea. Yes, in order to post-process the resulting object file localize the symbols for interfaces private to a module - limiting the exposure of interfaces. But that was not the question: > As you have discovered, ld -r reorders things. The question was, is it allowed to do so? Why shouldn't it sort the relocations when writing the resulting object if it expects such ordering on input? The `info ld' states the following about the -r option: Generate relocatable output--i.e., generate an output file that can in turn serve as input to 'ld'. This is often called "partial linking". I don't see how this description can be interpreted to say "`ld -r' can mess things up to the point ld itself will produce errors when trying to link the object file previously produced by ld". So, is it a bug in BFD? Regards, Alexey.