tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Patching symbols after tcc_relocate


From: Henry Weller
Subject: Re: [Tinycc-devel] Patching symbols after tcc_relocate
Date: Sun, 10 Feb 2013 11:17:13 +0000
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/24.2 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hi Grischka,

> That is not part of tcc_add_symbol, Instead you need an additional
> selective relocation for just one symbol, such as:

>       tcc_relocate_symbol(s, "add", add1Ptr, add2Ptr);

Right, this makes sense, I need to search for add1Ptr rather than "add" and
replace add1Ptr with add2Ptr.  I am not familiar with the memory layout libtcc
generated so any tips on where I should start looking for the function pointers
would be appreciated.

> You could change the linker to generate function pointers automatically,
> Basically you'd link the program to itself as if it were in an external
> DLL.  Non-trivial, also.

Hmm interesting thought.  I will try option 1 first.

Thanks for you help

Henry



reply via email to

[Prev in Thread] Current Thread [Next in Thread]