This is the mail archive of the binutils@sources.redhat.com 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]

Re: PATCH: Symbian OS linker scripts


Nick Clifton wrote:

Approved - please apply.

Thanks. There were a couple of clarifications to the PLT requirements over the past couple of days, incorporated in this revised version of the patch, which I checked in.


--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com

2004-09-03  Mark Mitchell  <mark@codesourcery.com>

	* config.bfd (arm*-*-symbianelf*): Use OS-specific target vectors.
	* configure.in (bfd_elf32_bigarm_symbian_vec): Add it.
	(bfd_elf32_littlearm_symbian_vec): Likewise.
	* configure: Regenerated.
	* elf-bfd.h (elf_backend_data): Add dynamic_sec_flags.
	* elf32-arm.h (PLT_HEADER_SIZE): Do not define.
	(PLT_ENTRY_SIZE): Likewise.
	(bfd_vma_elf32_arm_symbian_plt_entry): New
	variable.
	(elf32_arm_link_hash_table): Add plt_header_size, plt_entry_size,
	and symbian_p.
	(create_got_section): Don't create sections when generating BPABI
	objects.
	(elf32_arm_create_dynamic_sections): Tidy.
	(elf32_arm_link_hash_table_create): Set plt_header_size,
	plt_entry_size, and symbian_p.
	(elf32_arm_check_relocs): Do not mark .rel.dyn as loadable when
	generating BPABI objects.
	(allocate_dynrelocs): Use htab->plt_header_size, not
	PLT_HEADER_SIZE.  Do not add to .got.plt when
	generating BPABI objects.
	(elf32_arm_finish_dynamic_symbol): Generate Symbian OS PLTs.
	* elfarm-nabi.c: Add SymbianOS target vectors.
	* elflink.c (_bfd_elf_create_got_section): Use dynamic_sec_flags.
	(_bfd_elf_link_create_dynamic_sections): Likewise.
	* elfxx-target.h (ELF_DYNAMIC_SEC_FLAGS): New macro.
	(elfNN_bed): Use it.
	* targets.c (bfd_elf32_bigarm_symbian_vec): New variable.
	(bfd_elf32_littlearm_symbian_vec): Likewise.
	(_bfd_target_vector): Add them.

2004-09-02  Mark Mitchell  <mark@codesourcery.com>

	* Makefile.am (TARG_ENV_HFILES): Add te-symbian.h.
	* Makefile.in: Regenerated.
	* configure.in: Set em for arm*-*-symbianelf*.
	* configure: Regenerated.
	* config/tc-arm.c (elf32_arm_target_format): Use Symbian target
	vectors when appropriate.
	* config/te-symbian.h: New file.

2004-09-02  Mark Mitchell  <mark@codesourcery.com>

	* Makefile.am (ALL_EMULATIONS): Add earmsymbian.o.
	(earmsymbian.c): New target.
	* configure.tgt: Use armsymbian emulation for arm*-*-symbianelf*.
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* emulparams/armsymbian.sh: New file.

Index: bfd/config.bfd
===================================================================
RCS file: /cvs/src/src/bfd/config.bfd,v
retrieving revision 1.169
diff -c -5 -p -r1.169 config.bfd
*** bfd/config.bfd	19 Aug 2004 18:09:44 -0000	1.169
--- bfd/config.bfd	3 Sep 2004 17:07:46 -0000
*************** case "${targ}" in
*** 224,237 ****
      targ_defvec=bfd_elf32_littlearm_vec
      targ_selvecs=bfd_elf32_bigarm_vec
      ;;
    arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
    arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks | \
!   arm*-*-symbianelf* | arm*-*-eabi* )
      targ_defvec=bfd_elf32_littlearm_vec
      targ_selvecs=bfd_elf32_bigarm_vec
      ;;
    arm9e-*-elf)
      targ_defvec=bfd_elf32_littlearm_vec
      targ_selvecs=bfd_elf32_bigarm_vec
      ;;
    arm-*-oabi)
--- 224,241 ----
      targ_defvec=bfd_elf32_littlearm_vec
      targ_selvecs=bfd_elf32_bigarm_vec
      ;;
    arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
    arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks | \
!   arm*-*-eabi* )
      targ_defvec=bfd_elf32_littlearm_vec
      targ_selvecs=bfd_elf32_bigarm_vec
      ;;
+   arm*-*-symbianelf*)
+     targ_defvec=bfd_elf32_littlearm_symbian_vec
+     targ_selvecs=bfd_elf32_bigarm_symbian_vec
+     ;;
    arm9e-*-elf)
      targ_defvec=bfd_elf32_littlearm_vec
      targ_selvecs=bfd_elf32_bigarm_vec
      ;;
    arm-*-oabi)
Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.159
diff -c -5 -p -r1.159 configure.in
*** bfd/configure.in	30 Aug 2004 18:58:13 -0000	1.159
--- bfd/configure.in	3 Sep 2004 17:07:46 -0000
*************** do
*** 581,590 ****
--- 581,592 ----
      bfd_elf32_avr_vec)		tb="$tb elf32-avr.lo elf32.lo $elf" ;;
      bfd_elf32_big_generic_vec) 	tb="$tb elf32-gen.lo elf32.lo $elf" ;;
      bfd_elf32_bigarc_vec)	tb="$tb elf32-arc.lo elf32.lo $elf" ;;
      bfd_elf32_bigarm_oabi_vec)	tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
      bfd_elf32_bigarm_vec)	tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
+     bfd_elf32_bigarm_symbian_vec)	
+                                 tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
      bfd_elf32_bigmips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
      bfd_elf32_cr16c_vec)	tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
      bfd_elf32_cris_vec)		tb="$tb elf32-cris.lo elf32.lo $elf" ;;
      bfd_elf32_crx_vec)          tb="$tb elf32-crx.lo elf32.lo $elf" ;;    
      bfd_elf32_d10v_vec)		tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
*************** do
*** 608,617 ****
--- 610,621 ----
      bfd_elf32_ip2k_vec)		tb="$tb elf32-ip2k.lo elf32.lo $elf" ;;
      bfd_elf32_iq2000_vec)       tb="$tb elf32-iq2000.lo elf32.lo $elf" ;;
      bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
      bfd_elf32_littlearc_vec)	tb="$tb elf32-arc.lo elf32.lo $elf" ;;
      bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
+     bfd_elf32_littlearm_symbian_vec)
+                                 tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
      bfd_elf32_littlearm_vec)	tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
      bfd_elf32_littlemips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
      bfd_elf32_m32r_vec)		tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
      bfd_elf32_m32rle_vec)       tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
      bfd_elf32_m32rlin_vec)      tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
Index: bfd/elf-bfd.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-bfd.h,v
retrieving revision 1.154
diff -c -5 -p -r1.154 elf-bfd.h
*** bfd/elf-bfd.h	28 Aug 2004 03:05:17 -0000	1.154
--- bfd/elf-bfd.h	3 Sep 2004 17:07:46 -0000
*************** struct elf_backend_data
*** 536,545 ****
--- 536,548 ----
    int elf_machine_code;
  
    /* The maximum page size for this backend.  */
    bfd_vma maxpagesize;
  
