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]

PATCH: Symbian OS linker scripts


This patch adds (the beginnings of) ARM Symbian OS support to ld.

Symbian OS uses the new ARM BPABI, which allows one to encode PE/COFF
style DLLs in ELF.  There are a bunch of things that should not be
created and/or marked loadable in that situation, including the ELF
program headers, GOTs, etc.  The idea is that the static linker will
emit a bunch of dynamic relocations.  Then, a target-specific
post-linker will come along and transmogrify the ELF output into the
DLL format.

As of yet, we're not emitting enough dynamic relocations I don't think
-- but this patch does get us most of the way with respect to not
creating a GOT, relocations against the PLT, etc.

OK?

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2004-09-01  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_multiple_address_space_dll_plt_entry): New
	variable.
	(elf32_arm_link_hash_table): Add plt_header_size, plt_entry_size,
	and multiple_address_space_dll_p.
	(create_got_section): Don't create sections when generating BPABI
	objects.
	(elf32_arm_create_dynamic_sections): Don't create .rel.plt section
	when generating BPABI objects.
	(elf32_arm_link_hash_table_create): Set plt_header_size,
	plt_entry_size, and multiple_address_space_dll_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 or .rel.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-01  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-01  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	2 Sep 2004 03:11:34 -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.158
diff -c -5 -p -r1.158 configure.in
*** bfd/configure.in	27 Jul 2004 22:30:23 -0000	1.158
--- bfd/configure.in	2 Sep 2004 03:11:34 -0000
*************** do
*** 584,593 ****
--- 584,595 ----
      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
*** 611,620 ****
--- 613,624 ----
      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.153
diff -c -5 -p -r1.153 elf-bfd.h
*** bfd/elf-bfd.h	9 Aug 2004 06:02:02 -0000	1.153
--- bfd/elf-bfd.h	2 Sep 2004 03:11:34 -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.136
diff -c -5 -p -r1.136 elf32-arm.h
*** bfd/elf32-arm.h	17 Aug 2004 08:12:26 -0000	1.136
--- bfd/elf32-arm.h	2 Sep 2004 03:11:34 -0000
*************** typedef unsigned short int insn16;
*** 42,113 ****
     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
  {
--- 42,108 ----
     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_multiple_address_space_dll_plt_entry [] = 
+   {
+     0xe59fc000,         /* ldr   ip, [pc, #0] */
+     0xe59cf000,         /* ldr   pc, [ip] */
+     0x00000000,         /* dcd   R_ARM_GOTSLOT32(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
*** 184,193 ****
--- 179,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 is a multiple-address space DLL-based
+        operating system, like Symbian OS.  */
+     int multiple_address_space_dll_p;
+ 
      /* Short-cuts to get to dynamic linker sections.  */
      asection *sgot;
      asection *sgotplt;
      asection *srelgot;
      asection *splt;
*************** elf32_arm_link_hash_newfunc (struct bfd_
*** 232,245 ****
  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->multiple_address_space_dll_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 *
*** 269,284 ****
  
    if (!_bfd_elf_create_dynamic_sections (dynobj, info))
      return FALSE;
  
    htab->splt = bfd_get_section_by_name (dynobj, ".plt");
!   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;
  }
--- 278,300 ----
  
    if (!_bfd_elf_create_dynamic_sections (dynobj, info))
      return FALSE;
  
    htab->splt = bfd_get_section_by_name (dynobj, ".plt");
!   if (!htab->multiple_address_space_dll_p)
!     {
!       htab->srelplt = bfd_get_section_by_name (dynobj, ".rel.plt");
!       if (!htab->srelplt)
! 	abort ();
!     }
    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->multiple_address_space_dll_p && !htab->srelplt)
!       || !htab->sdynbss
        || (!info->shared && !htab->srelbss))
      abort ();
  
    return TRUE;
  }
