Skip to content

Instantly share code, notes, and snippets.

@compor
Created June 4, 2014 08:51
Show Gist options
  • Save compor/75d1f6f0a49645af7206 to your computer and use it in GitHub Desktop.
Save compor/75d1f6f0a49645af7206 to your computer and use it in GitHub Desktop.
detects Linux DSO name forms and associates versioned suffix names with a single base name for a library
# need to use --posix or --re-interval
$0 ~ /^lib[^.]+\.so(.[0-9]+){0,3}$/ {
n = split($0, a, ".")
dso_basename = a[1];
suffix = ""
for(i = 2; i <= n; i++) {
suffix = suffix"."a[i]
}
dso[dso_basename] = dso[dso_basename]"|"suffix;
}
END {
for(i in dso)
printf("%s : %s\n", i, dso[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment