From dc4c9c199b288656a976b6262d56b92b993f51a8 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Wed, 26 Jan 2005 06:10:45 +0000 Subject: [PATCH] * elf32-arm.c (elf_backend_default_use_rela_p): Define to zero for SymbianOS. * emulparams/armsymbian.sh (OTHER_READONLY_SECTIONS): Define, so as to include .ARM.exidx$${Base,Limit}. * ld/scripttempl/armbpabi.sc: Move .plt to end of text segment. Define IMAGE$$ER_RO$${Base,Limit} and SHT$$INIT_ARRAY$${Base,Limit}. Put .init_array, .fini_array, etc. into the read-only data segment. --- bfd/ChangeLog | 5 ++++ bfd/elf32-arm.c | 2 +- ld/ChangeLog | 9 ++++++ ld/emulparams/armsymbian.sh | 10 +++++++ ld/scripttempl/armbpabi.sc | 55 +++++++++++++++++++++++-------------- 5 files changed, 60 insertions(+), 21 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b03f9817e65..3e84f8ad91c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2005-01-25 Mark Mitchell + + * elf32-arm.c (elf_backend_default_use_rela_p): Define to zero for + SymbianOS. + 2005-01-25 Alexandre Oliva 2004-12-10 Alexandre Oliva diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 6e24153643c..09b47d3cdc8 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -5917,7 +5917,7 @@ elf32_arm_symbian_modify_segment_map (bfd *abfd, #undef elf_backend_may_use_rela_p #define elf_backend_may_use_rela_p 0 #undef elf_backend_default_use_rela_p -#define elf_backend_default_use_rela_p 1 +#define elf_backend_default_use_rela_p 0 #undef elf_backend_rela_normal #define elf_backend_rela_normal 0 diff --git a/ld/ChangeLog b/ld/ChangeLog index a178b240c65..2180c9dfcd5 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2005-01-25 Mark Mitchell + + * emulparams/armsymbian.sh (OTHER_READONLY_SECTIONS): Define, so + as to include .ARM.exidx$${Base,Limit}. + * ld/scripttempl/armbpabi.sc: Move .plt to end of text segment. + Define IMAGE$$ER_RO$${Base,Limit} and SHT$$INIT_ARRAY$${Base,Limit}. + Put .init_array, .fini_array, etc. into the read-only data + segment. + 2005-01-25 Alan Modra * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Formatting. diff --git a/ld/emulparams/armsymbian.sh b/ld/emulparams/armsymbian.sh index a5c3eb52ab3..a52d05b2480 100644 --- a/ld/emulparams/armsymbian.sh +++ b/ld/emulparams/armsymbian.sh @@ -9,6 +9,16 @@ TARGET2_TYPE=abs # On BPABI systems, program headers should not be mapped. EMBEDDED=yes +# As for armelf.sh, but add the SymbianOS-specific +# .ARM.exidx$${Base,Limit} symbols. +OTHER_READONLY_SECTIONS=" + .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } + ${RELOCATING+ .ARM.exidx\$\$Base = . ; } + ${RELOCATING+ __exidx_start = .; } + .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } + ${RELOCATING+ __exidx_end = .; } + ${RELOCATING+ .ARM.exidx\$\$Limit = . ; }" + # 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. diff --git a/ld/scripttempl/armbpabi.sc b/ld/scripttempl/armbpabi.sc index 33fae978a3a..b98f077ed1c 100644 --- a/ld/scripttempl/armbpabi.sc +++ b/ld/scripttempl/armbpabi.sc @@ -137,7 +137,10 @@ ${RELOCATING- /* For some reason, the Solaris linker makes bad executables SECTIONS { /* Read-only sections, merged into text segment: */ - ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}} + ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR});}}} + /* SymbianOS uses this symbol. */ + ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (Image\$\$ER_RO\$\$Base = ${TEXT_START_ADDR});}}} + ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+ . = ${TEXT_BASE_ADDRESS};}}} ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_BASE_ADDRESS};}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_BASE_ADDRESS};}} ${INITIAL_READONLY_SECTIONS} @@ -150,8 +153,6 @@ cat <