This snippet:
#include <stdlib.h>
static void fn(void) {}
int main(void) {
atexit(fn);
}
Failed with:
ld: /usr/lib/x86_64-linux-gnu/libc_nonshared.a(atexit.oS): in function `atexit':
(.text+0x3): undefined reference to `__dso_handle'
ld: a.out: hidden symbol `__dso_handle' isn't defined
ld: final link failed: bad value
error: ld terminated with status 1
I think it's in the driver or pcc-libs, since this also happens with .o produced by gcc.