From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: Mark Klein Cc: gcc@gcc.gnu.org Subject: Re: MPE Port Date: Sun, 31 Oct 1999 23:35:00 -0000 Message-ID: <18424.940989664@upchuck> References: <4.2.0.58.19991026065301.00c68310@garfield.dis.com> X-SW-Source: 1999-10n/msg00667.html Message-ID: <19991031233500.udbNDrJLO7bR7C4hQSc1zyv9m7KIaFYXULrqIY8W1dE@z> In message < 4.2.0.58.19991026065301.00c68310@garfield.dis.com >you write: > There is a table called the XRT (if I understand it correctly on HP-UX, it > is similar in function to the PLT there) that is fixed up at execution time > with the space, offset of the code, and the DP and SP of the called > procedure. > There are support routines that can dynamically load a program and create > an XRT for it. All "procedure labels" on MPE are really pointers to the XRT > entry. There are entry and exit stubs to set and restore those registers > and to promote privilege as needed. Not exactly what I was looking for. I'm interested in how/where are dynamic libraries loaded, does the dynamic linker make a distinction between code & data in the dynamic library, if so, does it arrange to load them in different spaces (which would be a significant divergence from the hpux dynamic linker). More along the lines of how does mapping of dynamic executables work. THe > to start looking at this as soon as I have time. I don't know the purpose > of a "trampoline" and what the __gcc_plt_call does, yet. Can you > enlighten me? You'd have to read the gdb code for all the grody details. When gdb wants to call a function in the inferior program, it writes a bunch of code onto the stack (ie the stub/trampoline) which is responsible for doing argument setup, dealing with cross space calls/returns, etc etc.). It then transfers execution control to that code on the stack, which in turn calls the final target. __gcc_plt_call is necessary because the hpux dynamic linker will not allow the return address for a call to be in a non-text, non-shlib space when the target function is lazily bound. jeff