+   /* The BFD flags applied to sections created for dynamic linking.  */
+   flagword dynamic_sec_flags;
+ 
    /* A function to translate an ELF RELA relocation to a BFD arelent
       structure.  */
    void (*elf_info_to_howto)
      (bfd *, arelent *, Elf_Internal_Rela *);
  
Index: bfd/elf32-arm.h
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.h,v
retrieving revision 1.137
diff -c -5 -p -r1.137 elf32-arm.h
*** bfd/elf32-arm.h	26 Aug 2004 16:18:37 -0000	1.137
--- bfd/elf32-arm.h	3 Sep 2004 17:07:46 -0000
*************** typedef unsigned short int insn16;
*** 44,115 ****
     section.  */
  #define ELF_DYNAMIC_INTERPRETER     "/usr/lib/ld.so.1"
  
  #ifdef FOUR_WORD_PLT
  
- /* The size in bytes of the special first entry in the procedure
-    linkage table.  */
- #define PLT_HEADER_SIZE 16
- 
- /* The size in bytes of an entry in the procedure linkage table.  */
- #define PLT_ENTRY_SIZE 16
- 
  /* The first entry in a procedure linkage table looks like
     this.  It is set up so that any shared library function that is
     called before the relocation has been set up calls the dynamic
     linker first.  */
! static const bfd_vma elf32_arm_plt0_entry [PLT_HEADER_SIZE / 4] =
    {
      0xe52de004,		/* str   lr, [sp, #-4]! */
      0xe59fe010,		/* ldr   lr, [pc, #16]  */
      0xe08fe00e,		/* add   lr, pc, lr     */
      0xe5bef008,		/* ldr   pc, [lr, #8]!  */
    };
  
  /* Subsequent entries in a procedure linkage table look like
     this.  */
! static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] =
    {
      0xe28fc600,		/* add   ip, pc, #NN	*/
      0xe28cca00,		/* add	 ip, ip, #NN	*/
      0xe5bcf000,		/* ldr	 pc, [ip, #NN]! */
      0x00000000,		/* unused		*/
    };
  
  #else
  
- /* The size in bytes of the special first entry in the procedure
-    linkage table.  */
- #define PLT_HEADER_SIZE 20
- 
- /* The size in bytes of an entry in the procedure linkage table.  */
- #define PLT_ENTRY_SIZE 12
- 
  /* The first entry in a procedure linkage table looks like
     this.  It is set up so that any shared library function that is
     called before the relocation has been set up calls the dynamic
     linker first.  */
! static const bfd_vma elf32_arm_plt0_entry [PLT_HEADER_SIZE / 4] =
    {
      0xe52de004,		/* str   lr, [sp, #-4]! */
      0xe59fe004,		/* ldr   lr, [pc, #4]   */
      0xe08fe00e,		/* add   lr, pc, lr     */
      0xe5bef008,		/* ldr   pc, [lr, #8]!  */
      0x00000000,		/* &GOT[0] - .          */
    };
  
  /* Subsequent entries in a procedure linkage table look like
     this.  */
