linker - gcc symbol resolution shadowing -


i'm trying add custom code our internal libc related atexit handling.

in our libc define because link custom crt files , don't use gcc's defines this.

void *__dso_handle __attribute__((__visibility__("hidden"),__weak__)) = &__dso_handle; 

gcc adds binaries when linking them.

in libc function atexit calls

int atexit(void (*func)(void)) {     return __cxa_atexit((void (*)(void*))func, null, __dso_handle); } 

the issue i'm facing _dso_handle value used local 1 libc when i'd make dynamically fetch 1 module calls atexit() @ runtime proper dso registered atexit function.

i checked attributes , found nothing there.

note unlike glibc, atexit kept in dynamic version of libc preserve backwards compatibility older binaries.

the issue i'm facing _dso_handle value used local 1 libc when i'd make dynamically fetch 1 module calls atexit() @ runtime

your module can call __cxa_atexit instead, , pass in whatever dso_handle desire.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -