aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-01-26 06:10:45 +0000
committerMark Mitchell <mark@codesourcery.com>2005-01-26 06:10:45 +0000
commitdc4c9c199b288656a976b6262d56b92b993f51a8 (patch)
treecf9721de9d5b4f590b3576926e8507bd3937fbd9 /ld/scripttempl
parentfb7c96323e5ba5d095ccf8e21505e7852d630245 (diff)
downloadfsf-binutils-gdb-dc4c9c199b288656a976b6262d56b92b993f51a8.zip
fsf-binutils-gdb-dc4c9c199b288656a976b6262d56b92b993f51a8.tar.gz
fsf-binutils-gdb-dc4c9c199b288656a976b6262d56b92b993f51a8.tar.bz2
* 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.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r--ld/scripttempl/armbpabi.sc55
1 files changed, 35 insertions, 20 deletions
diff --git a/ld/scripttempl/armbpabi.sc b/ld/scripttempl/armbpabi.sc
index 33fae97..b98f077 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 <<EOF
KEEP (*(.init))
${RELOCATING+${INIT_END}}
} =${NOP-0}
-
- ${DATA_PLT-${BSS_PLT-${PLT}}}
.text ${RELOCATING-0} :
{
${RELOCATING+${TEXT_START_SYMBOLS}}
@@ -167,31 +168,22 @@ cat <<EOF
KEEP (*(.fini))
${RELOCATING+${FINI_END}}
} =${NOP-0}
+ /* The SymbianOS kernel requires that the PLT go at the end of the
+ text section. */
+ ${DATA_PLT-${BSS_PLT-${PLT}}}
${RELOCATING+PROVIDE (__etext = .);}
${RELOCATING+PROVIDE (_etext = .);}
${RELOCATING+PROVIDE (etext = .);}
+ /* SymbianOS uses this symbol. */
+ ${RELOCATING+PROVIDE (Image\$\$ER_RO\$\$Limit = .);}
${WRITABLE_RODATA-${RODATA}}
.rodata1 ${RELOCATING-0} : { *(.rodata1) }
${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}}
- ${OTHER_READONLY_SECTIONS}
- .eh_frame_hdr : { *(.eh_frame_hdr) }
- .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
-
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
- ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR};}}}
- ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR};}}
- ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR};}}
-
- /* Exception handling */
- .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
- /* Thread Local Storage sections */
- .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
- .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
+ /* On SymbianOS, put .init_array and friends in the read-only
+ segment; there is no runtime relocation applied to these
+ arrays. */
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
@@ -203,13 +195,36 @@ cat <<EOF
${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .);}}
+ /* SymbianOS uses this symbol. */
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (SHT\$\$INIT_ARRAY\$\$Base = .);}}
.init_array ${RELOCATING-0} : { *(.init_array) }
+ /* SymbianOS uses this symbol. */
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE (SHT\$\$INIT_ARRAY\$\$Limit = .);}}
${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
.fini_array ${RELOCATING-0} : { *(.fini_array) }
${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
+ ${OTHER_READONLY_SECTIONS}
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
+
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR};}}}
+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR};}}
+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR};}}
+
+ /* Exception handling */
+ .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
+
+ /* Thread Local Storage sections */
+ .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
+ .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
+
${RELOCATING+${CTOR}}
${RELOCATING+${DTOR}}
.jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }