From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21170 invoked by alias); 15 Apr 2005 22:20:42 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 21137 invoked from network); 15 Apr 2005 22:20:37 -0000 Received: from unknown (HELO gizmo02bw.bigpond.com) (144.140.70.12) by sourceware.org with SMTP; 15 Apr 2005 22:20:37 -0000 Received: (qmail 13755 invoked from network); 15 Apr 2005 22:20:35 -0000 Received: from unknown (HELO bwmam12.bigpond.com) (144.135.24.103) by gizmo02bw.bigpond.com with SMTP; 15 Apr 2005 22:20:35 -0000 Received: from cpe-144-136-221-26.sa.bigpond.net.au ([144.136.221.26]) by bwmam12.bigpond.com(MAM REL_3_4_2a 189/58124025) with SMTP id 58124025; Sat, 16 Apr 2005 08:20:35 +1000 Received: by bubble.modra.org (Postfix, from userid 500) id 6198B1A0D8D; Sat, 16 Apr 2005 07:50:35 +0930 Date: Fri, 15 Apr 2005 22:20:00 -0000 From: Alan Modra To: Paul Brook , binutils@sources.redhat.com Subject: Re: [patch] VxWorks x86 shared library support. Message-ID: <20050415222035.GE5334@bubble.modra.org> Mail-Followup-To: Paul Brook , binutils@sources.redhat.com References: <200504141458.26110.paul@codesourcery.com> <20050415070921.GI31303@bubble.modra.org> <20050415121911.GA22552@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050415121911.GA22552@nevyn.them.org> User-Agent: Mutt/1.4i X-SW-Source: 2005-04/txt/msg00443.txt.bz2 On Fri, Apr 15, 2005 at 08:19:11AM -0400, Daniel Jacobowitz wrote: > On Fri, Apr 15, 2005 at 04:39:21PM +0930, Alan Modra wrote: > > No way is this RELOC_FOR_GLOBAL_SYMBOL hack acceptable. Instead, do > > something about giving these magic symbols a value. See, for example, > > elf32_hppa_set_gp. > > Won't this cause the symbols to be output as defined? The loader > requires them to be undefined. Yes, it would output them as defined if you did it the same place as elf32_hppa_set_gp. I didn't realize you wanted them undefined. I suppose you could put a hack in elf_backend_output_arch_syms to define the sym for use by relocate_section. > > > (elf_link_adjust_relocs): Convert SHN_UNDEF relocs for PLT stubs > > > into section relative relocs. > > > > Yikes! You say > > > > + /* This is a relocation from an executable or shared library > > + against a symbol in a different shared library. We are > > + createing a definition in the output file but it does not come > > + from any of out normal (.o) files. ie. a PLT stub. > > > > So this is presumably a linker created reloc. Why can't you create it > > such that it doesn't need this horrible hack? > > No, it isn't linker created. VxWorks executables are kind of odd; they > are linked using --emit-relocs, and both the dynamic and non-dynamic > relocations are required for proper loading. What this bit is doing is > fixing up relocations from an input file that would otherwise be copied > straight to the output file. They're reloaded from the input file > here, so this is the only place the linker has an opportunity to frob > them. No, they are loaded from memory, where they have been written by _bfd_elf_link_output_relocs, or elf_backend_emit_relocs. Please look at putting any reloc twiddles into a backend_emit_relocs functions. -- Alan Modra IBM OzLabs - Linux Technology Centre