From 0cf7d72c50cd48896b66849604286cc73d838161 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 11 May 2005 14:10:10 +0000 Subject: * 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. --- ld/scripttempl/elf.sc | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'ld/scripttempl') 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 <