From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27955 invoked by alias); 9 Jun 2006 18:28:25 -0000 Received: (qmail 27947 invoked by uid 22791); 9 Jun 2006 18:28:25 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 09 Jun 2006 18:28:23 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FoliJ-0001AS-Ol; Fri, 09 Jun 2006 14:28:07 -0400 Date: Fri, 09 Jun 2006 19:16:00 -0000 From: Daniel Jacobowitz To: Fred Fish Cc: "H. J. Lu" , binutils@sourceware.org Subject: Re: [PATCH] Create ".dynamic" section earlier Message-ID: <20060609182807.GB4174@nevyn.them.org> Mail-Followup-To: Fred Fish , "H. J. Lu" , binutils@sourceware.org References: <200606091014.24692.fnf@specifix.com> <20060609150314.GA14486@lucon.org> <200606091140.09648.fnf@specifix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200606091140.09648.fnf@specifix.com> User-Agent: Mutt/1.5.11+cvs20060403 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00143.txt.bz2 On Fri, Jun 09, 2006 at 11:40:09AM -0400, Fred Fish wrote: > $ mips-elf-gcc -shared -o main main.c -Tidt.ld > /links/opt-local/latest/trunk/bin/../lib/gcc/mips-elf/4.2.0/../../../../mips-elf/bin/ld: main: The first section in the PT_DYNAMIC segment is not the .dynamic section > /links/opt-local/latest/trunk/bin/../lib/gcc/mips-elf/4.2.0/../../../../mips-elf/bin/ld: final link failed: Bad value > collect2: ld returned 1 exit status This problem, of course, only arises because the .dynamic section is not in your linker script. If you were using the standard linker scripts generated by the ld build process, it would probably work. The problem is that the parameter file for mips-elf has GENERATE_SHLIB_SCRIPT=yes, so -shared is allowed by the linker, but you're using a handwritten (from libgloss) linker script that doesn't. So orphan placement is kicking in. -- Daniel Jacobowitz CodeSourcery