https://sourceware.org/bugzilla/show_bug.cgi?id=19372
Bug ID: 19372 Summary: both ld.bfd and ld.gold + --as-needed does not link libraries with __init functions Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: socketpair at gmail dot com Target Milestone: --- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68902 : Original bug was reported here: https://github.com/thom311/libnl/issues/93 libnl3 have such function: static void __init ct_init(void) { nl_cache_mngt_register(&nfnl_ct_ops); } so, when this library is loaded it registers itself in some global variable for later access. When I link against that library, my program does not see that registration since library just is not linked! I consider linker should not eliminate lbraries where __init functions exists. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils