This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [help]Creating PLT entries
- From: Ramana Radhakrishnan <ramana dot radhakrishnan at codito dot com>
- To: "C Jaiprakash, Noida" <C dot Jaiprakash at noida dot hcltech dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 25 Sep 2004 00:39:43 +0530
- Subject: Re: [help]Creating PLT entries
- References: <33BC33A9E76474479B76AD0DE8A169728DD8@exch-ntd.nec.noida.hcltech.com>
C Jaiprakash, Noida wrote:
Hi,
I am trying to implement creation of PLT entries using existing implementation. Currently the target supports 32 bit displacement so existing plt entries use pc+32 bit addr mode. I want to modify it such that displacement is loaded into a register first and pc,reg addr mode is used. I want to modify this in elf32-m68k.c file.
Following is part of plt entries table
static const bfd_byte elf_m68k_plt0_entry[PLT_ENTRY_SIZE] =
{
0x2f, 0x3b, 0x01, 0x70, /* move.l (%pc,addr),-(%sp) */
0, 0, 0, 0, /* replaced with offset to .got + 4. */
0x4e, 0xfb, 0x01, 0x71, /* jmp ([%pc,addr]) */
0, 0, 0, 0, /* replaced with offset to .got + 8. */
0, 0, 0, 0 /* pad out to 20 bytes. */
};
How can i modify this so that instead of jmp ([%pc,addr]) jmp ([%pc,reg]) is used. Where should i look for modifications?
I have very little idea of binutils, so any kind of help is appreciated.
The table you see above is the encoding for the PLT entries . You would
have to replace that with the corresponding entry in little endian or
big endian form for whatever be the case you want to handle
In any case I dont see why you might want to do the jmp [%pc, reg] since
you would not know the register used for calculating the offset :-)
cheers
ramana
regards,
c jaiprakash