! static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] =
    {
      0xe28fc600,		/* add   ip, pc, #0xNN00000 */
      0xe28cca00,		/* add	 ip, ip, #0xNN000   */
      0xe5bcf000,		/* ldr	 pc, [ip, #0xNNN]!  */
    };
  
  #endif
  
  /* Used to build a map of a section.  This is required for mixed-endian
     code/data.  */
  
  typedef struct elf32_elf_section_map
  {
--- 44,109 ----
     section.  */
  #define ELF_DYNAMIC_INTERPRETER     "/usr/lib/ld.so.1"
  
  #ifdef FOUR_WORD_PLT
  
  /* The first entry in a procedure linkage table looks like
     this.  It is set up so that any shared library function that is
     called before the relocation has been set up calls the dynamic
     linker first.  */
! static const bfd_vma elf32_arm_plt0_entry [] =
    {
      0xe52de004,		/* str   lr, [sp, #-4]! */
      0xe59fe010,		/* ldr   lr, [pc, #16]  */
      0xe08fe00e,		/* add   lr, pc, lr     */
      0xe5bef008,		/* ldr   pc, [lr, #8]!  */
    };
  
  /* Subsequent entries in a procedure linkage table look like
     this.  */
! static const bfd_vma elf32_arm_plt_entry [] =
    {
      0xe28fc600,		/* add   ip, pc, #NN	*/
      0xe28cca00,		/* add	 ip, ip, #NN	*/
      0xe5bcf000,		/* ldr	 pc, [ip, #NN]! */
      0x00000000,		/* unused		*/
    };
  
  #else
  
  /* The first entry in a procedure linkage table looks like
     this.  It is set up so that any shared library function that is
     called before the relocation has been set up calls the dynamic
     linker first.  */
! static const bfd_vma elf32_arm_plt0_entry [] =
    {
      0xe52de004,		/* str   lr, [sp, #-4]! */
      0xe59fe004,		/* ldr   lr, [pc, #4]   */
      0xe08fe00e,		/* add   lr, pc, lr     */
      0xe5bef008,		/* ldr   pc, [lr, #8]!  */
      0x00000000,		/* &GOT[0] - .          */
    };
  
  /* Subsequent entries in a procedure linkage table look like
     this.  */
! static const bfd_vma elf32_arm_plt_entry [] =
    {
      0xe28fc600,		/* add   ip, pc, #0xNN00000 */
      0xe28cca00,		/* add	 ip, ip, #0xNN000   */
      0xe5bcf000,		/* ldr	 pc, [ip, #0xNNN]!  */
    };
  
  #endif
  
+ /* The entries in a PLT when using a DLL-based target with multiple
+    address spaces.  */
+ static const bfd_vma elf32_arm_symbian_plt_entry [] = 
+   {
+     0xe51ff004,         /* ldr   pr, [pc, #-4] */
+     0x00000000,         /* dcd   R_ARM_GLOB_DAT(X) */
+   };
+ 
  /* Used to build a map of a section.  This is required for mixed-endian
     code/data.  */
  
  typedef struct elf32_elf_section_map
  {
*************** struct elf32_arm_link_hash_table
*** 186,195 ****
--- 180,198 ----
      int no_pipeline_knowledge;
  
      /* Nonzero to output a BE8 image.  */
      int byteswap_code;
  
+     /* The number of bytes in the initial entry in the PLT.  */
+     bfd_size_type plt_header_size;
+ 
+     /* The number of bytes in the subsequent PLT etries.  */
+     bfd_size_type plt_entry_size;
+ 
+     /* True if the target system is Symbian OS.  */
+     int symbian_p;
+ 
      /* Short-cuts to get to dynamic linker sections.  */
      asection *sgot;
      asection *sgotplt;
      asection *srelgot;
      asection *splt;
*************** elf32_arm_link_hash_newfunc (struct bfd_
*** 234,247 ****
  static bfd_boolean
  create_got_section (bfd *dynobj, struct bfd_link_info *info)
  {
    struct elf32_arm_link_hash_table *htab;
  
    if (! _bfd_elf_create_got_section (dynobj, info))
      return FALSE;
  
-   htab = elf32_arm_hash_table (info);
    htab->sgot = bfd_get_section_by_name (dynobj, ".got");
    htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
    if (!htab->sgot || !htab->sgotplt)
      abort ();
  
--- 237,254 ----
  static bfd_boolean
  create_got_section (bfd *dynobj, struct bfd_link_info *info)
  {
    struct elf32_arm_link_hash_table *htab;
  
+   htab = elf32_arm_hash_table (info);
+   /* BPABI objects never have a GOT, or associated sections.  */
+   if (htab->symbian_p)
+     return TRUE;
+ 
    if (! _bfd_elf_create_got_section (dynobj, info))
      return FALSE;
  
    htab->sgot = bfd_get_section_by_name (dynobj, ".got");
    htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
    if (!htab->sgot || !htab->sgotplt)
      abort ();
  
*************** elf32_arm_create_dynamic_sections (bfd *
*** 276,286 ****
    htab->srelplt = bfd_get_section_by_name (dynobj, ".rel.plt");
    htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss");
    if (!info->shared)
      htab->srelbss = bfd_get_section_by_name (dynobj, ".rel.bss");
  
!   if (!htab->splt || !htab->srelplt || !htab->sdynbss
        || (!info->shared && !htab->srelbss))
      abort ();
  
    return TRUE;
  }
--- 283,295 ----
    htab->srelplt = bfd_get_section_by_name (dynobj, ".rel.plt");
    htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss");
    if (!info->shared)
      htab->srelbss = bfd_get_section_by_name (dynobj, ".rel.bss");
  
!   if (!htab->splt 
!       || !htab->srelplt
!       || !htab->sdynbss
        || (!info->shared && !htab->srelbss))
      abort ();
  
    return TRUE;
  }
*************** elf32_arm_link_hash_table_create (bfd *a
*** 362,371 ****
--- 371,388 ----
    ret->thumb_glue_size = 0;
    ret->arm_glue_size = 0;
    ret->bfd_of_glue_owner = NULL;
    ret->no_pipeline_knowledge = 0;
    ret->byteswap_code = 0;
+ #ifdef FOUR_WORD_PLT
+   ret->plt_header_size = 16;
+   ret->plt_entry_size = 16;
+ #else
+   ret->plt_header_size = 20;
+   ret->plt_entry_size = 12;
+ #endif
+   ret->symbian_p = 0;
    ret->sym_sec.abfd = NULL;
  
    return &ret->root.root;
  }
  
*************** elf32_arm_check_relocs (bfd *abfd, struc
*** 2921,2931 ****
  		        flagword flags;
  
  		        sreloc = bfd_make_section (dynobj, name);
  		        flags = (SEC_HAS_CONTENTS | SEC_READONLY
  			         | SEC_IN_MEMORY | SEC_LINKER_CREATED);
! 		        if ((sec->flags & SEC_ALLOC) != 0)
  			  flags |= SEC_ALLOC | SEC_LOAD;
  		        if (sreloc == NULL
  			    || ! bfd_set_section_flags (dynobj, sreloc, flags)
  			    || ! bfd_set_section_alignment (dynobj, sreloc, 2))
  			  return FALSE;
--- 2938,2951 ----
  		        flagword flags;
  
  		        sreloc = bfd_make_section (dynobj, name);
  		        flags = (SEC_HAS_CONTENTS | SEC_READONLY
  			         | SEC_IN_MEMORY | SEC_LINKER_CREATED);
! 		        if ((sec->flags & SEC_ALLOC) != 0
! 			    /* BPABI objects never have dynamic
! 			       relocations mapped.  */
! 			    && !htab->symbian_p)
  			  flags |= SEC_ALLOC | SEC_LOAD;
  		        if (sreloc == NULL
  			    || ! bfd_set_section_flags (dynobj, sreloc, flags)
  			    || ! bfd_set_section_alignment (dynobj, sreloc, 2))
  			  return FALSE;
*************** allocate_dynrelocs (struct elf_link_hash
*** 3288,3298 ****
  	  asection *s = htab->splt;
  
  	  /* If this is the first .plt entry, make room for the special
  	     first entry.  */
  	  if (s->size == 0)
! 	    s->size += PLT_HEADER_SIZE;
  
  	  h->plt.offset = s->size;
  
  	  /* If this symbol is not defined in a regular file, and we are
  	     not generating a shared library, then set the symbol to this
--- 3308,3318 ----
  	  asection *s = htab->splt;
  
  	  /* If this is the first .plt entry, make room for the special
  	     first entry.  */
  	  if (s->size == 0)
! 	    s->size += htab->plt_header_size;
  
  	  h->plt.offset = s->size;
  
  	  /* If this symbol is not defined in a regular file, and we are
  	     not generating a shared library, then set the symbol to this
*************** allocate_dynrelocs (struct elf_link_hash
*** 3305,3319 ****
  	      h->root.u.def.section = s;
  	      h->root.u.def.value = h->plt.offset;
  	    }
  
  	  /* Make room for this entry.  */
! 	  s->size += PLT_ENTRY_SIZE;
  
! 	  /* We also need to make an entry in the .got.plt section, which
! 	     will be placed in the .got section by the linker script.  */
! 	  htab->sgotplt->size += 4;
  
  	  /* We also need to make an entry in the .rel.plt section.  */
  	  htab->srelplt->size += sizeof (Elf32_External_Rel);
  	}
        else
--- 3325,3340 ----
  	      h->root.u.def.section = s;
  	      h->root.u.def.value = h->plt.offset;
  	    }
  
  	  /* Make room for this entry.  */
! 	  s->size += htab->plt_entry_size;
  
! 	  if (!htab->symbian_p)
! 	    /* We also need to make an entry in the .got.plt section, which
! 	       will be placed in the .got section by the linker script.  */
! 	    htab->sgotplt->size += 4;
  
  	  /* We also need to make an entry in the .rel.plt section.  */
  	  htab->srelplt->size += sizeof (Elf32_External_Rel);
  	}
        else
*************** allocate_dynrelocs (struct elf_link_hash
*** 3340,3358 ****
  	{
  	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
  	    return FALSE;
  	}
  
!       s = htab->sgot;
!       h->got.offset = s->size;
!       s->size += 4;
!       dyn = htab->root.dynamic_sections_created;
!       if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
! 	   || h->root.type != bfd_link_hash_undefweak)
! 	  && (info->shared
! 	      || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
! 	htab->srelgot->size += sizeof (Elf32_External_Rel);
      }
    else
      h->got.offset = (bfd_vma) -1;
  
    eh = (struct elf32_arm_link_hash_entry *) h;
--- 3361,3382 ----
  	{
  	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
  	    return FALSE;
  	}
  
!       if (!htab->symbian_p)
! 	{
! 	  s = htab->sgot;
! 	  h->got.offset = s->size;
! 	  s->size += 4;
! 	  dyn = htab->root.dynamic_sections_created;
! 	  if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
! 	       || h->root.type != bfd_link_hash_undefweak)
! 	      && (info->shared
! 		  || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
! 	    htab->srelgot->size += sizeof (Elf32_External_Rel);
! 	}
      }
    else
      h->got.offset = (bfd_vma) -1;
  
    eh = (struct elf32_arm_link_hash_entry *) h;
*************** elf32_arm_size_dynamic_sections (bfd * o
*** 3642,3721 ****
  static bfd_boolean
  elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info,
  				 struct elf_link_hash_entry * h, Elf_Internal_Sym * sym)
  {
    bfd * dynobj;
  
    dynobj = elf_hash_table (info)->dynobj;
  
    if (h->plt.offset != (bfd_vma) -1)
      {
        asection * splt;
-       asection * sgot;
        asection * srel;
        bfd_vma plt_index;
-       bfd_vma got_offset;
        Elf_Internal_Rela rel;
-       bfd_byte *loc;
-       bfd_vma got_displacement;
  
        /* This symbol has an entry in the procedure linkage table.  Set
  	 it up.  */
  
        BFD_ASSERT (h->dynindx != -1);
  
        splt = bfd_get_section_by_name (dynobj, ".plt");
-       sgot = bfd_get_section_by_name (dynobj, ".got.plt");
        srel = bfd_get_section_by_name (dynobj, ".rel.plt");
!       BFD_ASSERT (splt != NULL && sgot != NULL && srel != NULL);
  
        /* Get the index in the procedure linkage table which
  	 corresponds to this symbol.  This is the index of this symbol
  	 in all the symbols for which we are making plt entries.  The
  	 first entry in the procedure linkage table is reserved.  */
!       plt_index = (h->plt.offset - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE;
  
!       /* Get the offset into the .got table of the entry that
! 	 corresponds to this function.  Each .got entry is 4 bytes.
! 	 The first three are reserved.  */
!       got_offset = (plt_index + 3) * 4;
! 
!       /* Calculate the displacement between the PLT slot and the
! 	 entry in the GOT.  */
!       got_displacement = (sgot->output_section->vma
! 			  + sgot->output_offset
! 			  + got_offset
! 			  - splt->output_section->vma
! 			  - splt->output_offset
! 			  - h->plt.offset
! 			  - 8);
  
!       BFD_ASSERT ((got_displacement & 0xf0000000) == 0);
  
!       /* Fill in the entry in the procedure linkage table.  */
!       bfd_put_32 (output_bfd, elf32_arm_plt_entry[0] | ((got_displacement & 0x0ff00000) >> 20),
! 		  splt->contents + h->plt.offset + 0);
!       bfd_put_32 (output_bfd, elf32_arm_plt_entry[1] | ((got_displacement & 0x000ff000) >> 12),
! 		  splt->contents + h->plt.offset + 4);
!       bfd_put_32 (output_bfd, elf32_arm_plt_entry[2] | (got_displacement & 0x00000fff),
! 		  splt->contents + h->plt.offset + 8);
  #ifdef FOUR_WORD_PLT
!       bfd_put_32 (output_bfd, elf32_arm_plt_entry[3],
! 		  splt->contents + h->plt.offset + 12);
  #endif
  
!       /* Fill in the entry in the global offset table.  */
!       bfd_put_32 (output_bfd,
! 		  (splt->output_section->vma
! 		   + splt->output_offset),
! 		  sgot->contents + got_offset);
  
-       /* Fill in the entry in the .rel.plt section.  */
-       rel.r_offset = (sgot->output_section->vma
- 		      + sgot->output_offset
- 		      + got_offset);
-       rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_JUMP_SLOT);
        loc = srel->contents + plt_index * sizeof (Elf32_External_Rel);
        bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
  
        if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
  	{
--- 3666,3768 ----
  static bfd_boolean
  elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info,
  				 struct elf_link_hash_entry * h, Elf_Internal_Sym * sym)
  {
    bfd * dynobj;
+   struct elf32_arm_link_hash_table *htab;
  
    dynobj = elf_hash_table (info)->dynobj;
+   htab = elf32_arm_hash_table (info);
  
    if (h->plt.offset != (bfd_vma) -1)
      {
        asection * splt;
        asection * srel;
+       bfd_byte *loc;
        bfd_vma plt_index;
        Elf_Internal_Rela rel;
  
        /* This symbol has an entry in the procedure linkage table.  Set
  	 it up.  */
  
        BFD_ASSERT (h->dynindx != -1);
  
        splt = bfd_get_section_by_name (dynobj, ".plt");
        srel = bfd_get_section_by_name (dynobj, ".rel.plt");
!       BFD_ASSERT (splt != NULL && srel != NULL);
  
        /* Get the index in the procedure linkage table which
  	 corresponds to this symbol.  This is the index of this symbol
  	 in all the symbols for which we are making plt entries.  The
  	 first entry in the procedure linkage table is reserved.  */
!       plt_index = ((h->plt.offset - htab->plt_header_size) 
! 		   / htab->plt_entry_size);
  
!       /* Fill in the entry in the procedure linkage table.  */
!       if (htab->symbian_p)
! 	{
! 	  unsigned i;
! 	  for (i = 0; i < htab->plt_entry_size / 4; ++i)
! 	    bfd_put_32 (output_bfd, 
! 			elf32_arm_symbian_plt_entry[i],
! 			splt->contents + h->plt.offset + 4 * i);
! 	  
! 	  /* Fill in the entry in the .rel.plt section.  */
! 	  rel.r_offset = (splt->output_offset
! 			  + h->plt.offset + 4 * (i - 1));
! 	  rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_GLOB_DAT);
! 	}
!       else
! 	{
! 	  bfd_vma got_offset;
! 	  bfd_vma got_displacement;
! 	  asection * sgot;
! 	  
! 	  sgot = bfd_get_section_by_name (dynobj, ".got.plt");
! 	  BFD_ASSERT (sgot != NULL);
! 
! 	  /* Get the offset into the .got table of the entry that
! 	     corresponds to this function.  Each .got entry is 4 bytes.
! 	     The first three are reserved.  */
! 	  got_offset = (plt_index + 3) * 4;
  
! 	  /* Calculate the displacement between the PLT slot and the
! 	     entry in the GOT.  */
! 	  got_displacement = (sgot->output_section->vma
! 			      + sgot->output_offset
! 			      + got_offset
! 			      - splt->output_section->vma
! 			      - splt->output_offset
! 			      - h->plt.offset
! 			      - 8);
  
! 	  BFD_ASSERT ((got_displacement & 0xf0000000) == 0);
! 
! 	  bfd_put_32 (output_bfd, elf32_arm_plt_entry[0] | ((got_displacement & 0x0ff00000) >> 20),
! 		      splt->contents + h->plt.offset + 0);
! 	  bfd_put_32 (output_bfd, elf32_arm_plt_entry[1] | ((got_displacement & 0x000ff000) >> 12),
! 		      splt->contents + h->plt.offset + 4);
! 	  bfd_put_32 (output_bfd, elf32_arm_plt_entry[2] | (got_displacement & 0x00000fff),
! 		      splt->contents + h->plt.offset + 8);
  #ifdef FOUR_WORD_PLT
! 	  bfd_put_32 (output_bfd, elf32_arm_plt_entry[3],
! 		      splt->contents + h->plt.offset + 12);
  #endif
  
! 	  /* Fill in the entry in the global offset table.  */
! 	  bfd_put_32 (output_bfd,
! 		      (splt->output_section->vma
! 		       + splt->output_offset),
! 		      sgot->contents + got_offset);
! 	  
! 	  /* Fill in the entry in the .rel.plt section.  */
! 	  rel.r_offset = (sgot->output_section->vma
! 			  + sgot->output_offset
! 			  + got_offset);
! 	  rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_JUMP_SLOT);
! 	}
  
        loc = srel->contents + plt_index * sizeof (Elf32_External_Rel);
        bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
  
        if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
  	{
*************** elf32_arm_finish_dynamic_sections (bfd *
*** 3902,3912 ****
  	      break;
  	    }
  	}
  
        /* Fill in the first entry in the procedure linkage table.  */
!       if (splt->size > 0)
  	{
  	  bfd_vma got_displacement;
  
  	  /* Calculate the displacement between the PLT slot and &GOT[0].  */
  	  got_displacement = (sgot->output_section->vma
--- 3949,3959 ----
  	      break;
  	    }
  	}
  
        /* Fill in the first entry in the procedure linkage table.  */
!       if (splt->size > 0 && elf32_arm_hash_table (info)->plt_header_size)
  	{
  	  bfd_vma got_displacement;
  
  	  /* Calculate the displacement between the PLT slot and &GOT[0].  */
  	  got_displacement = (sgot->output_section->vma
Index: bfd/elfarm-nabi.c
===================================================================
RCS file: /cvs/src/src/bfd/elfarm-nabi.c,v
retrieving revision 1.20
diff -c -5 -p -r1.20 elfarm-nabi.c
*** bfd/elfarm-nabi.c	6 Aug 2004 16:18:02 -0000	1.20
--- bfd/elfarm-nabi.c	3 Sep 2004 17:07:46 -0000
***************
*** 27,41 ****
  #define NUM_ELEM(a)  (sizeof (a) / (sizeof (a)[0]))
  #endif
  
  #define USE_REL	1
  
- #define TARGET_LITTLE_SYM               bfd_elf32_littlearm_vec
- #define TARGET_LITTLE_NAME              "elf32-littlearm"
- #define TARGET_BIG_SYM                  bfd_elf32_bigarm_vec
- #define TARGET_BIG_NAME                 "elf32-bigarm"
- 
  #define elf_info_to_howto               0
  #define elf_info_to_howto_rel           elf32_arm_info_to_howto
  
  #define ARM_ELF_ABI_VERSION		0
  #define ARM_ELF_OS_ABI_VERSION		ELFOSABI_ARM
--- 27,36 ----
*************** elf32_arm_nabi_grok_psinfo (abfd, note)
*** 872,880 ****
--- 867,974 ----
    }
  
    return TRUE;
  }
  
+ #define TARGET_LITTLE_SYM               bfd_elf32_littlearm_vec
+ #define TARGET_LITTLE_NAME              "elf32-littlearm"
+ #define TARGET_BIG_SYM                  bfd_elf32_bigarm_vec
+ #define TARGET_BIG_NAME                 "elf32-bigarm"
+ 
  #define elf_backend_grok_prstatus	elf32_arm_nabi_grok_prstatus
  #define elf_backend_grok_psinfo		elf32_arm_nabi_grok_psinfo
  
  #include "elf32-arm.h"
+ 
+ /* Symbian OS Targets */
+ 
+ #undef TARGET_LITTLE_SYM
+ #define TARGET_LITTLE_SYM               bfd_elf32_littlearm_symbian_vec
+ #undef TARGET_LITTLE_NAME
+ #define TARGET_LITTLE_NAME              "elf32-littlearm-symbian"
+ #undef TARGET_BIG_SYM
+ #define TARGET_BIG_SYM                  bfd_elf32_bigarm_symbian_vec
+ #undef TARGET_BIG_NAME
+ #define TARGET_BIG_NAME                 "elf32-bigarm-symbian"
+ 
+ /* Like elf32_arm_link_hash_table_create -- but overrides
+    appropriately for Symbian OS.  */
+ static struct bfd_link_hash_table *
+ elf32_arm_symbian_link_hash_table_create (bfd *abfd)
+ {
+   struct bfd_link_hash_table *ret;
+ 
+   ret = elf32_arm_link_hash_table_create (abfd);
+   if (ret)
+     {
+       struct elf32_arm_link_hash_table *htab
+ 	= (struct elf32_arm_link_hash_table *)ret;
+       /* There is no PLT header for Symbian OS.  */
+       htab->plt_header_size = 0;
+       /* The PLT entries are each three instructions.  */
+       htab->plt_entry_size = 4 * NUM_ELEM (elf32_arm_symbian_plt_entry);
+       htab->symbian_p = 1;
+     }
+   return ret;
+ }     
+ 
+ /* In a BPABI executable, the dynamic linking sections do not go in
+    the loadable read-only segment.  The post-linker may wish to refer
+    to these sections, but they are not part of the final program
+    image.  */
+ static struct bfd_elf_special_section const 
+   elf32_arm_symbian_special_sections[]=
+ {
+   { ".dynamic",        8,  0, SHT_DYNAMIC,  0 },
+   { ".dynstr",         7,  0, SHT_STRTAB,   0 },
+   { ".dynsym",         7,  0, SHT_DYNSYM,   0 },
+   { ".got",            4,  0, SHT_PROGBITS, 0 },
+   { ".hash",           5,  0, SHT_HASH,     0 },
+   { NULL,              0,  0, 0,            0 }
+ };
+ 
+ static bfd_boolean
+ elf32_arm_symbian_modify_segment_map
+   PARAMS ((bfd *, struct bfd_link_info *));
+ 
+ static bfd_boolean
+ elf32_arm_symbian_modify_segment_map (abfd, info)
+      bfd *abfd;
+      struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ {
+   struct elf_segment_map *m;
+ 
+   /* The first PT_LOAD segment will have the program headers and file
+      headers in it by default -- but BPABI object files should not
+      include these headers in any loadable segment.  */
+   for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
+     if (m->p_type == PT_LOAD)
+       {
+ 	m->includes_filehdr = 0;
+ 	m->includes_phdrs = 0;
+       }
+   return TRUE;
+ }
+ 
+ #undef elf32_bed
+ #define elf32_bed elf32_arm_symbian_bed
+ 
+ #undef ELF_DYNAMIC_SEC_FLAGS
+ #define ELF_DYNAMIC_SEC_FLAGS \
+   (SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED)
+ 
+ #undef bfd_elf32_bfd_link_hash_table_create
+ #define bfd_elf32_bfd_link_hash_table_create \
+   elf32_arm_symbian_link_hash_table_create
+ 
+ #undef elf_backend_special_sections
+ #define elf_backend_special_sections elf32_arm_symbian_special_sections
+ 
+ #undef elf_backend_modify_segment_map
+ #define elf_backend_modify_segment_map elf32_arm_symbian_modify_segment_map
+ 
+ /* There is no .got section for BPABI objects, and hence no header.  */
+ #undef elf_backend_got_header_size
+ #define elf_backend_got_header_size 0
+ 
+ #include "elf32-target.h"
+ 
Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.98
diff -c -5 -p -r1.98 elflink.c
*** bfd/elflink.c	21 Aug 2004 01:13:22 -0000	1.98
--- bfd/elflink.c	3 Sep 2004 17:07:46 -0000
*************** _bfd_elf_create_got_section (bfd *abfd, 
*** 55,66 ****
      default:
        bfd_set_error (bfd_error_bad_value);
        return FALSE;
      }
  
!   flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
! 	   | SEC_LINKER_CREATED);
  
    s = bfd_make_section (abfd, ".got");
    if (s == NULL
        || !bfd_set_section_flags (abfd, s, flags)
        || !bfd_set_section_alignment (abfd, s, ptralign))
--- 55,65 ----
      default:
        bfd_set_error (bfd_error_bad_value);
        return FALSE;
      }
  
!   flags = bed->dynamic_sec_flags;
  
    s = bfd_make_section (abfd, ".got");
    if (s == NULL
        || !bfd_set_section_flags (abfd, s, flags)
        || !bfd_set_section_alignment (abfd, s, ptralign))
*************** _bfd_elf_link_create_dynamic_sections (b
*** 129,142 ****
    if (elf_hash_table (info)->dynobj == NULL)
      elf_hash_table (info)->dynobj = abfd;
    else
      abfd = elf_hash_table (info)->dynobj;
  
!   /* Note that we set the SEC_IN_MEMORY flag for all of these
!      sections.  */
!   flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
! 	   | SEC_IN_MEMORY | SEC_LINKER_CREATED);
  
    /* A dynamically linked executable has a .interp section, but a
       shared library does not.  */
    if (info->executable)
      {
--- 128,140 ----
    if (elf_hash_table (info)->dynobj == NULL)
      elf_hash_table (info)->dynobj = abfd;
    else
      abfd = elf_hash_table (info)->dynobj;
  
!   bed = get_elf_backend_data (abfd);
! 
!   flags = bed->dynamic_sec_flags;
  
    /* A dynamically linked executable has a .interp section, but a
       shared library does not.  */
    if (info->executable)
      {
*************** _bfd_elf_link_create_dynamic_sections (b
*** 154,165 ****
  	  || ! bfd_set_section_alignment (abfd, s, 2))
  	return FALSE;
        elf_hash_table (info)->eh_info.hdr_sec = s;
      }
  
-   bed = get_elf_backend_data (abfd);
- 
    /* Create sections to hold version informations.  These are removed
       if they are not needed.  */
    s = bfd_make_section (abfd, ".gnu.version_d");
    if (s == NULL
        || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
--- 152,161 ----
*************** _bfd_elf_create_dynamic_sections (bfd *a
*** 251,263 ****
    asection *s;
    const struct elf_backend_data *bed = get_elf_backend_data (abfd);
  
    /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
       .rel[a].bss sections.  */
! 
!   flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
! 	   | SEC_LINKER_CREATED);
  
    pltflags = flags;
    pltflags |= SEC_CODE;
    if (bed->plt_not_loaded)
      pltflags &= ~ (SEC_CODE | SEC_LOAD | SEC_HAS_CONTENTS);
--- 247,257 ----
    asection *s;
    const struct elf_backend_data *bed = get_elf_backend_data (abfd);
  
    /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
       .rel[a].bss sections.  */
!   flags = bed->dynamic_sec_flags;
  
    pltflags = flags;
    pltflags |= SEC_CODE;
    if (bed->plt_not_loaded)
      pltflags &= ~ (SEC_CODE | SEC_LOAD | SEC_HAS_CONTENTS);
Index: bfd/elfxx-target.h
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-target.h,v
retrieving revision 1.71
diff -c -5 -p -r1.71 elfxx-target.h
*** bfd/elfxx-target.h	17 Aug 2004 09:07:35 -0000	1.71
--- bfd/elfxx-target.h	3 Sep 2004 17:07:46 -0000
***************
*** 277,286 ****
--- 277,293 ----
  #ifndef ELF_MAXPAGESIZE
    #error ELF_MAXPAGESIZE is not defined
  #define ELF_MAXPAGESIZE 1
  #endif
  
+ #ifndef ELF_DYNAMIC_SEC_FLAGS
+ /* Note that we set the SEC_IN_MEMORY flag for these sections.  */
+ #define ELF_DYNAMIC_SEC_FLAGS			\
+   (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS	\
+    | SEC_IN_MEMORY | SEC_LINKER_CREATED)
+ #endif
+ 
  #ifndef elf_backend_collect
  #define elf_backend_collect FALSE
  #endif
  #ifndef elf_backend_type_change_ok
  #define elf_backend_type_change_ok FALSE
*************** extern const struct elf_size_info _bfd_e
*** 506,515 ****
--- 513,523 ----
  static const struct elf_backend_data elfNN_bed =
  {
    ELF_ARCH,			/* arch */
    ELF_MACHINE_CODE,		/* elf_machine_code */
    ELF_MAXPAGESIZE,		/* maxpagesize */
+   ELF_DYNAMIC_SEC_FLAGS,        /* dynamic_sec_flags */
    elf_info_to_howto,
    elf_info_to_howto_rel,
    elf_backend_sym_is_global,
    elf_backend_object_p,
    elf_backend_symbol_processing,
Index: bfd/targets.c
===================================================================
RCS file: /cvs/src/src/bfd/targets.c,v
retrieving revision 1.116
diff -c -5 -p -r1.116 targets.c
*** bfd/targets.c	28 Aug 2004 03:05:18 -0000	1.116
--- bfd/targets.c	3 Sep 2004 17:07:46 -0000
*************** extern const bfd_target bfd_efi_app_ia64
*** 533,542 ****
--- 533,543 ----
  extern const bfd_target bfd_elf32_avr_vec;
  extern const bfd_target bfd_elf32_big_generic_vec;
  extern const bfd_target bfd_elf32_bigarc_vec;
  extern const bfd_target bfd_elf32_bigarm_oabi_vec;
  extern const bfd_target bfd_elf32_bigarm_vec;
+ extern const bfd_target bfd_elf32_bigarm_symbian_vec;
  extern const bfd_target bfd_elf32_bigmips_vec;
  extern const bfd_target bfd_elf32_cr16c_vec;
  extern const bfd_target bfd_elf32_cris_vec;
  extern const bfd_target bfd_elf32_crx_vec;
  extern const bfd_target bfd_elf32_d10v_vec;
*************** extern const bfd_target bfd_elf32_ip2k_v
*** 561,570 ****
--- 562,572 ----
  extern const bfd_target bfd_elf32_iq2000_vec;
  extern const bfd_target bfd_elf32_little_generic_vec;
  extern const bfd_target bfd_elf32_littlearc_vec;
  extern const bfd_target bfd_elf32_littlearm_oabi_vec;
  extern const bfd_target bfd_elf32_littlearm_vec;
+ extern const bfd_target bfd_elf32_littlearm_symbian_vec;
  extern const bfd_target bfd_elf32_littlemips_vec;
  extern const bfd_target bfd_elf32_m32r_vec;
  extern const bfd_target bfd_elf32_m32rle_vec;
  extern const bfd_target bfd_elf32_m32rlin_vec;
  extern const bfd_target bfd_elf32_m32rlelin_vec;
*************** static const bfd_target * const _bfd_tar
*** 829,838 ****
--- 831,841 ----
  	   the file even if we don't recognize the machine type.  */
  	&bfd_elf32_big_generic_vec,
  	&bfd_elf32_bigarc_vec,
  	&bfd_elf32_bigarm_oabi_vec,
  	&bfd_elf32_bigarm_vec,
+ 	&bfd_elf32_bigarm_symbian_vec,
  	&bfd_elf32_bigmips_vec,
  	&bfd_elf32_cr16c_vec,
  	&bfd_elf32_cris_vec,
  	&bfd_elf32_crx_vec,
  	&bfd_elf32_d10v_vec,
*************** static const bfd_target * const _bfd_tar
*** 859,868 ****
--- 862,872 ----
  	&bfd_elf32_iq2000_vec,
  	&bfd_elf32_little_generic_vec,
  	&bfd_elf32_littlearc_vec,
  	&bfd_elf32_littlearm_oabi_vec,
  	&bfd_elf32_littlearm_vec,
+ 	&bfd_elf32_littlearm_symbian_vec,
  	&bfd_elf32_littlemips_vec,
  	&bfd_elf32_m32r_vec,
          &bfd_elf32_m32rle_vec,
          &bfd_elf32_m32rlin_vec,
          &bfd_elf32_m32rlelin_vec,
Index: gas/Makefile.am
===================================================================
RCS file: /cvs/src/src/gas/Makefile.am,v
retrieving revision 1.92
diff -c -5 -p -r1.92 Makefile.am
*** gas/Makefile.am	16 Jul 2004 22:12:25 -0000	1.92
--- gas/Makefile.am	3 Sep 2004 17:07:46 -0000
*************** TARG_ENV_HFILES = \
*** 400,409 ****
--- 400,410 ----
  	config/te-psos.h \
  	config/te-riscix.h \
  	config/te-sparcaout.h \
  	config/te-sun3.h \
  	config/te-svr4.h \
+ 	config/te-symbian.h \
  	config/te-sysv32.h \
  	config/te-tmips.h
  
  # Multi files in config
  
Index: gas/configure.in
===================================================================
RCS file: /cvs/src/src/gas/configure.in,v
retrieving revision 1.160
diff -c -5 -p -r1.160 configure.in
*** gas/configure.in	19 Aug 2004 18:11:00 -0000	1.160
--- gas/configure.in	3 Sep 2004 17:07:46 -0000
*************** changequote([,])dnl
*** 204,215 ****
  
        arm-*-aout)			fmt=aout ;;
        arm-*-coff | thumb-*-coff)	fmt=coff ;;
        arm-*-rtems* | thumb-*-rtems*)	fmt=elf ;;
        arm-*-elf | thumb-*-elf)		fmt=elf ;;
!       arm*-*-symbianelf* | arm*-*-eabi*) 
!                                         fmt=elf ;;
        arm-*-kaos*)			fmt=elf ;;
        arm*-*-conix*)			fmt=elf ;;
        arm-*-linux*aout*)		fmt=aout em=linux ;;
        arm*-*-linux-gnu*)		fmt=elf  em=linux ;;
        arm*-*-uclinux*)			fmt=elf  em=linux ;;
