Ubuntu – Why 'constructor' attributed function with the same name is called 3 times from library X instead of 1 time from libraries X, Y, Z
Scenario: $ cat lib.c #include <stdio.h> #define STR_(x) #x #define STR(x) STR_(x) #define CAT_(x,y) x##y #define CAT(x,y) CAT_(x,y) __attribute__((constructor)) void CAT(foo,)(void) { printf("foo" STR(N) " %pn", CAT(foo,)); } void CAT(bar,N)(void){ puts("bar" STR(N)); } $ cat main.c void barx(void); void bary(void);…