summaryrefslogtreecommitdiffstats
path: root/src/util/build_id.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-06-29 14:59:56 -0700
committerJason Ekstrand <[email protected]>2018-07-02 12:09:14 -0700
commit70b16963fc6aa5f8c0e947ea48095bb679a3fa74 (patch)
treefa7b9a5d6e8897e762f80073972d7f53910cd2e3 /src/util/build_id.c
parent4819da2301916512dbc50e0b5e97a75a6b6320a2 (diff)
util/macros: Import ALIGN_POT from ralloc.c
v2 (Jason Ekstrand): - Rename y to pot_align (Brian) - Also use ALIGN_POT in build_id.c and slab.c (Brian) Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/util/build_id.c')
-rw-r--r--src/util/build_id.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/util/build_id.c b/src/util/build_id.c
index fb67d160e38..8b4f8f30afb 100644
--- a/src/util/build_id.c
+++ b/src/util/build_id.c
@@ -28,6 +28,7 @@
#include <string.h>
#include "build_id.h"
+#include "macros.h"
#ifndef NT_GNU_BUILD_ID
#define NT_GNU_BUILD_ID 3
@@ -37,8 +38,6 @@
#define ElfW(type) Elf_##type
#endif
-#define ALIGN(val, align) (((val) + (align) - 1) & ~((align) - 1))
-
struct build_id_note {
ElfW(Nhdr) nhdr;
@@ -90,8 +89,8 @@ build_id_find_nhdr_callback(struct dl_phdr_info *info, size_t size, void *data_)
}
size_t offset = sizeof(ElfW(Nhdr)) +
- ALIGN(note->nhdr.n_namesz, 4) +
- ALIGN(note->nhdr.n_descsz, 4);
+ ALIGN_POT(note->nhdr.n_namesz, 4) +
+ ALIGN_POT(note->nhdr.n_descsz, 4);
note = (struct build_id_note *)((char *)note + offset);
len -= offset;
}