diff options
author | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2014-04-14 14:43:45 -0700 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2014-04-14 14:53:41 -0700 |
commit | 160ce55a90bcdcb3000d74805795969edc3f8422 (patch) | |
tree | 532d850b412135c21851f25d00226937bd9d420b /binutils-2.24/ld | |
parent | b33d0ddc123435be5e60ebb15a37b3bfb651dc7e (diff) | |
download | toolchain_binutils-160ce55a90bcdcb3000d74805795969edc3f8422.zip toolchain_binutils-160ce55a90bcdcb3000d74805795969edc3f8422.tar.gz toolchain_binutils-160ce55a90bcdcb3000d74805795969edc3f8422.tar.bz2 |
[2.24] Fix alignment for data segment for 64 bits.
See 4c195079b72a16cb62cb9a6e8010b3dc0202795b
Change-Id: I64dab07994f832898584d34095c3d3ab015c2fe9
Diffstat (limited to 'binutils-2.24/ld')
-rw-r--r-- | binutils-2.24/ld/scripttempl/elf.sc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/binutils-2.24/ld/scripttempl/elf.sc b/binutils-2.24/ld/scripttempl/elf.sc index 6743f7c..330bddc 100644 --- a/binutils-2.24/ld/scripttempl/elf.sc +++ b/binutils-2.24/ld/scripttempl/elf.sc @@ -122,9 +122,12 @@ DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))" DATA_SEGMENT_RELRO_END="" DATA_SEGMENT_END="" if test -n "${COMMONPAGESIZE}"; then - #DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})" - # For Android, we align at exactly a page boundary. - DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})" + if [ "$ELFSIZE" = "64" ]; then + DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})" + else + # For 32, we align at exactly a page boundary. + DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})" + fi DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);" DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" fi @@ -534,8 +537,8 @@ cat <<EOF .exception_ranges*) } ${TEXT_PLT+${PLT_NEXT_DATA+${PLT}}} - /* Adjust the address for the data segment. We want to align at exactly - a page boundary to make life easier for apriori. */ + /* Adjust the address for the data segment. For 32 bits we want to align + at exactly a page boundary to make life easier for apriori. */ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}} ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} |