public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [arm] Resolve R_ARM_PREL31
@ 2004-11-12  9:41 Paul Brook
  2004-11-12 10:03 ` Richard Earnshaw
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Brook @ 2004-11-12  9:41 UTC (permalink / raw)
  To: binutils; +Cc: Richard Earnshaw

The R_ARM_PREL31 relocation should be resolved to the PTL entry for external 
symbols, and not written into shared objects. Patch below implements this.

Tested with cross to arm-none-eabi, and light testing on arm-none-symbianelf.
Ok?

2004-11-11  Paul Brook  <paul@codesourcery.com>

 * bfd/elf32-arm.c (elf32_arm_final_link_relocate): Resolve
 R_ARM_PREL31 relocations to PLT entries.
 (elf32_arm_relocate_section, elf32_arm_gc_sweep_hook): Ditto.
 (elf32_arm_check_relocs): Ditto.

Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.5
diff -u -p -r1.5 elf32-arm.c
--- bfd/elf32-arm.c 9 Nov 2004 16:50:38 -0000 1.5
+++ bfd/elf32-arm.c 12 Nov 2004 01:49:40 -0000
@@ -2288,11 +2288,7 @@ elf32_arm_final_link_relocate (reloc_how
   will use the symbol's value, which may point to a PLT entry, but we
   don't need to handle that here.  If we created a PLT entry, all
   branches in this object should go to it.  */
-      if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32
-#ifndef OLD_ARM_ABI
-    && r_type != R_ARM_PREL31
-#endif
-    )
+      if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32)
    && h != NULL
    && splt != NULL
    && h->plt.offset != (bfd_vma) -1)
@@ -2314,11 +2310,8 @@ elf32_arm_final_link_relocate (reloc_how
   into the output file to be resolved at run time.  */
       if (info->shared
    && (input_section->flags & SEC_ALLOC)
-   && ((r_type != R_ARM_REL32
-#ifndef OLD_ARM_ABI
-       && r_type != R_ARM_PREL31
-#endif
-       ) || !SYMBOL_CALLS_LOCAL (info, h))
+   && (r_type != R_ARM_REL32
+       || !SYMBOL_CALLS_LOCAL (info, h))
    && (h == NULL
        || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
        || h->root.type != bfd_link_hash_undefweak)
@@ -2326,6 +2319,7 @@ elf32_arm_final_link_relocate (reloc_how
 #ifndef OLD_ARM_ABI
    && r_type != R_ARM_CALL
    && r_type != R_ARM_JUMP24
+   && r_type != R_ARM_PREL31
 #endif
    && r_type != R_ARM_PLT32)
  {
@@ -3197,6 +3191,7 @@ elf32_arm_relocate_section (bfd *       
 #ifndef OLD_ARM_ABI
   case R_ARM_CALL:
   case R_ARM_JUMP24:
+  case R_ARM_PREL31:
 #endif
          case R_ARM_ABS32:
   case R_ARM_THM_PC22:
@@ -3888,9 +3883,6 @@ elf32_arm_gc_sweep_hook (bfd *          
   h->plt.refcount -= 1;
 
        if (r_type == R_ARM_ABS32
-#ifndef OLD_ARM_ABI
-    || r_type == R_ARM_PREL31
-#endif
     || r_type == R_ARM_REL32)
   {
     eh = (struct elf32_arm_link_hash_entry *) h;
@@ -4039,6 +4031,7 @@ elf32_arm_check_relocs (bfd *abfd, struc
 #ifndef OLD_ARM_ABI
       || r_type == R_ARM_CALL
       || r_type == R_ARM_JUMP24
+      || r_type == R_ARM_PREL31
 #endif
       || r_type == R_ARM_PLT32)
     h->needs_plt = 1;
@@ -4153,9 +4146,6 @@ elf32_arm_check_relocs (bfd *abfd, struc
     }
 
   if (r_type == R_ARM_ABS32
-#ifndef OLD_ARM_ABI
-      || r_type == R_ARM_PREL31
-#endif
       || r_type == R_ARM_REL32)
     p->count += 1;
        }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [arm] Resolve R_ARM_PREL31
  2004-11-12  9:41 [arm] Resolve R_ARM_PREL31 Paul Brook
@ 2004-11-12 10:03 ` Richard Earnshaw
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw @ 2004-11-12 10:03 UTC (permalink / raw)
  To: Paul Brook; +Cc: binutils

On Fri, 2004-11-12 at 09:41, Paul Brook wrote:
> The R_ARM_PREL31 relocation should be resolved to the PTL entry for external 
> symbols, and not written into shared objects. Patch below implements this.
> 
> Tested with cross to arm-none-eabi, and light testing on arm-none-symbianelf.
> Ok?
> 
> 2004-11-11  Paul Brook  <paul@codesourcery.com>
> 
>  * bfd/elf32-arm.c (elf32_arm_final_link_relocate): Resolve
>  R_ARM_PREL31 relocations to PLT entries.
>  (elf32_arm_relocate_section, elf32_arm_gc_sweep_hook): Ditto.
>  (elf32_arm_check_relocs): Ditto.

OK.

R.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-12 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-12  9:41 [arm] Resolve R_ARM_PREL31 Paul Brook
2004-11-12 10:03 ` Richard Earnshaw

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