Skip to content

Instantly share code, notes, and snippets.

@jakobrs
Created May 19, 2021 18:02
Show Gist options
  • Save jakobrs/e6e3276cedeb02d032c3c751a9f6e446 to your computer and use it in GitHub Desktop.
Save jakobrs/e6e3276cedeb02d032c3c751a9f6e446 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <link.h>
static void explore(struct link_map *lm) {
struct link_map *focused = lm;
printf("Backwards:\n");
while (focused != NULL) {
printf("- %s\n", focused->l_name);
focused = focused->l_prev;
}
focused = lm;
printf("Forwards:\n");
while (focused != NULL) {
printf("- %s\n", focused->l_name);
focused = focused->l_next;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment