This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Re: Subject: GNU ARM cross compiler failing to call code in ram from flash


Hi Kor,

> Execution stops after this due to a bad exception.  The program counter
> is in ram, but about 100 bytes after the start of the function and none
> of the code in the functions seems to have been executed.

This is probably due to a recently fixed bug in the linker.  Try
downloading the latest sources from the binutils CVS repository here:

  ftp://sources.redhat.com/pub/binutils/snapshots

Cheers
        Nick

PS.  The patch you need is this one:

  2003-02-13  Nick Clifton  <nickc at redhat dot com>

	* elf32-arm.h (elf32_thumb_to_arm_stub): Include section VMAs
	in computation of offset to insert into BL instruction.

Index: elf32-arm.h
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.h,v
retrieving revision 1.102
retrieving revision 1.103
diff -c -3 -p -w -r1.102 -r1.103
*** elf32-arm.h 10 Feb 2003 11:21:19 -0000      1.102
--- elf32-arm.h 13 Feb 2003 19:35:22 -0000      1.103
*************** elf32_thumb_to_arm_stub (info, name, inp
*** 929,941 ****

    BFD_ASSERT (my_offset <= globals->thumb_glue_size);

!   /* Now go back and fix up the original BL insn to point
!      to here.  */
!   ret_offset = (s->output_offset
!               + my_offset
!               - (input_section->output_offset
!                  + offset + addend)
!               - 8);

    tmp = bfd_get_32 (input_bfd, hit_data
                    - input_section->vma);
--- 929,944 ----

    BFD_ASSERT (my_offset <= globals->thumb_glue_size);

!   /* Now go back and fix up the original BL insn to point to here.  */
!   ret_offset =
!     /* Address of where the stub is located.  */
!     (s->output_section->vma + s->output_offset + my_offset)
!      /* Address of where the BL is located.  */
!     - (input_section->output_section->vma + input_section->output_offset + offset)
!     /* Addend in the relocation.  */
!     - addend
!     /* Biassing for PC-relative addressing.  */
!     - 8;

    tmp = bfd_get_32 (input_bfd, hit_data
                    - input_section->vma);


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