--- 204,215 ----
  
        arm-*-aout)			fmt=aout ;;
        arm-*-coff | thumb-*-coff)	fmt=coff ;;
        arm-*-rtems* | thumb-*-rtems*)	fmt=elf ;;
        arm-*-elf | thumb-*-elf)		fmt=elf ;;
!       arm*-*-eabi*)                     fmt=elf ;;
!       arm*-*-symbianelf*)               fmt=elf em=symbian ;;
        arm-*-kaos*)			fmt=elf ;;
        arm*-*-conix*)			fmt=elf ;;
        arm-*-linux*aout*)		fmt=aout em=linux ;;
        arm*-*-linux-gnu*)		fmt=elf  em=linux ;;
        arm*-*-uclinux*)			fmt=elf  em=linux ;;
Index: gas/config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.174
diff -c -5 -p -r1.174 tc-arm.c
*** gas/config/tc-arm.c	1 Sep 2004 16:19:36 -0000	1.174
--- gas/config/tc-arm.c	3 Sep 2004 17:07:47 -0000
*************** arm_fix_adjustable (fixP)
*** 14097,14106 ****
--- 14097,14111 ----
  }
  
  const char *
  elf32_arm_target_format ()
  {
+ #ifdef TE_SYMBIAN
+   return (target_big_endian
+ 	  ? "elf32-bigarm-symbian"
+ 	  : "elf32-littlearm-symbian");
+ #else 
    if (target_big_endian)
      {
        if (target_oabi)
  	return "elf32-bigarm-oabi";
        else
*************** elf32_arm_target_format ()
*** 14111,14120 ****
--- 14116,14126 ----
        if (target_oabi)
  	return "elf32-littlearm-oabi";
        else
  	return "elf32-littlearm";
      }
+ #endif
  }
  
  void
  armelf_frob_symbol (symp, puntp)
       symbolS * symp;
