Re: linking with __CTOR_LIST__

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Grig,

thanks for reply. there must be some way to walk and call those pointers?
want to do something like as follows on linux appllication. 

To use gcov for a application which runs all the time, i wanted to change
the behavior.

This is the code extract from http://lwn.net/2002/0207/a/gcov-kernel.php3

extern long __CTOR_LIST__;
typedef void (*func_ptr)(void) ;
func_ptr *p = (func_ptr*) &__CTOR_LIST__;

if ( p == NULL) {
printk("No CTORS\n");
return;
}
for ( ; *p != (func_ptr) 0; p++) {
(*p) ();
}

I wanted to do similar stuff for the application.
Any other idea or right alias (if it is not the one).

thanks and regards,
abby.


Grigory Zagorodnev wrote:
> 
> Abby wrote:
>> i am writing an application (linux) where i am trying to reference
>> __CTOR_LIST__ ?
>> /tmp/cc2rTvyB.o(.data+0x0): undefined reference to `__CTOR_LIST__'
>> 
>> any idea?
>> abby.
> 
> __CTOR_LIST__ is a local symbol, it can't be referenced from outside 
> crtbegin*.o startup object file.
> 
> - Grigory
> 
> 

-- 
View this message in context: http://www.nabble.com/linking-with-__CTOR_LIST__-tf2253354.html#a6263258
Sent from the gcc - Help forum at Nabble.com.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux