This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: Do not mark .*_array writable on SymbianOS
- From: Mark Mitchell <mark at codesourcery dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 26 Jan 2005 11:05:06 -0800
- Subject: PATCH: Do not mark .*_array writable on SymbianOS
- Reply-to: mark at codesourcery dot com
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,