Index: gas/config/te-symbian.h
===================================================================
RCS file: gas/config/te-symbian.h
diff -N gas/config/te-symbian.h
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gas/config/te-symbian.h	3 Sep 2004 17:07:47 -0000
***************
*** 0 ****
--- 1,3 ----
+ #define TE_SYMBIAN 1
+ #include "obj-elf.h"
+ 
Index: ld/Makefile.am
===================================================================
RCS file: /cvs/src/src/ld/Makefile.am,v
retrieving revision 1.157
diff -c -5 -p -r1.157 Makefile.am
*** ld/Makefile.am	26 Jul 2004 12:29:02 -0000	1.157
--- ld/Makefile.am	3 Sep 2004 17:07:47 -0000
*************** ALL_EMULATIONS = \
*** 126,135 ****
--- 126,136 ----
  	earmelfb_nbsd.o \
  	earmelf_oabi.o \
  	earmnto.o \
  	earmnbsd.o \
  	earmpe.o \
+ 	earmsymbian.o \
  	eavr2.o \
  	eavr1.o \
  	eavr3.o \
  	eavr4.o \
  	eavr5.o \
*************** earm_epoc_pe.c: $(srcdir)/emulparams/arm
*** 534,543 ****
--- 535,549 ----
    $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/epocpe.sc ${GEN_DEPENDS}
  	${GENSCRIPTS} arm_epoc_pe "$(tdir_armpe)"
  earmpe.c: $(srcdir)/emulparams/armpe.sh \
    $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
  	${GENSCRIPTS} armpe "$(tdir_armpe)"
