Re: task_struct offsets broken in 2.1.77

Matthias Urlichs (smurf@work.smurf.noris.de)
6 Jan 1998 22:09:03 +0100


regis@via.ecp.fr writes:
>
> struct s {
> ...
> foo bar;
> };
> #define offset_to_bar_in_struct_s ((void *)&((struct s *)0)->bar - (void *)0)
>
> I'm not (yet!) a GAS guru, but I'm pretty sure somebody will find a
> way to use this directly in asm code.
>
Probably not, but it's trivial to write a small C program that translates the
above to #define offsetfoobar 123 (just call printf("#define offsetfoobar %d",
offsetfoobar) for all the offsetfoobars you need). Add a few Makefile
rules, and you're done.

-- 
Matthias Urlichs
noris network GmbH