2004-10-14 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 14 Oct 2004 17:00:16 +0000 (17:00 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 14 Oct 2004 17:00:16 +0000 (17:00 +0000)
PR 445
* emulparams/elf64_ia64.sh (SMALL_DATA_CTOR): Set.
(SMALL_DATA_DTOR): Set.
* emulparams/elf64_ia64_fbsd.sh (SMALL_DATA_CTOR): Unset.
(SMALL_DATA_DTOR): Unset.
* scripttempl/elf.sc: If SMALL_DATA_CTOR is set, move .ctors
after .data. If SMALL_DATA_DTOR is set, move .dtors after
.data.

ld/ChangeLog
ld/emulparams/elf64_ia64.sh
ld/emulparams/elf64_ia64_fbsd.sh
ld/scripttempl/elf.sc

index fc61f7f8ede5373a2f8a98f81c3951e3b1a0545e..2cfcdd80a80accbfacd004f60201ed20fffc74dd 100644 (file)
@@ -1,3 +1,14 @@
+2004-10-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR 445
+       * emulparams/elf64_ia64.sh (SMALL_DATA_CTOR): Set.
+       (SMALL_DATA_DTOR): Set.
+       * emulparams/elf64_ia64_fbsd.sh (SMALL_DATA_CTOR): Unset.
+       (SMALL_DATA_DTOR): Unset.
+       * scripttempl/elf.sc: If SMALL_DATA_CTOR is set, move .ctors
+       after .data. If SMALL_DATA_DTOR is set, move .dtors after
+       .data.
+
 2004-10-14  Alan Modra  <amodra@bigpond.net.au>
 
        PR 63
index 60c8c4c9ebf56bbdd8f6fc606e5809e50d862079..c5be56e8508f14e788aa8e926054ecc74558e180 100644 (file)
@@ -33,3 +33,7 @@ test -n "$CREATE_PIE" && OTHER_GOT_RELOC_SECTIONS="
 OTHER_READONLY_SECTIONS="${OTHER_READONLY_SECTIONS}
   .IA_64.unwind_info ${RELOCATING-0} : { *(.IA_64.unwind_info${RELOCATING+* .gnu.linkonce.ia64unwi.*}) }
   .IA_64.unwind ${RELOCATING-0} : { *(.IA_64.unwind${RELOCATING+* .gnu.linkonce.ia64unw.*}) }"
+# Intel C++ compiler, prior to 9.0, puts small data in .ctors and
+# .dtors.  They have to be next to .sbss/.sbss2/.sdata/.sdata2.
+SMALL_DATA_CTOR=" "
+SMALL_DATA_DTOR=" "
index 47cde5c5db07237584a0853bb0c445ae2eaa60d7..ab7e78f292a71a0108fd170bf96a40653d5129dd 100644 (file)
@@ -1,4 +1,6 @@
 . ${srcdir}/emulparams/elf64_ia64.sh
 TEXT_START_ADDR="0x2000000000000000"
 unset DATA_ADDR
+unset SMALL_DATA_CTOR
+unset SMALL_DATA_DTOR
 . ${srcdir}/emulparams/elf_fbsd.sh
index d560f58fe6f9d2c57ff2cada4179107a50df7c57..c7311b1f32772598f2ecdc389112cf02e5318e0d 100644 (file)
@@ -3,6 +3,8 @@
 #      NOP - four byte opcode for no-op (defaults to 0)
 #      NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
 #              empty.
+#      SMALL_DATA_CTOR - .ctors contains small data.
+#      SMALL_DATA_DTOR - .dtors contains small data.
 #      DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
 #      INITIAL_READONLY_SECTIONS - at start of text segment
 #      OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
@@ -347,8 +349,8 @@ cat <<EOF
   .fini_array   ${RELOCATING-0} : { KEEP (*(.fini_array)) }
   ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
 
-  ${RELOCATING+${CTOR}}
-  ${RELOCATING+${DTOR}}
+  ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
+  ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
   .jcr          ${RELOCATING-0} : { KEEP (*(.jcr)) }
 
   ${RELOCATING+${DATARELRO}}
@@ -372,6 +374,8 @@ cat <<EOF
   .data1        ${RELOCATING-0} : { *(.data1) }
   ${WRITABLE_RODATA+${RODATA}}
   ${OTHER_READWRITE_SECTIONS}
+  ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
+  ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
   ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
   ${RELOCATING+${OTHER_GOT_SYMBOLS}}
   ${NO_SMALL_DATA-${GOT}}