diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-18 17:30:33 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-18 17:30:33 +0000 |
commit | c4c510be1eb485658dfb7fe0ef77ed233eda86a3 (patch) | |
tree | 2367e8dda7aa467be705fcfe972effd00b851490 /usr.sbin/btxld | |
parent | 6b2d5217d718aa127da8ed23c5d2198199fd9b84 (diff) | |
download | src-c4c510be1eb485658dfb7fe0ef77ed233eda86a3.tar.gz src-c4c510be1eb485658dfb7fe0ef77ed233eda86a3.zip |
Reuse our roundup2() macro instead of reinventing the wheel.
Obtained from: DragonflyBSD
Notes
Notes:
svn path=/head/; revision=298216
Diffstat (limited to 'usr.sbin/btxld')
-rw-r--r-- | usr.sbin/btxld/btxld.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/usr.sbin/btxld/btxld.c b/usr.sbin/btxld/btxld.c index 7984c4cd31df..c2f4b5b126f5 100644 --- a/usr.sbin/btxld/btxld.c +++ b/usr.sbin/btxld/btxld.c @@ -68,8 +68,6 @@ static const char rcsid[] = #define IMPURE 1 /* Writable text */ #define MAXU32 0xffffffff /* Maximum unsigned 32-bit quantity */ -#define align(x, y) (((x) + (y) - 1) & ~((y) - 1)) - struct hdr { uint32_t fmt; /* Format */ uint32_t flags; /* Bit flags */ @@ -425,7 +423,7 @@ puthdr(int fd, struct hdr *hdr) eh.p[1].p_offset = htole32(le32toh(eh.p[0].p_offset) + le32toh(eh.p[0].p_filesz)); eh.p[1].p_vaddr = eh.p[1].p_paddr = - htole32(align(le32toh(eh.p[0].p_paddr) + le32toh(eh.p[0].p_memsz), + htole32(roundup2(le32toh(eh.p[0].p_paddr) + le32toh(eh.p[0].p_memsz), 4096)); eh.p[1].p_filesz = eh.p[1].p_memsz = htole32(hdr->data); eh.sh[2].sh_addr = eh.p[0].p_vaddr; |