* Force GCC not to use relative addresses for asm-CALL-statements
@ 2012-01-08 1:19 augomat
2012-01-08 1:25 ` Jeffrey Walton
0 siblings, 1 reply; 3+ messages in thread
From: augomat @ 2012-01-08 1:19 UTC (permalink / raw)
To: gcc-help
hi!
compiling an ordinary C programm, function-calls are (at least on my
computer) translated to something like:
E8 56070000 CALL <JMP.&msvcrt.printf>
where the operand 1 (56070000) is of type: rel16/32
can i force gcc to produce only CALLS (and jumps, ...) that have absolute
addresses as their operands?
best regards,
georg
--
View this message in context: http://old.nabble.com/Force-GCC-not-to-use-relative-addresses-for-asm-CALL-statements-tp33100719p33100719.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Force GCC not to use relative addresses for asm-CALL-statements
2012-01-08 1:19 Force GCC not to use relative addresses for asm-CALL-statements augomat
@ 2012-01-08 1:25 ` Jeffrey Walton
2012-01-08 12:24 ` augomat
0 siblings, 1 reply; 3+ messages in thread
From: Jeffrey Walton @ 2012-01-08 1:25 UTC (permalink / raw)
To: augomat; +Cc: gcc-help
On Sat, Jan 7, 2012 at 8:01 PM, augomat <augomat@gmail.com> wrote:
>
> hi!
>
> compiling an ordinary C programm, function-calls are (at least on my
> computer) translated to something like:
>
> E8 56070000 CALL <JMP.&msvcrt.printf>
>
> where the operand 1 (56070000) is of type: rel16/32
>
> can i force gcc to produce only CALLS (and jumps, ...) that have absolute
> addresses as their operands?
You need to bind the executable
(http://msdn.microsoft.com/en-us/magazine/cc301808.aspx). Visual
Studio includes a tool to do it from the command line. I'm not sure if
GCC offers a switch or GNU offers a tool to do it.
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Force GCC not to use relative addresses for asm-CALL-statements
2012-01-08 1:25 ` Jeffrey Walton
@ 2012-01-08 12:24 ` augomat
0 siblings, 0 replies; 3+ messages in thread
From: augomat @ 2012-01-08 12:24 UTC (permalink / raw)
To: gcc-help
hi!
I tried binding it by using the source from [1] (essentially calling
BindImageEx()) but that didn't change anything with respect to the calls. To
my understanding binding is used only for external calls.
best regards,
georg
[1] http://rmathew.com/articles/bind.html
--
View this message in context: http://old.nabble.com/Force-GCC-not-to-use-relative-addresses-for-asm-CALL-statements-tp33100719p33101920.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-08 11:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-08 1:19 Force GCC not to use relative addresses for asm-CALL-statements augomat
2012-01-08 1:25 ` Jeffrey Walton
2012-01-08 12:24 ` augomat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).