This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Hooking in C and the GCC
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: ignacio dot subira at gigle dot biz, binutils at sourceware dot org
- Date: Mon, 14 Sep 2009 14:58:58 +0100
- Subject: Re: Hooking in C and the GCC
- References: <1252514215.19836.50.camel@Labpc013-BCN> <4AAE389F.2020808@redhat.com>
Nick Clifton wrote:
> Hi Nacho,
>
>> while developing, I came across several difficulties that made me think
>> I need to solve them by using hooks. I don't have a deep knowledge of
>> hooking in C and how GCC interacts with it.
>> If anyone of you has experience with hooking, can you advice me about
>> what to seek on the internet or books to read about it?.
>
> You would probably be better off asking this question on the gcc mailing
> list (gcc@gcc.gnu.org).
Actually I think this is more likely to be a question for
gcc-help@gcc.gnu.org, since it's not likely to require modifying the compiler
itself.
> This list is for the binutils, rather than the
> compiler.
>
> It is also not clear what you mean by "hooking". If you do write to the
> gcc list, perhaps you could provide some more information about the
> problem you are trying to solve and the method you want to use to solve it.
The one feature in binutils that might be useful in implementing a hooking
scheme is the --wrap command-line option for 'ld':
http://sourceware.org/binutils/docs-2.19/ld/Options.html#index-g_t_002d_002dwrap-249
Also a good way to find demonstrations of hooking techniques and code
samples would be to browse some of the websites that cover reverse
engineering; google will find lots of them for you easily.
cheers,
DaveK