Re: back online again...
- From: "Rod Pemberton" <do_not_have@xxxxxxxxxxxxx>
- Date: Tue, 6 Jan 2009 11:47:57 -0500
"cr88192" <cr88192@xxxxxxxxxxx> wrote in message
news:gjvrcb$b2h$1@xxxxxxxxxxxxxxxxxxxxx
"Rod Pemberton" <do_not_have@xxxxxxxxxxxxx> wrote in message
news:gjvggt$4g8$1@xxxxxxxxxxxxxxxxxxxxx
"cr88192" <cr88192@xxxxxxxxxxx> wrote in message
news:gjv0a2$qbc$1@xxxxxxxxxxxxxxxxxxxxx
I am using tornevall...
So am I... Thank you for pointing out tornevall to me. :)
And,I've been considering just using left-to-right. How often do I use
varargs?
Never... Varargs are the key reason for right-to-left order, rigth?
seevarargs must be indicated by ellipsis, "...", yes? How often does one
ellipsis in C code? Never... I'd also like to free up ebp for use.
printf uses varargs...
Yes, you're correct, sigh... I'd probably make printf() take exactly ten
arguments. I'd then have the compiler automatically fill in "dummy"
arguments if printf() had less than ten. Etc., until, of if I ever chose to
fix it. :)
Back to your earlier post:
then interface with external C
code via special autogenerated attachment thunks.
...
and so then, dynamically compiled code uses this convention as if it were
the native convention...
Basically, a custom prolog and epilog or wrapper function for calling SysV
from Win64 or whatever. Yes?
the question is than what happens if a function is called that does not
exist?
At the assembler level instead of C level, if the function call doesn't
exist, there won't be a "_XC_foo_4dd_5d" label, so the assembler should warn
about the missing label when "call _XC_foo_4dd_5d" is assembled. (OK, I
know that's not what you were talking about...)
well, the idea could be that the linker could detect this case,
Oh, if it's an external function, then the linker will notice it can't be
linked with if it's missing. The linker will detect the external function
is missing, but at that point, isn't it a bit late to be trying to patch up
the internal code so it can call the external code? I'd think you'd want
your compiler to insert "dummy" or wrapper functions for missing or external
functions which are then used to generate your "special autogenerated
attachment thunks" and call the external function.
linker ... automatically generate a stub to allow calling the
native function using the native convention
AH! You want a method to select between the "custom calling convention" for
internal C functions and the SysV calling convention for external C
functions. And, you're trying to determine a method to know which is which
so the arguments and returns are properly setup for a different calling
convention when linked. Okay, your second post makes sense now... :)
Interesting... IIRC, I worked on a system where they needed to place
wrappers around a larger number of OS system functions. What they did was
have the compiler captilize the names of the system functions. They were
all external. Then, the linker linked to the wrapper library function if
the function name was uppercase instead of the original OS library
functions, which it'd link to if it was lowercase. The wrapper did some
stuff, called the original function, did some more stuff, then exited, much
like a prolog and epilog.
Rod Pemberton
.
- Follow-Ups:
- Re: back online again...
- From: cr88192
- Re: back online again...
- References:
- back online again...
- From: cr88192
- Re: back online again...
- From: Rod Pemberton
- Re: back online again...
- From: cr88192
- back online again...
- Prev by Date: Re: Announce: Introducing qadasm (based on crudasm) disassembler for Windows EXE/DLL/COFF files
- Next by Date: Re: back online again...
- Previous by thread: Re: back online again...
- Next by thread: Re: back online again...
- Index(es):
Relevant Pages
|