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: Do not mark .*_array writable on SymbianOS


As mentioned in a previous posting, .init_array and such should not be
writable on SymbianOS.  I fixed the linker script -- but I also need
to fix the assembler not to mark the sections writable.

OK?

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

2005-01-25  Mark Mitchell  <mark@codesourcery.com>

	* elf32-arm.c (elf32_arm_symbian_special_sections): Do not set
	SHF_WRITE for .init_array, .fini_array, and .preinit_array.
	
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.17
diff -c -5 -p -r1.17 elf32-arm.c
*** bfd/elf32-arm.c	26 Jan 2005 06:10:43 -0000	1.17
--- bfd/elf32-arm.c	26 Jan 2005 18:42:09 -0000
*************** elf32_arm_symbian_link_hash_table_create
*** 5825,5846 ****
        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 void
  elf32_arm_symbian_begin_write_processing (bfd *abfd, 
--- 5825,5852 ----
        htab->symbian_p = 1;
      }
    return ret;
  }     
  
  static struct bfd_elf_special_section const 
    elf32_arm_symbian_special_sections[]=
  {
+   /* 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.  */
    { ".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 },
+   /* These sections do not need to be writable as the SymbianOS
+      postlinker will arrange things so that no dynamic relocation is
+      required.  */
+   { ".init_array",    11,  0, SHT_INIT_ARRAY, SHF_ALLOC },
+   { ".fini_array",    11,  0, SHT_FINI_ARRAY, SHF_ALLOC },
+   { ".preinit_array", 14,  0, SHT_PREINIT_ARRAY, SHF_ALLOC },
    { NULL,              0,  0, 0,            0 }
  };
  
  static void
  elf32_arm_symbian_begin_write_processing (bfd *abfd, 


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