From: Kai Tietz Date: Wed, 22 Sep 2010 08:03:42 +0000 (+0000) Subject: 2010-09-22 Kai Tietz X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d48749734084702ffe2a535ece1d52f9aa6ac168;p=binutils-gdb.git 2010-09-22 Kai Tietz * 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. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 8f706c6a47a..c7169e02a71 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,13 @@ +2010-09-22 Kai Tietz + + * 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 * emulparams/elf32_sparc.sh: Set NOP to 0x01000000 diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index a29f2e387f1..bb283c13fa1 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 6594a46cd29..39daa079c08 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]; diff --git a/ld/scripttempl/armcoff.sc b/ld/scripttempl/armcoff.sc index ebc019a89f0..cefd6eba3f8 100644 --- a/ld/scripttempl/armcoff.sc +++ b/ld/scripttempl/armcoff.sc @@ -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 <