This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Use .plt section sh_entsize instead of GET_PLT_ENTRY_SIZE
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Michael Matz <matz at suse dot de>, GDB <gdb-patches at sourceware dot org>, Binutils <binutils at sourceware dot org>
- Date: Mon, 16 Sep 2013 19:52:34 +0100
- Subject: Re: RFC: Use .plt section sh_entsize instead of GET_PLT_ENTRY_SIZE
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOp9JdK96fXHL-ViJxMh371kgxONgYTHeXrYnBfm4AgdjQ at mail dot gmail dot com> <alpine dot LNX dot 2 dot 00 dot 1308121516060 dot 6497 at wotan dot suse dot de> <CAMe9rOrprNR+n-WpWo0nMXkW+FNWQSN2wVGumu1-FEht1iFsUA at mail dot gmail dot com> <alpine dot LNX dot 2 dot 00 dot 1308200911190 dot 6497 at wotan dot suse dot de> <alpine dot DEB dot 1 dot 10 dot 1309140227010 dot 29360 at tp dot orcam dot me dot uk> <CAMe9rOo-+R1U_=E1ZAD3Vo6MhjMa-tCCnBAg9tseMEv5NFsuZA at mail dot gmail dot com>
On Mon, 16 Sep 2013, H.J. Lu wrote:
> > MIPS PLT can now include multiple entries, of a different size each,
> > referring to the same GOT offset and the PLT entries are not sorted
> > (anymore) in the increasing GOT offset order (the difference is the MIPS
> > port passes the GOT offset in a register rather than on the stack, but
> > that's a minor implementation detail that does not affect the overall
> > design). Perhaps you could take a similar approach to solve your problem.
> >
>
> I see
>
> bfd_vma
> _bfd_mips_elf_plt_sym_val (bfd_vma i, const asection *plt,
> const arelent *rel ATTRIBUTE_UNUSED)
> {
> return (plt->vma
> + 4 * ARRAY_SIZE (mips_o32_exec_plt0_entry)
> + i * 4 * ARRAY_SIZE (mips_exec_plt_entry));
> }
>
> How does it work with variable PLT entry sizes?
That's used for n64 and n32 binaries that at the moment do not support
mixed-size PLTs. This handler is used by _bfd_elf_get_synthetic_symtab,
o32 binaries use _bfd_mips_elf_get_synthetic_symtab instead.
Maciej