diff options
author | Alan Modra <amodra@gmail.com> | 2005-05-11 14:10:10 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-05-11 14:10:10 +0000 |
commit | 0cf7d72c50cd48896b66849604286cc73d838161 (patch) | |
tree | c09ffd5807fa80c56cfabc90e29b928e9a7b4032 /ld/scripttempl/elf.sc | |
parent | d7128ce4b13e32a44861403299d9541ed9b8827d (diff) | |
download | gdb-0cf7d72c50cd48896b66849604286cc73d838161.zip gdb-0cf7d72c50cd48896b66849604286cc73d838161.tar.gz gdb-0cf7d72c50cd48896b66849604286cc73d838161.tar.bz2 |
* ldgram.y: Add SPECIAL token.
(sect_constraint): Handle SPECIAL.
* ldlang.c (lang_output_section_find_1): Don't match SPECIAL.
(map_input_to_output_sections): Likewise.
* ldlex.l (SPECIAL): Define.
* emulparams/elf32ppc.sh (DATA_GOT, SDATA_GOT, SEPARATE_GOTPLT,
GOT, PLT, GOTPLT): Define.
* emultempl/ppc32elf.em (old_plt, old_got): New static vars.
(ppc_after_open): New function.
(PARSE_AND_LIST_PROLOGUE): Define OPTION_OLD_LPT and OPTION_OLD_GOT.
(PARSE_AND_LIST_LONGOPTS): Add "bss-plt" and "sdata-got".
(PARSE_AND_LIST_OPTIONS): Document them.
(PARSE_AND_LIST_ARGS_CASES): Handle them.
(LDEMUL_AFTER_OPEN): Define.
* scripttempl/elf.sc (PLT): Don't override existing define.
(DATA_GOT, SDATA_GOT): Define and use to enable alternate got
placement rather than using NO_SMALL_DATA. Emit GOTPLT for RELRO_NOW.
Diffstat (limited to 'ld/scripttempl/elf.sc')
-rw-r--r-- | ld/scripttempl/elf.sc | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index c2a2dcf..3e0f0b0 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -101,7 +101,9 @@ if test -n "${COMMONPAGESIZE}"; then DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" fi INTERP=".interp ${RELOCATING-0} : { *(.interp) }" -PLT=".plt ${RELOCATING-0} : { *(.plt) }" +if test -z "$PLT"; then + PLT=".plt ${RELOCATING-0} : { *(.plt) }" +fi if test -z "$GOT"; then if test -z "$SEPARATE_GOTPLT"; then GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" @@ -144,6 +146,16 @@ if test -z "${NO_SMALL_DATA}"; then else NO_SMALL_DATA=" " fi +if test -z "${DATA_GOT}"; then + if test -n "${NO_SMALL_DATA}"; then + DATA_GOT=" " + fi +fi +if test -z "${SDATA_GOT}"; then + if test -z "${NO_SMALL_DATA}"; then + SDATA_GOT=" " + fi +fi test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " CTOR=".ctors ${CONSTRUCTING-0} : { @@ -343,11 +355,12 @@ cat <<EOF ${RELOCATING+${DATARELRO}} ${OTHER_RELRO_SECTIONS} ${TEXT_DYNAMIC-${DYNAMIC}} - ${NO_SMALL_DATA+${RELRO_NOW+${GOT}}} - ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}} + ${DATA_GOT+${RELRO_NOW+${GOT}}} + ${DATA_GOT+${RELRO_NOW+${GOTPLT}}} + ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}} ${RELOCATING+${DATA_SEGMENT_RELRO_END}} - ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT+${GOTPLT}}}} - ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}} + ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}} + ${DATA_GOT+${RELRO_NOW-${GOTPLT}}} ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}} @@ -364,9 +377,9 @@ cat <<EOF ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}} ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}} ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}} - ${RELOCATING+${OTHER_GOT_SYMBOLS}} - ${NO_SMALL_DATA-${GOT}} - ${OTHER_GOT_SECTIONS} + ${SDATA_GOT+${RELOCATING+${OTHER_GOT_SYMBOLS}}} + ${SDATA_GOT+${GOT}} + ${SDATA_GOT+${OTHER_GOT_SECTIONS}} ${SDATA} ${OTHER_SDATA_SECTIONS} ${RELOCATING+${DATA_END_SYMBOLS-_edata = .; PROVIDE (edata = .);}} |