2010-09-22 Kai Tietz <kai.tietz@onevision.com>
authorKai Tietz <kai.tietz@onevision.com>
Wed, 22 Sep 2010 08:03:42 +0000 (08:03 +0000)
committerKai Tietz <kai.tietz@onevision.com>
Wed, 22 Sep 2010 08:03:42 +0000 (08:03 +0000)
        * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Add
        idata to orphan set.
        * emultempl/pep.em: Likewise.
        * scripttempl/armcoff.sc: Separate idata
        and add __IAT_start__ and __IAT_end__ labels.
        * scripttempl/pe.sc: Likewise.
        * scripttempl/pep.sc: Likewise.

ld/ChangeLog
ld/emultempl/pe.em
ld/emultempl/pep.em
ld/scripttempl/armcoff.sc
ld/scripttempl/pe.sc
ld/scripttempl/pep.sc

index 8f706c6a47a50c86feaf65da214f36d6129281a2..c7169e02a71bf08d613499847f865fc29bc71398 100644 (file)
@@ -1,3 +1,13 @@
+2010-09-22  Kai Tietz  <kai.tietz@onevision.com>
+
+       * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Add
+       idata to orphan set.
+       * emultempl/pep.em: Likewise.
+       * scripttempl/armcoff.sc: Separate idata
+       and add __IAT_start__ and __IAT_end__ labels.
+       * scripttempl/pe.sc: Likewise.
+       * scripttempl/pep.sc: Likewise.
+
 2010-09-20  David S. Miller  <davem@davemloft.net>
 
        * emulparams/elf32_sparc.sh: Set NOP to 0x01000000
index a29f2e387f1bba68c36ea186858bfefc40523e19..bb283c13fa124b94c051a3051c5fbb4a80121020 100644 (file)
@@ -1939,6 +1939,9 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
          { ".text",
            SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE,
            0, 0, 0, 0 },
+         { ".idata",
+           SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
+           0, 0, 0, 0 },
          { ".rdata",
            SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
            0, 0, 0, 0 },
@@ -1952,6 +1955,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
       enum orphan_save_index
        {
          orphan_text = 0,
+         orphan_idata,
          orphan_rodata,
          orphan_data,
          orphan_bss
@@ -1985,7 +1989,10 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
       else if ((s->flags & SEC_READONLY) == 0)
        place = &hold[orphan_data];
       else if ((s->flags & SEC_CODE) == 0)
-       place = &hold[orphan_rodata];
+       {
+         place = (!strncmp (secname, ".idata\$", 7) ? &hold[orphan_idata]
+                                                    : &hold[orphan_rodata]);
+       }
       else
        place = &hold[orphan_text];
 
index 6594a46cd29b4df7ee15ef08630b6074846c068d..39daa079c08fa6e79344c531c2ac23a139eb57c5 100644 (file)
@@ -1677,6 +1677,9 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
          { ".text",
            SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE,
            0, 0, 0, 0 },
+         { ".idata",
+           SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
+           0, 0, 0, 0 },
          { ".rdata",
            SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
            0, 0, 0, 0 },
@@ -1690,6 +1693,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
       enum orphan_save_index
        {
          orphan_text = 0,
+         orphan_idata,
          orphan_rodata,
          orphan_data,
          orphan_bss
@@ -1723,7 +1727,10 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
       else if ((s->flags & SEC_READONLY) == 0)
        place = &hold[orphan_data];
       else if ((s->flags & SEC_CODE) == 0)
-       place = &hold[orphan_rodata];
+       {
+         place = (!strncmp (secname, ".idata\$", 7) ? &hold[orphan_idata]
+                                                    : &hold[orphan_rodata]);
+       }
       else
        place = &hold[orphan_text];
 
index ebc019a89f06ae5603e44bc5d2a42eb347ff5b5d..cefd6eba3f8b3c64743795d7f669731f0b21e815 100644 (file)
@@ -17,7 +17,22 @@ DTOR='.dtor : {
     *(SORT(.dtors.*))
     *(.dtor)
   }'
-
+if test "${RELOCATING}"; then
+  R_IDATA234='
+    SORT(*)(.idata$2)
+    SORT(*)(.idata$3)
+    /* These zeroes mark the end of the import list.  */
+    LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
+    SORT(*)(.idata$4)'
+  R_IDATA5='SORT(*)(.idata$5)'
+  R_IDATA67='
+    SORT(*)(.idata$6)
+    SORT(*)(.idata$7)'
+else
+  R_IDATA234=
+  R_IDATA5=
+  R_IDATA67=
+fi
 cat <<EOF
 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", "${LITTLE_OUTPUT_FORMAT}")
 ${LIB_SEARCH_DIRS}
@@ -60,6 +75,16 @@ SECTIONS
   }
   ${CONSTRUCTING+${RELOCATING-$CTOR}}
   ${CONSTRUCTING+${RELOCATING-$DTOR}}
