summaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/pe.em9
-rw-r--r--ld/emultempl/pep.em9
2 files changed, 16 insertions, 2 deletions
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index a29f2e387f..bb283c13fa 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -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];
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index 6594a46cd2..39daa079c0 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -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];