From: SUGIOKA T. <su...@it...> - 2002-01-24 08:38:42
|
At 02:30 02/01/24 -0600, "M. R. Brown" <mr...@0x...> wrote: >* SUGIOKA Toshinobu <su...@it...> on Thu, Jan 24, 2002: > >> >> This problem seems to be related on struct return from shared library. >> It is not only c++ specific, but also occurs on c program. >> >> I have uploaded updated binutils RPM packages. Thanks Kojima-san for the patch. >> http://www.sh-linux.org/rpm/RPMS/i386/Laser5-6.4/binutils-sh-linux-2.11.2-4.i386.rpm >> http://www.sh-linux.org/rpm/RPMS/i386/RedHat7.1/binutils-sh-linux-2.11.2-4.i386.rpm >> http://www.sh-linux.org/rpm/SRPMS/binutils-2.11.2-4.src.rpm >> >> Please retry with them. >> > >Um, where is the patch itself? > Here it is. diff -ru binutils-2.11.2.org/bfd/elf32-sh.c binutils-2.11.2/bfd/elf32-sh.c --- binutils-2.11.2.org/bfd/elf32-sh.c Thu Jan 24 14:09:50 2002 +++ binutils-2.11.2/bfd/elf32-sh.c Thu Jan 24 14:12:29 2002 @@ -2107,6 +2107,106 @@ /* First entry in an absolute procedure linkage table look like this. */ +#if 1 +static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] = +{ + 0xd0, 0x05, /* mov.l 2f,r0 */ + 0x60, 0x02, /* mov.l @r0,r0 */ + 0x2f, 0x06, /* mov.l r0,@-r15 */ + 0xd0, 0x03, /* mov.l 1f,r0 */ + 0x60, 0x02, /* mov.l @r0,r0 */ + 0x40, 0x2b, /* jmp @r0 */ + 0x60, 0xf6, /* mov.l @r15+,r0 */ + 0x00, 0x09, /* nop */ + 0x00, 0x09, /* nop */ + 0x00, 0x09, /* nop */ + 0, 0, 0, 0, /* 1: replaced with address of .got.plt + 8. */ + 0, 0, 0, 0, /* 2: replaced with address of .got.plt + 4. */ +}; + +static const bfd_byte elf_sh_plt0_entry_le[PLT_ENTRY_SIZE] = +{ + 0x05, 0xd0, /* mov.l 2f,r0 */ + 0x02, 0x60, /* mov.l @r0,r0 */ + 0x06, 0x2f, /* mov.l r0,@-r15 */ + 0x03, 0xd0, /* mov.l 1f,r0 */ + 0x02, 0x60, /* mov.l @r0,r0 */ + 0x2b, 0x40, /* jmp @r0 */ + 0xf6, 0x60, /* mov.l @r15+,r0 */ + 0x09, 0x00, /* nop */ + 0x09, 0x00, /* nop */ + 0x09, 0x00, /* nop */ + 0, 0, 0, 0, /* 1: replaced with address of .got.plt + 8. */ + 0, 0, 0, 0, /* 2: replaced with address of .got.plt + 4. */ +}; + +/* Sebsequent entries in an absolute procedure linkage table look like + this. */ + +static const bfd_byte elf_sh_plt_entry_be[PLT_ENTRY_SIZE] = +{ + 0xd0, 0x04, /* mov.l 1f,r0 */ + 0x60, 0x02, /* mov.l @r0,r0 */ + 0xd1, 0x02, /* mov.l 0f,r1 */ + 0x40, 0x2b, /* jmp @r0 */ + 0x60, 0x13, /* mov r1,r0 */ + 0xd1, 0x03, /* mov.l 2f,r1 */ + 0x40, 0x2b, /* jmp @r0 */ + 0x00, 0x09, /* nop */ + 0, 0, 0, 0, /* 0: replaced with address of .PLT0. */ + 0, 0, 0, 0, /* 1: replaced with address of this symbol in .got. */ + 0, 0, 0, 0, /* 2: replaced with offset into relocation table. */ +}; + +static const bfd_byte elf_sh_plt_entry_le[PLT_ENTRY_SIZE] = +{ + 0x04, 0xd0, /* mov.l 1f,r0 */ + 0x02, 0x60, /* mov.l @r0,r0 */ + 0x02, 0xd1, /* mov.l 0f,r1 */ + 0x2b, 0x40, /* jmp @r0 */ + 0x13, 0x60, /* mov r1,r0 */ + 0x03, 0xd1, /* mov.l 2f,r1 */ + 0x2b, 0x40, /* jmp @r0 */ + 0x09, 0x00, /* nop */ + 0, 0, 0, 0, /* 0: replaced with address of .PLT0. */ + 0, 0, 0, 0, /* 1: replaced with address of this symbol in .got. */ + 0, 0, 0, 0, /* 2: replaced with offset into relocation table. */ +}; + +/* Entries in a PIC procedure linkage table look like this. */ + +static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] = +{ + 0xd0, 0x04, /* mov.l 1f,r0 */ + 0x00, 0xce, /* mov.l @(r0,r12),r0 */ + 0x40, 0x2b, /* jmp @r0 */ + 0x00, 0x09, /* nop */ + 0x50, 0xc2, /* mov.l @(8,r12),r0 */ + 0xd1, 0x03, /* mov.l 2f,r1 */ + 0x40, 0x2b, /* jmp @r0 */ + 0x50, 0xc1, /* mov.l @(4,r12),r0 */ + 0x00, 0x09, /* nop */ + 0x00, 0x09, /* nop */ + 0, 0, 0, 0, /* 1: replaced with address of this symbol in .got. */ + 0, 0, 0, 0 /* 2: replaced with offset into relocation table. */ +}; + +static const bfd_byte elf_sh_pic_plt_entry_le[PLT_ENTRY_SIZE] = +{ + 0x04, 0xd0, /* mov.l 1f,r0 */ + 0xce, 0x00, /* mov.l @(r0,r12),r0 */ + 0x2b, 0x40, /* jmp @r0 */ + 0x09, 0x00, /* nop */ + 0xc2, 0x50, /* mov.l @(8,r12),r0 */ + 0x03, 0xd1, /* mov.l 2f,r1 */ + 0x2b, 0x40, /* jmp @r0 */ + 0xc1, 0x50, /* mov.l @(4,r12),r0 */ + 0x09, 0x00, /* nop */ + 0x09, 0x00, /* nop */ + 0, 0, 0, 0, /* 1: replaced with address of this symbol in .got. */ + 0, 0, 0, 0 /* 2: replaced with offset into relocation table. */ +}; +#else static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] = { 0xd0, 0x04, /* mov.l 1f,r0 */ @@ -2167,7 +2267,7 @@ 0x03, 0xd1, /* mov.l 2f,r1 */ 0x2b, 0x40, /* jmp @r0 */ 0x09, 0x00, /* nop */ - 0, 0, 0, 0, /* 0: replaced with address of .PLT. */ + 0, 0, 0, 0, /* 0: replaced with address of .PLT0. */ 0, 0, 0, 0, /* 1: replaced with address of this symbol in .got. */ 0, 0, 0, 0, /* 2: replaced with offset into relocation table. */ }; @@ -2180,8 +2280,8 @@ 0x00, 0xce, /* mov.l @(r0,r12),r0 */ 0x40, 0x2b, /* jmp @r0 */ 0x00, 0x09, /* nop */ - 0x50, 0xc2, /* 0: mov.l @(8,r12),r0 */ - 0x52, 0xc1, /* 1: mov.l @(4,r12),r2 */ + 0x50, 0xc2, /* mov.l @(8,r12),r0 */ + 0x52, 0xc1, /* mov.l @(4,r12),r2 */ 0xd1, 0x02, /* mov.l 2f,r1 */ 0x40, 0x2b, /* jmp @r0 */ 0xe0, 0x00, /* mov #0,r0 ! shows the type of PLT. */ @@ -2196,8 +2296,8 @@ 0xce, 0x00, /* mov.l @(r0,r12),r0 */ 0x2b, 0x40, /* jmp @r0 */ 0x09, 0x00, /* nop */ - 0xc2, 0x50, /* 0: mov.l @(8,r12),r0 */ - 0xc1, 0x52, /* 1: mov.l @(4,r12),r2 */ + 0xc2, 0x50, /* mov.l @(8,r12),r0 */ + 0xc1, 0x52, /* mov.l @(4,r12),r2 */ 0x02, 0xd1, /* mov.l 2f,r1 */ 0x2b, 0x40, /* jmp @r0 */ 0x00, 0xe0, /* mov #0,r0 ! shows the type of PLT. */ @@ -2205,6 +2305,7 @@ 0, 0, 0, 0, /* 1: replaced with address of this symbol in .got. */ 0, 0, 0, 0 /* 2: replaced with offset into relocation table. */ }; +#endif static const bfd_byte *elf_sh_plt0_entry; static const bfd_byte *elf_sh_plt_entry; --- 杉岡利信 |