summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2017-11-24 22:09:41 -0800
committerMatt Turner <mattst88@gmail.com>2017-11-24 23:33:06 -0800
commite0ea9bb5be34c464c67a1212e8924d0a38696d67 (patch)
tree394fcb24a80c7e29d9ba1985e0214bc07395c58e
parenteac19cb55396588704adac6f325c083a646879b7 (diff)
Change API to match upstream Mesa
-rw-r--r--build-id.c6
-rw-r--r--build-id.h4
-rw-r--r--so-test.c6
-rw-r--r--test.c6
4 files changed, 7 insertions, 15 deletions
diff --git a/build-id.c b/build-id.c
index b81fbef..05ff5e5 100644
--- a/build-id.c
+++ b/build-id.c
@@ -100,8 +100,8 @@ build_id_length(const struct note *note)
return note->nhdr.n_descsz;
}
-void
-build_id_read(const struct note *note, unsigned char *build_id)
+const uint8_t *
+build_id_data(const struct note *note)
{
- memcpy(build_id, note->build_id, note->nhdr.n_descsz);
+ return note->build_id;
}
diff --git a/build-id.h b/build-id.h
index c52a42b..ebe5a2e 100644
--- a/build-id.h
+++ b/build-id.h
@@ -33,5 +33,5 @@ build_id_find_nhdr(const char *name);
ElfW(Word)
build_id_length(const struct note *note);
-void
-build_id_read(const struct note *note, unsigned char *build_id);
+const uint8_t *
+build_id_data(const struct note *note);
diff --git a/so-test.c b/so-test.c
index 095fbef..44f4563 100644
--- a/so-test.c
+++ b/so-test.c
@@ -36,11 +36,7 @@ main(int argc, char *argv[])
ElfW(Word) len = build_id_length(note);
- unsigned char *build_id = malloc(len * sizeof(char));
- if (!build_id)
- return -1;
-
- build_id_read(note, build_id);
+ const uint8_t *build_id = build_id_data(note);
printf("Build ID: ");
for (ElfW(Word) i = 0; i < len; i++) {
diff --git a/test.c b/test.c
index fbea6b4..d779be8 100644
--- a/test.c
+++ b/test.c
@@ -36,11 +36,7 @@ main(int argc, char *argv[])
ElfW(Word) len = build_id_length(note);
- unsigned char *build_id = malloc(len * sizeof(char));
- if (!build_id)
- return -1;
-
- build_id_read(note, build_id);
+ const uint8_t *build_id = build_id_data(note);
printf("Build ID: ");
for (ElfW(Word) i = 0; i < len; i++) {