+ earmsymbian.c: $(srcdir)/emulparams/armsymbian.sh \
+   $(srcdir)/emulparams/armelf.sh $(srcdir)/emultempl/elf32.em \
+   $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc \
+   ${GEN_DEPENDS}
+ 	${GENSCRIPTS} armsymbian "$(tdir_armelf)"
  eavr2.c: $(srcdir)/emulparams/avr2.sh \
    $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
    ${GEN_DEPENDS}
  	${GENSCRIPTS} avr2 "$(tdir_avr2)"
  eavr1.c: $(srcdir)/emulparams/avr1.sh \
Index: ld/aclocal.m4
===================================================================
RCS file: /cvs/src/src/ld/aclocal.m4,v
retrieving revision 1.8
diff -c -5 -p -r1.8 aclocal.m4
*** ld/aclocal.m4	16 Dec 2002 18:02:13 -0000	1.8
--- ld/aclocal.m4	3 Sep 2004 17:07:47 -0000
***************
*** 1,6 ****
! dnl aclocal.m4 generated automatically by aclocal 1.4-p5
  
  dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
  dnl with or without modifications, as long as this notice is preserved.
--- 1,6 ----
! dnl aclocal.m4 generated automatically by aclocal 1.4-p6
  
  dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
  dnl with or without modifications, as long as this notice is preserved.
