This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: passing argument to __attribute__((constructor))


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...



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]