I assume neither ;-)
This works with .text.sched .text.init .text.cpu etc. I use the first
function in each section as my reference point. This is the key.
I don't see how. I'm referencing a function as my pointer. If this was
true, then I wouldn't be able to do
static void my_func(void) { [...] }
struct func_struct {
void (*func)(void);
} f = { my_func; };
My references end up exactly the same as the "f->func" reference does.
If my references are broken, so is this f->func. Which would be bad to
say the least.
This doesn't seem any less complex than what I did. With this, I would
have to come up with another way to handle modules. This will make
things a lot more complex.
I could work on this. But again, this will put more work into module.c
that I would like to avoid.
Actually, this isn't that much fiddling. What I did was simply make a list
of pointers to the call sites to mcount. The pointers used the first
function of each section to offset against. I relinked in the list making
it just like a list done within C. All relocations and magic after this
will be handled just fine.
-- Steve
--