diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2009-01-16 14:14:07 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2009-01-16 14:14:07 +0000 |
commit | 258795f524fca9d5b98441b81684c331c4d721b1 (patch) | |
tree | 365c275b1bbaade138d48bf73fb98ddbd26f7a70 /ld/scripttempl/elf.sc | |
parent | 3493e7b072fcca9911dd102bbcb6a1fc61012f95 (diff) | |
download | gdb-258795f524fca9d5b98441b81684c331c4d721b1.zip gdb-258795f524fca9d5b98441b81684c331c4d721b1.tar.gz gdb-258795f524fca9d5b98441b81684c331c4d721b1.tar.bz2 |
ld/
2009-01-16 H.J. Lu <hongjiu.lu@intel.com>
* lexsup.c (option_values): Add OPTION_TTEXT_SEGMENT.
(ld_options): Add -Ttext-segment.
(parse_args): Handle OPTION_TTEXT_SEGMENT.
* ld.texinfo: Document -Ttext-segment.
* NEWS: Mention -Ttext-segment.
* scripttempl/elf.sc (TEXT_START_ADDR): Use SEGMENT_START.
(SHLIB_TEXT_START_ADDR): Likewise.
ld/testsuite/
2009-01-16 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/textaddr1.d: New.
* ld-elf/textaddr2.d: Likewise.
Diffstat (limited to 'ld/scripttempl/elf.sc')
-rw-r--r-- | ld/scripttempl/elf.sc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index bb8c808..123a989 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -242,6 +242,9 @@ STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : *(.stack) }" +TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${TEXT_START_ADDR})" +SHLIB_TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${SHLIB_TEXT_START_ADDR:-0})" + # if this is for an embedded system, don't add SIZEOF_HEADERS. if [ -z "$EMBEDDED" ]; then test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS" @@ -267,8 +270,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ ${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_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}} + ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR} + SIZEOF_HEADERS;}} + ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR} + SIZEOF_HEADERS;}} ${INITIAL_READONLY_SECTIONS} .note.gnu.build-id : { *(.note.gnu.build-id) } EOF |