*************** dnl sinclude(../gettext.m4) already incl
*** 25,35 ****
  ifelse(yes,no,[
  AC_DEFUN([CY_WITH_NLS],)
  AC_SUBST(INTLLIBS)
  ])
  
! #serial 1
  # This test replaces the one in autoconf.
  # Currently this macro should have the same name as the autoconf macro
  # because gettext's gettext.m4 (distributed in the automake package)
  # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
  # give these diagnostics:
--- 25,44 ----
  ifelse(yes,no,[
  AC_DEFUN([CY_WITH_NLS],)
  AC_SUBST(INTLLIBS)
  ])
  
! # isc-posix.m4 serial 2 (gettext-0.11.2)
! dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
! dnl This file is free software, distributed under the terms of the GNU
! dnl General Public License.  As a special exception to the GNU General
! dnl Public License, this file may be distributed as part of a program
! dnl that contains a configuration script generated by Autoconf, under
! dnl the same distribution terms as the rest of that program.
! 
! # This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
! 
  # This test replaces the one in autoconf.
  # Currently this macro should have the same name as the autoconf macro
  # because gettext's gettext.m4 (distributed in the automake package)
  # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
  # give these diagnostics:
*************** AC_DEFUN([AC_ISC_POSIX],
*** 53,63 ****
  
  dnl Usage:
  dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  
  AC_DEFUN([AM_INIT_AUTOMAKE],
! [AC_REQUIRE([AC_PROG_INSTALL])
  PACKAGE=[$1]
  AC_SUBST(PACKAGE)
  VERSION=[$2]
  AC_SUBST(VERSION)
  dnl test to see if srcdir already configured
--- 62,73 ----
  
  dnl Usage:
  dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  
  AC_DEFUN([AM_INIT_AUTOMAKE],
! [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
! AC_REQUIRE([AC_PROG_INSTALL])
  PACKAGE=[$1]
  AC_SUBST(PACKAGE)
  VERSION=[$2]
  AC_SUBST(VERSION)
  dnl test to see if srcdir already configured
*************** AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", 
*** 69,85 ****
  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
  AC_REQUIRE([AM_SANITY_CHECK])
  AC_REQUIRE([AC_ARG_PROGRAM])
  dnl FIXME This is truly gross.
  missing_dir=`cd $ac_aux_dir && pwd`
! AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
! AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  AC_REQUIRE([AC_PROG_MAKE_SET])])
  
  #
  # Check to make sure that the build environment is sane.
  #
  
  AC_DEFUN([AM_SANITY_CHECK],
--- 79,124 ----
  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
  AC_REQUIRE([AM_SANITY_CHECK])
  AC_REQUIRE([AC_ARG_PROGRAM])
  dnl FIXME This is truly gross.
  missing_dir=`cd $ac_aux_dir && pwd`
! AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
  AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
! AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
  AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  AC_REQUIRE([AC_PROG_MAKE_SET])])
  
+ # Copyright 2002  Free Software Foundation, Inc.
+ 
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2, or (at your option)
+ # any later version.
+ 
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU General Public License for more details.
+ 
+ # You should have received a copy of the GNU General Public License
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 
+ # AM_AUTOMAKE_VERSION(VERSION)
+ # ----------------------------
+ # Automake X.Y traces this macro to ensure aclocal.m4 has been
+ # generated from the m4 files accompanying Automake X.Y.
+ AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
+ 
+ # AM_SET_CURRENT_AUTOMAKE_VERSION
+ # -------------------------------
+ # Call AM_AUTOMAKE_VERSION so it can be traced.
+ # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+ AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ 	 [AM_AUTOMAKE_VERSION([1.4-p6])])
+ 
  #
  # Check to make sure that the build environment is sane.
  #
  
  AC_DEFUN([AM_SANITY_CHECK],
Index: ld/configure.tgt
===================================================================
RCS file: /cvs/src/src/ld/configure.tgt,v
retrieving revision 1.154
diff -c -5 -p -r1.154 configure.tgt
*** ld/configure.tgt	19 Aug 2004 18:11:42 -0000	1.154
--- ld/configure.tgt	3 Sep 2004 17:07:47 -0000
*************** arm-*-netbsd*)		targ_emul=armnbsd;
*** 253,264 ****
  			targ_extra_emuls="armelf armelf_nbsd armelfb_nbsd"  ;;
  arm-*-nto*)		targ_emul=armnto ;;
  arm-*-openbsd*)		targ_emul=armnbsd ;;
  arm-*-rtems*)		targ_emul=armelf ;;
  armeb-*-elf)		targ_emul=armelfb ;;
