Skip to content

undefined __dso_handle when linking executable with atexit() call with glibc #35

@fuhsnn

Description

@fuhsnn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions