public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [vxworks, ppc]  shared objects and copy relocs
@ 2007-07-10 10:40 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2007-07-10 10:40 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 608 bytes --]

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


[-- Attachment #2: all.diff --]
[-- Type: text/plain, Size: 1652 bytes --]

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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-10  7:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-10 10:40 [vxworks, ppc] shared objects and copy relocs Nathan Sidwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).