This is the mail archive of the
mailing list for the GCC project.
Re: Interface Method Table
- From: Ian Lance Taylor <iant at google dot com>
- To: Matt Davis <mattdavis9 at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 20 Jan 2012 07:42:11 -0800
- Subject: Re: Interface Method Table
- References: <20120119222832.GA3147@excelsa.wimax>
Matt Davis <email@example.com> writes:
> For a Go program being compiled in gcc, from the middle end, is there a way to
> figure-out which routines make up the interface-method-table? I could check the
> mangled name of the method table, but is there another way to deduce what
> methods compose it from the middle-end?
The type of the table is a struct. The second element of the struct is
a pointer to a table of pointers. The pointers in that table are the
methods. Each one is cast to void*, but if you undo that case you
should find the actual function pointer.