* scripttempl/elf.sc (INTERP): Delete. Move definition to..

(INITIAL_READONLY_SECTIONS): ..here.
	* emulparams/criself.sh (INITIAL_READONLY_SECTIONS): Include .interp.
	* emulparams/elf32bmip.sh (INITIAL_READONLY_SECTIONS): Ditto.
	* emulparams/elf32bmipn32-defs.sh (INITIAL_READONLY_SECTIONS): Ditto.
This commit is contained in:
Alan Modra 2006-10-17 13:55:11 +00:00
parent 74541ad4c0
commit 5a8e7be242
5 changed files with 28 additions and 5 deletions

View file

@ -1,3 +1,11 @@
2006-10-17 Alan Modra <amodra@bigpond.net.au>
* scripttempl/elf.sc (INTERP): Delete. Move definition to..
(INITIAL_READONLY_SECTIONS): ..here.
* emulparams/criself.sh (INITIAL_READONLY_SECTIONS): Include .interp.
* emulparams/elf32bmip.sh (INITIAL_READONLY_SECTIONS): Ditto.
* emulparams/elf32bmipn32-defs.sh (INITIAL_READONLY_SECTIONS): Ditto.
2006-10-17 Alan Modra <amodra@bigpond.net.au> 2006-10-17 Alan Modra <amodra@bigpond.net.au>
* ldlang.c (strip_excluded_output_sections): Do strip sections * ldlang.c (strip_excluded_output_sections): Do strip sections

View file

@ -13,7 +13,12 @@ ALIGNMENT=32
TEXT_START_ADDR=0 TEXT_START_ADDR=0
# Put crt0 for flash/eprom etc. in this section. # Put crt0 for flash/eprom etc. in this section.
INITIAL_READONLY_SECTIONS='.startup : { KEEP(*(.startup)) }' INITIAL_READONLY_SECTIONS=
if test -z "${CREATE_SHLIB}"; then
INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
fi
INITIAL_READONLY_SECTIONS="${INITIAL_READONLY_SECTIONS}
.startup : { KEEP(*(.startup)) }"
# Setting __Stext to . in TEXT_START_SYMBOLS doesn't get what we want # Setting __Stext to . in TEXT_START_SYMBOLS doesn't get what we want
# most of the time, which is the start of all read-only sections; # most of the time, which is the start of all read-only sections;

View file

@ -12,7 +12,11 @@ COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x0400000 NONPAGED_TEXT_START_ADDR=0x0400000
SHLIB_TEXT_START_ADDR=0x5ffe0000 SHLIB_TEXT_START_ADDR=0x5ffe0000
TEXT_DYNAMIC= TEXT_DYNAMIC=
INITIAL_READONLY_SECTIONS=" INITIAL_READONLY_SECTIONS=
if test -z "${CREATE_SHLIB}"; then
INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
fi
INITIAL_READONLY_SECTIONS="${INITIAL_READONLY_SECTIONS}
.reginfo ${RELOCATING-0} : { *(.reginfo) } .reginfo ${RELOCATING-0} : { *(.reginfo) }
" "
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'

View file

@ -57,7 +57,12 @@ TEXT_START_SYMBOLS='_ftext = . ;'
DATA_START_SYMBOLS='_fdata = . ;' DATA_START_SYMBOLS='_fdata = . ;'
OTHER_BSS_SYMBOLS='_fbss = .;' OTHER_BSS_SYMBOLS='_fbss = .;'
INITIAL_READONLY_SECTIONS=".reginfo ${RELOCATING-0} : { *(.reginfo) }" INITIAL_READONLY_SECTIONS=
if test -z "${CREATE_SHLIB}"; then
INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
fi
INITIAL_READONLY_SECTIONS="${INITIAL_READONLY_SECTIONS}
.reginfo ${RELOCATING-0} : { *(.reginfo) }"
# Discard any .MIPS.content* or .MIPS.events* sections. The linker # Discard any .MIPS.content* or .MIPS.events* sections. The linker
# doesn't know how to adjust them. # doesn't know how to adjust them.
OTHER_SECTIONS="/DISCARD/ : { *(.MIPS.content*) *(.MIPS.events*) }" OTHER_SECTIONS="/DISCARD/ : { *(.MIPS.content*) *(.MIPS.events*) }"

View file

@ -103,7 +103,9 @@ if test -n "${COMMONPAGESIZE}"; then
DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);" DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
fi fi
INTERP=".interp ${RELOCATING-0} : { *(.interp) }" if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
fi
if test -z "$PLT"; then if test -z "$PLT"; then
PLT=".plt ${RELOCATING-0} : { *(.plt) }" PLT=".plt ${RELOCATING-0} : { *(.plt) }"
fi fi
@ -259,7 +261,6 @@ SECTIONS
${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}); . = ${TEXT_BASE_ADDRESS};}}}
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}} ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
${CREATE_SHLIB-${INTERP}}
${INITIAL_READONLY_SECTIONS} ${INITIAL_READONLY_SECTIONS}
${TEXT_DYNAMIC+${DYNAMIC}} ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) } .hash ${RELOCATING-0} : { *(.hash) }