summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2019-04-25 10:38:53 -0700
committerMatt Turner <mattst88@gmail.com>2019-04-25 10:52:20 -0700
commit5380624471e4ac22edd397cd91289844650ef5e5 (patch)
treece7849b38fad80ebd61526f54a457bc3b15feef3
parentdf84371bae98aa0724aa7926822da44cbcd3fbca (diff)
Test that by_symbol returns the same nhdr as by_name
-rw-r--r--dlopen-test.c5
-rw-r--r--so-test.c5
-rw-r--r--test.c5
3 files changed, 15 insertions, 0 deletions
diff --git a/dlopen-test.c b/dlopen-test.c
index ce0abe7..34e1904 100644
--- a/dlopen-test.c
+++ b/dlopen-test.c
@@ -56,6 +56,11 @@ main(int argc, char *argv[])
if (!note)
return -1;
+ const struct build_id_note *note_by_symbol =
+ build_id_find_nhdr_by_symbol(build_id_length);
+ if (note != note_by_symbol)
+ return -1;
+
ElfW(Word) len = build_id_length(note);
const uint8_t *build_id = build_id_data(note);
diff --git a/so-test.c b/so-test.c
index 824191c..9159ec1 100644
--- a/so-test.c
+++ b/so-test.c
@@ -35,6 +35,11 @@ main(int argc, char *argv[])
if (!note)
return -1;
+ const struct build_id_note *note_by_symbol =
+ build_id_find_nhdr_by_symbol(build_id_length);
+ if (note != note_by_symbol)
+ return -1;
+
ElfW(Word) len = build_id_length(note);
const uint8_t *build_id = build_id_data(note);
diff --git a/test.c b/test.c
index f381fd2..59023ae 100644
--- a/test.c
+++ b/test.c
@@ -34,6 +34,11 @@ main(int argc, char *argv[])
if (!note)
return -1;
+ const struct build_id_note *note_by_symbol =
+ build_id_find_nhdr_by_symbol(main);
+ if (note != note_by_symbol)
+ return -1;
+
ElfW(Word) len = build_id_length(note);
const uint8_t *build_id = build_id_data(note);