*************** elf32_arm_link_hash_table_create (bfd *a
*** 360,369 ****
--- 376,393 ----
    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->multiple_address_space_dll_p = 0;
    ret->sym_sec.abfd = NULL;
  
    return &ret->root.root;
  }
  
*************** elf32_arm_check_relocs (bfd *abfd, struc
*** 2919,2929 ****
  		        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;
--- 2943,2956 ----
  		        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->multiple_address_space_dll_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
*** 3286,3296 ****
  	  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
--- 3313,3323 ----
  	  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
*** 3303,3320 ****
  	      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
  	{
  	  h->plt.offset = (bfd_vma) -1;
  	  h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
--- 3330,3349 ----
  	      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->multiple_address_space_dll_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
  	{
  	  h->plt.offset = (bfd_vma) -1;
  	  h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
*************** allocate_dynrelocs (struct elf_link_hash
*** 3338,3356 ****
  	{
  	  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;
--- 3367,3388 ----
  	{
  	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
  	    return FALSE;
  	}
  
!       if (!htab->multiple_address_space_dll_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
*** 3640,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)
  	{
  	  /* Mark the symbol as undefined, rather than as defined in
  	     the .plt section.  Leave the value alone.  */
--- 3672,3770 ----
  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;
        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");
!       BFD_ASSERT (splt != NULL);
  
        /* Fill in the entry in the procedure linkage table.  */
!       if (htab->multiple_address_space_dll_p)
! 	{
! 	  unsigned i;
! 	  for (i = 0; i < htab->plt_entry_size / 4; ++i)
! 	    bfd_put_32 (output_bfd, 
! 			elf32_arm_multiple_address_space_dll_plt_entry[i],
! 			splt->contents + h->plt.offset + 4 * i);
! 	}
!       else
! 	{
! 	  bfd_vma plt_index;
! 	  bfd_vma got_offset;
! 	  Elf_Internal_Rela rel;
! 	  asection * sgot;
! 	  asection * srel;
! 	  
! 	  sgot = bfd_get_section_by_name (dynobj, ".got.plt");
! 	  srel = bfd_get_section_by_name (dynobj, ".rel.plt");
! 	  BFD_ASSERT (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 - htab->plt_header_size) 
! 		       / htab->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);
! 
! 	  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)
  	{
  	  /* Mark the symbol as undefined, rather than as defined in
  	     the .plt section.  Leave the value alone.  */
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	2 Sep 2004 03:11:34 -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 = 12;
+       htab->multiple_address_space_dll_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.97
diff -c -5 -p -r1.97 elflink.c
*** bfd/elflink.c	18 Aug 2004 02:45:42 -0000	1.97
--- bfd/elflink.c	2 Sep 2004 03:11:34 -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	2 Sep 2004 03:11:34 -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.115
diff -c -5 -p -r1.115 targets.c
*** bfd/targets.c	27 Jul 2004 22:30:24 -0000	1.115
--- bfd/targets.c	2 Sep 2004 03:11:34 -0000
*************** extern const bfd_target bfd_efi_app_ia64
*** 532,541 ****
--- 532,542 ----
  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
*** 560,569 ****
--- 561,571 ----
  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
*** 828,837 ****
--- 830,840 ----
  	   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
*** 858,867 ****
--- 861,871 ----
  	&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	2 Sep 2004 03:11:35 -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	2 Sep 2004 03:11:35 -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.172
diff -c -5 -p -r1.172 tc-arm.c
*** gas/config/tc-arm.c	17 Aug 2004 12:19:56 -0000	1.172
--- gas/config/tc-arm.c	2 Sep 2004 03:11:35 -0000
*************** arm_fix_adjustable (fixP)
*** 14091,14100 ****
--- 14091,14105 ----
  }
  
  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 ()
*** 14105,14114 ****
--- 14111,14121 ----
        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	2 Sep 2004 03:11:35 -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	2 Sep 2004 03:11:36 -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/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	2 Sep 2004 03:11:37 -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	2 Sep 2004 03:11:37 -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]