diff options
author | Alan Modra <amodra@gmail.com> | 2017-01-02 22:33:47 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-01-02 22:42:45 +1030 |
commit | f5657270bd9353db74ba802ebed62b7133f7c2a0 (patch) | |
tree | cbd9dc4ebf8ca3d01a00e0a23e9107c5f7933430 /ld/scripttempl | |
parent | 595e0a47f57b414843261303b8aa5036fd1fa1e3 (diff) | |
download | gdb-f5657270bd9353db74ba802ebed62b7133f7c2a0.zip gdb-f5657270bd9353db74ba802ebed62b7133f7c2a0.tar.gz gdb-f5657270bd9353db74ba802ebed62b7133f7c2a0.tar.bz2 |
Support -z relro on hppa
PR ld/21000
* emulparams/hppalinux.sh (DATA_ADDR, SHLIB_DATA_ADDR): Don't define.
(DATA_SEGMENT_ALIGN, DATA_SEGMENT_END, DATA_SEGMENT_RELRO_END): Define.
* scripttempl/elf.sc: Don't define the above if DATA_SEGMENT_ALIGN
is already defined.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r-- | ld/scripttempl/elf.sc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index aa46050..e65f9a3 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -120,21 +120,23 @@ test -z "${ELFSIZE}" && ELFSIZE=32 test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8" test "$LD_FLAG" = "N" && DATA_ADDR=. test -z "${ETEXT_NAME}" && ETEXT_NAME=${USER_LABEL_PREFIX}etext -test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE="" -test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE="" test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT test -z "$ATTRS_SECTIONS" && ATTRS_SECTIONS=".gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }" -DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))" -DATA_SEGMENT_RELRO_END="" -DATA_SEGMENT_END="" -if test -n "${COMMONPAGESIZE}"; then - if test "${SEGMENT_SIZE}" != "${MAXPAGESIZE}"; then - DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})" - else - DATA_SEGMENT_ALIGN="DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})" +if test -z "$DATA_SEGMENT_ALIGN"; then + test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE="" + test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE="" + DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))" + DATA_SEGMENT_RELRO_END="" + DATA_SEGMENT_END="" + if test -n "${COMMONPAGESIZE}"; then + if test "${SEGMENT_SIZE}" != "${MAXPAGESIZE}"; then + DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})" + else + DATA_SEGMENT_ALIGN="DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})" + fi + DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);" + DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" fi - DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);" - DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" fi if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" |