+  .idata ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    /* This cannot currently be handled with grouped sections.
+       See pep.em:sort_sections.  */
+       ${R_IDATA234}
+       ${RELOCATING+__IAT_start__ = .;}
+    ${R_IDATA5}
+       ${RELOCATING+__IAT_end__ = .;}
+    ${R_IDATA67}
+  }
   .bss ${RELOCATING+ ALIGN(0x8)} :
   {                                    
     ${RELOCATING+ __bss_start__ = . ;}
index f3cbe2565e4f442cbc680251bc47af81d62f9b26..e178fce0d3b1d0ee36697968d84a4cab29de96e6 100644 (file)
@@ -23,13 +23,14 @@ if test "${RELOCATING}"; then
     R_RDATA='*(.rdata)
              *(SORT(.rdata$*))'
   fi
-  R_IDATA='
+  R_IDATA234='
     SORT(*)(.idata$2)
     SORT(*)(.idata$3)
     /* These zeroes mark the end of the import list.  */
     LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
-    SORT(*)(.idata$4)
-    SORT(*)(.idata$5)
+    SORT(*)(.idata$4)'
+  R_IDATA5='SORT(*)(.idata$5)'
+  R_IDATA67='
     SORT(*)(.idata$6)
     SORT(*)(.idata$7)'
   R_CRT_XC='*(SORT(.CRT$XC*))  /* C initialization */'
@@ -46,7 +47,9 @@ else
   R_TEXT=
   R_DATA=
   R_RDATA='*(.rdata)'
-  R_IDATA=
+  R_IDATA234=
+  R_IDATA5=
+  R_IDATA67=
   R_CRT=
   R_RSRC=
 fi
@@ -147,7 +150,11 @@ SECTIONS
   {
     /* This cannot currently be handled with grouped sections.
        See pe.em:sort_sections.  */
-    ${R_IDATA}
+    ${R_IDATA234}
+    ${RELOCATING+__IAT_start__ = .;}
+    ${R_IDATA5}
+    ${RELOCATING+__IAT_end__ = .;}
+    ${R_IDATA67}
   }
   .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
   {                                    
index 75abc9fb11055e18a11e4244a1ba7372824cea48..3682766fe7810908682c130ace795ffce3886915 100644 (file)
@@ -23,13 +23,14 @@ if test "${RELOCATING}"; then
     R_RDATA='*(.rdata)
              *(SORT(.rdata$*))'
   fi
-  R_IDATA='
+  R_IDATA234='
     SORT(*)(.idata$2)
     SORT(*)(.idata$3)
     /* These zeroes mark the end of the import list.  */
     LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
-    SORT(*)(.idata$4)
-    SORT(*)(.idata$5)
+    SORT(*)(.idata$4)'
+  R_IDATA5='SORT(*)(.idata$5)'
+  R_IDATA67='
     SORT(*)(.idata$6)
     SORT(*)(.idata$7)'
   R_CRT_XC='*(SORT(.CRT$XC*))  /* C initialization */'
@@ -46,7 +47,9 @@ else
   R_TEXT=
   R_DATA=
   R_RDATA='*(.rdata)'
-  R_IDATA=
+  R_IDATA234=
+  R_IDATA5=
+  R_IDATA67=
   R_CRT=
   R_RSRC=
 fi
@@ -153,7 +156,11 @@ SECTIONS
   {
     /* This cannot currently be handled with grouped sections.
        See pep.em:sort_sections.  */
-    ${R_IDATA}
+    ${R_IDATA234}
+    ${RELOCATING+__IAT_start__ = .;}
+    ${R_IDATA5}
+    ${RELOCATING+__IAT_end__ = .;}
+    ${R_IDATA67}
   }
   .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
   {