static const bfd_byte elf_xtensa_be_plt_entry[PLT_ENTRY_SIZE] =
{
+#if XSHAL_ABI == XTHAL_ABI_WINDOWED
0x6c, 0x10, 0x04, /* entry sp, 32 */
+#endif
0x18, 0x00, 0x00, /* l32r a8, [got entry for rtld's resolver] */
0x1a, 0x00, 0x00, /* l32r a10, [got entry for rtld's link map] */
0x1b, 0x00, 0x00, /* l32r a11, [literal for reloc index] */
static const bfd_byte elf_xtensa_le_plt_entry[PLT_ENTRY_SIZE] =
{
+#if XSHAL_ABI == XTHAL_ABI_WINDOWED
0x36, 0x41, 0x00, /* entry sp, 32 */
+#endif
0x81, 0x00, 0x00, /* l32r a8, [got entry for rtld's resolver] */
0xa1, 0x00, 0x00, /* l32r a10, [got entry for rtld's link map] */
0xb1, 0x00, 0x00, /* l32r a11, [literal for reloc index] */
{
asection *splt, *sgotplt;
bfd_vma plt_base, got_base;
- bfd_vma code_offset, lit_offset;
+ bfd_vma code_offset, lit_offset, abi_offset;
int chunk;
chunk = reloc_index / PLT_ENTRIES_PER_CHUNK;
? elf_xtensa_be_plt_entry
: elf_xtensa_le_plt_entry),
PLT_ENTRY_SIZE);
+ abi_offset = XSHAL_ABI == XTHAL_ABI_WINDOWED ? 3 : 0;
bfd_put_16 (output_bfd, l32r_offset (got_base + 0,
- plt_base + code_offset + 3),
- splt->contents + code_offset + 4);
+ plt_base + code_offset + abi_offset),
+ splt->contents + code_offset + abi_offset + 1);
bfd_put_16 (output_bfd, l32r_offset (got_base + 4,
- plt_base + code_offset + 6),
- splt->contents + code_offset + 7);
+ plt_base + code_offset + abi_offset + 3),
+ splt->contents + code_offset + abi_offset + 4);
bfd_put_16 (output_bfd, l32r_offset (got_base + lit_offset,
- plt_base + code_offset + 9),
- splt->contents + code_offset + 10);
+ plt_base + code_offset + abi_offset + 6),
+ splt->contents + code_offset + abi_offset + 7);
return plt_base + code_offset;
}