How do I debug the below issue:
File 1.c
void __attribute__((weak)) funcA () {
printf("Weak fn");
}
1.c is part of a library libA
Now I added a stronger definition for this function in another file.
File 2.c
void funcA () {
printf("Strong fn");
}
2.c is part of library libB
Now I include libB to libA. But when running the code I see that the weaker function is getting executed instead.
How do I debug this?
I've tried nm to look for funcA, it shows as 'W' under libA, and 'T' under libB.