passing argument to __attribute__((constructor))

Nick Clifton nickc@redhat.com
Tue Aug 1 08:59:00 GMT 2017


Hi Yubin,

> I am wondering whether one can pass arguments to
> __attribute__((constructor)). 

Short answer: no.

Long answer: Not via the parameters to the function.  But you 
could store the arguments in global variables and access them
from inside the function.

Cheers
  Nick

PS.  This is really a GCC question, not a binutils question...




More information about the Binutils mailing list