Liu <pro...@gmail.com> writes: > Yes, I am working on a new gcc target, it almost finished but PIC and > dynamic linking. > They want me make the toolchain support PIC and dynamic linking. I'm > not sure what should I do, will you show me a path?
[ Sorry for my earlier reply, I see now that you did also reply to the mailing list. ] The first and most important thing you need to do is work out the ABI for position independent code and dynamic linking. This is not a gcc issue. It will depend entirely on how your processor works. You need to design code sequences for position independent function calls and access to global variables. I recommend reading one of the ELF processor supplements--several are available online--to see how they generally work. There is also a short introduction to these ideas at http://www.airs.com/blog/archives/41 . Once you've figured out what code you need to generate, then you can think about how to represent it in gcc. Ian