* PATCH: Do not mark .*_array writable on SymbianOS
@ 2005-01-26 19:05 Mark Mitchell
2005-01-31 11:24 ` Nick Clifton
0 siblings, 1 reply; 2+ messages in thread
From: Mark Mitchell @ 2005-01-26 19:05 UTC (permalink / raw)
To: binutils
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,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: Do not mark .*_array writable on SymbianOS
2005-01-26 19:05 PATCH: Do not mark .*_array writable on SymbianOS Mark Mitchell
@ 2005-01-31 11:24 ` Nick Clifton
0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2005-01-31 11:24 UTC (permalink / raw)
To: mark; +Cc: binutils
Hi Mark,
> 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.
Approved - please apply.
Cheers
Nick
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-01-31 11:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-26 19:05 PATCH: Do not mark .*_array writable on SymbianOS Mark Mitchell
2005-01-31 11:24 ` Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).