From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29118 invoked by alias); 10 Jul 2007 07:45:57 -0000 Received: (qmail 29108 invoked by uid 22791); 10 Jul 2007 07:45:56 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Jul 2007 07:45:54 +0000 Received: (qmail 11685 invoked from network); 10 Jul 2007 07:45:52 -0000 Received: from unknown (HELO ?192.168.44.101?) (nathan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 10 Jul 2007 07:45:52 -0000 Message-ID: <4693392E.8080709@codesourcery.com> Date: Tue, 10 Jul 2007 10:40:00 -0000 From: Nathan Sidwell User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: binutils Subject: [vxworks, ppc] shared objects and copy relocs Content-Type: multipart/mixed; boundary="------------080800060400070606070904" 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: 2007-07/txt/msg00210.txt.bz2 This is a multi-part message in MIME format. --------------080800060400070606070904 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 608 I've installed this patch to fix a problem with vxworks rtp shared objects and weak symbols. The problem here was that the executable was resolving a symbol to a shared object, and thought it could eliminate a copy reloc because the only references were in the small data section. Unfortunately that doesn't work on vxworks. This patch matches code in elf32-i386, which has exactly the same problem. tested on powerpc-wrs-vxworks. nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk --------------080800060400070606070904 Content-Type: text/plain; name="all.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="all.diff" Content-length: 1652 2007-07-09 Nathan Sidwell * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't eliminate copy relocs on vxworks. Index: bfd/elf32-ppc.c =================================================================== RCS file: /cvs/src/src/bfd/elf32-ppc.c,v retrieving revision 1.219 diff -c -3 -p -r1.219 elf32-ppc.c *** bfd/elf32-ppc.c 3 Jul 2007 14:26:41 -0000 1.219 --- bfd/elf32-ppc.c 10 Jul 2007 07:35:56 -0000 *************** ppc_elf_adjust_dynamic_symbol (struct bf *** 4284,4294 **** if (!h->non_got_ref) return TRUE; ! /* If we didn't find any dynamic relocs in read-only sections, then we'll ! be keeping the dynamic relocs and avoiding the copy reloc. We can't ! do this if there are any small data relocations. */ if (ELIMINATE_COPY_RELOCS ! && !ppc_elf_hash_entry (h)->has_sda_refs) { struct ppc_elf_dyn_relocs *p; for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next) --- 4284,4298 ---- if (!h->non_got_ref) return TRUE; ! /* If we didn't find any dynamic relocs in read-only sections, then ! we'll be keeping the dynamic relocs and avoiding the copy reloc. ! We can't do this if there are any small data relocations. This ! doesn't work on VxWorks, where we can not have dynamic ! relocations (other than copy and jump slot relocations) in an ! executable. */ if (ELIMINATE_COPY_RELOCS ! && !ppc_elf_hash_entry (h)->has_sda_refs ! && !htab->is_vxworks) { struct ppc_elf_dyn_relocs *p; for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next) --------------080800060400070606070904--