This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

develop a 'customized ld'


Hi folks,
I am looking at the source codes in ld directory(source code related to the linker) as I want to develop a slightly different linker. Basically, what I want to do is to find the address of some instructions in a program at link time.


For example, I want to find the program counter(i.e., the address of the instruction) of "call '@foo'" instruction at link time.
#demo.c
extern int foo(int);
int main(){
int i, j;
i=foo(1); //which will be compiled to something like "push 1; call @foo;..."
j=foo(i);
}//the assebly code is not syntatically correct--only try to show my goal.


Conceptually, this doesn't seem to need much code modification---keep most pass intact and add a customized pass to achieve what i want. ld is a quite big project to me, honestly. And this is my first time to touch it. Could someone give me some hint where should I start? Can any expert assess the difficulty of achieving such functionality?

Thanks,
Sean

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar ? get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]