[...] > +static bool sym_is_extern(const GElf_Sym *sym) > +{ > + int bind = GELF_ST_BIND(sym->st_info); > + /* externs are symbols w/ type=NOTYPE, bind=GLOBAL|WEAK, section=UND */ > + return sym->st_shndx == SHN_UNDEF && > + (bind == STB_GLOBAL || bind == STB_WEAK) && > + GELF_ST_TYPE(sym->st_info) == STT_NOTYPE; > +} Will this also match function declarations marked as extern? I've started looking into how to handle this for the static/dynamic linking use cases and am wondering whether it makes sense to pull in this series and build on that? -Toke