* [csl-arm] SymbianOS calls via PLT from thumb mode
@ 2005-03-29 16:20 Paul Brook
0 siblings, 0 replies; only message in thread
From: Paul Brook @ 2005-03-29 16:20 UTC (permalink / raw)
To: binutils; +Cc: Julian Brown
[-- Attachment #1: Type: text/plain, Size: 521 bytes --]
The SymbianOS PLT does not contain thumb stubs, so we need to use blx to jump
to the plt entry from thumb mode.
Long-term we want to make this work for all armv5 targets, as discussed here:
http://sourceware.org/ml/binutils/2005-03/msg00438.html
I've applied the attached patch as a Symbian-specific short-term fix to the
binutils-csl-arm-2005q1-branch.
Paul
2005-03-29 Julian Brown <julian@codesourcery.com>
* elf32-arm.c (elf32_arm_final_link_relocate): Use blx to get to
symbian plt entries from thumb mode.
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 2477 bytes --]
? bfd/doc/bfd.info
? bfd/doc/bfd.info-1
? gas/doc/as.info
? gas/doc/as.info-1
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.26
diff -c -p -r1.26 elf32-arm.c
*** bfd/elf32-arm.c 22 Mar 2005 15:39:32 -0000 1.26
--- bfd/elf32-arm.c 24 Mar 2005 18:05:56 -0000
*************** elf32_arm_final_link_relocate (reloc_how
*** 2650,2655 ****
--- 2650,2656 ----
bfd_signed_vma reloc_signed_min = ~ reloc_signed_max;
bfd_vma check;
bfd_signed_vma signed_check;
+ bfd_boolean thumb_plt_call = FALSE;
/* Need to refetch the addend and squish the two 11 bit pieces
together. */
*************** elf32_arm_final_link_relocate (reloc_how
*** 2699,2706 ****
value = (splt->output_section->vma
+ splt->output_offset
+ h->plt.offset);
! /* Target the Thumb stub before the ARM PLT entry. */
! value -= 4;
*unresolved_reloc_p = FALSE;
}
--- 2700,2719 ----
value = (splt->output_section->vma
+ splt->output_offset
+ h->plt.offset);
! if (globals->symbian_p)
! {
! /* On SymbianOS, we are guaranteed to be using at least ARMv5t.
! Convert the BL to a BLX instruction to call the ARM-mode PLT
! entry. */
! if ((lower_insn & (0x3 << 11)) == 0x3 << 11)
! {
! lower_insn = (lower_insn & ~(0x3 << 11)) | 0x1 << 11;
! thumb_plt_call = TRUE;
! }
! }
! else
! /* Target the Thumb stub before the ARM PLT entry. */
! value -= PLT_THUMB_STUB_SIZE;
*unresolved_reloc_p = FALSE;
}
*************** elf32_arm_final_link_relocate (reloc_how
*** 2724,2731 ****
overflow = TRUE;
#ifndef OLD_ARM_ABI
! if (r_type == R_ARM_THM_XPC22
! && ((lower_insn & 0x1800) == 0x0800))
/* For a BLX instruction, make sure that the relocation is rounded up
to a word boundary. This follows the semantics of the instruction
which specifies that bit 1 of the target address will come from bit
--- 2737,2745 ----
overflow = TRUE;
#ifndef OLD_ARM_ABI
! if ((r_type == R_ARM_THM_XPC22
! && ((lower_insn & 0x1800) == 0x0800))
! || thumb_plt_call)
/* For a BLX instruction, make sure that the relocation is rounded up
to a word boundary. This follows the semantics of the instruction
which specifies that bit 1 of the target address will come from bit
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-03-29 15:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-29 16:20 [csl-arm] SymbianOS calls via PLT from thumb mode Paul Brook
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).