This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[vxworks, ppc] shared objects and copy relocs


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

2007-07-09  Nathan Sidwell  <nathan@codesourcery.com>

	* 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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]