! arm-*-elf | arm-*-vxworks | arm*-*-symbianelf* | arm*-*-eabi*)
  	  		targ_emul=armelf ;;
  arm-*-kaos*)		targ_emul=armelf ;;
  arm9e-*-elf)		targ_emul=armelf ;;
  arm-*-oabi)		targ_emul=armelf_oabi ;;
  arm*b-*-linux-gnu*)	targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
  arm*-*-linux-gnu*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
--- 253,265 ----
  			targ_extra_emuls="armelf armelf_nbsd armelfb_nbsd"  ;;
  arm-*-nto*)		targ_emul=armnto ;;
  arm-*-openbsd*)		targ_emul=armnbsd ;;
  arm-*-rtems*)		targ_emul=armelf ;;
  armeb-*-elf)		targ_emul=armelfb ;;
! arm-*-elf | arm-*-vxworks | arm*-*-eabi*)
  	  		targ_emul=armelf ;;
+ arm*-*-symbianelf*)     targ_emul=armsymbian;;
  arm-*-kaos*)		targ_emul=armelf ;;
  arm9e-*-elf)		targ_emul=armelf ;;
  arm-*-oabi)		targ_emul=armelf_oabi ;;
  arm*b-*-linux-gnu*)	targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
  arm*-*-linux-gnu*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
Index: ld/emulparams/armsymbian.sh
===================================================================
RCS file: ld/emulparams/armsymbian.sh
diff -N ld/emulparams/armsymbian.sh
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- ld/emulparams/armsymbian.sh	3 Sep 2004 17:07:47 -0000
***************
*** 0 ****
--- 1,9 ----
+ . ${srcdir}/emulparams/armelf.sh
+ OUTPUT_FORMAT="elf32-littlearm-symbian"
+ BIG_OUTPUT_FORMAT="elf32-bigarm-symbian"
+ LITTLE_OUTPUT_FORMAT="$OUTPUT_FORMAT"
+ 
+ # This value should match ELF_MAXPAGESIZE in BFD.  Otherwise, elf.c
+ # will not place read-write sections in a separate ELF segment from
+ # the read-only sections.
+ MAXPAGESIZE=0x8000

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