From: deraadt Date: Fri, 8 Dec 2023 12:58:27 +0000 (+0000) Subject: locally us MAXIMUM() rather than MAX() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a4e0416e21587cc7b862bc4fbb09ccadef454f86;p=openbsd locally us MAXIMUM() rather than MAX() ok tb gnezdo --- diff --git a/libexec/ld.so/tib.c b/libexec/ld.so/tib.c index bb27fb05aff..d64eb053363 100644 --- a/libexec/ld.so/tib.c +++ b/libexec/ld.so/tib.c @@ -32,10 +32,8 @@ __dso_hidden void *allocate_tib(size_t); -#define MAX(a,b) (((a)>(b))?(a):(b)) - #ifdef TIB_EXTRA_ALIGN -# define TIB_ALIGN MAX(__alignof__(struct tib), TIB_EXTRA_ALIGN) +# define TIB_ALIGN MAXIMUM(__alignof__(struct tib), TIB_EXTRA_ALIGN) #else # define TIB_ALIGN __alignof__(struct tib) #endif @@ -170,7 +168,7 @@ allocate_tls_offset(Elf_Addr msize, Elf_Addr align, int for_exe) * - need to offset the TIB 12 bytes from the start * - to place ths TLS data at offset 64 */ - static_tls_align = MAX(align, TIB_ALIGN); + static_tls_align = MAXIMUM(align, TIB_ALIGN); static_tls_align_offset = ELF_ROUND(sizeof(struct tib), static_tls_align) - sizeof(struct tib); diff --git a/libexec/ld.so/util.h b/libexec/ld.so/util.h index 6a91472028c..6b4f3aaef5e 100644 --- a/libexec/ld.so/util.h +++ b/libexec/ld.so/util.h @@ -1,4 +1,4 @@ -/* $OpenBSD: util.h,v 1.39 2023/08/15 06:26:34 guenther Exp $ */ +/* $OpenBSD: util.h,v 1.40 2023/12/08 12:58:27 deraadt Exp $ */ /* * Copyright (c) 1998 Todd C. Miller @@ -35,6 +35,8 @@ #include #include /* for NULL */ +#define MAXIMUM(a,b) (((a)>(b))?(a):(b)) + #ifndef __boot # if DO_CLEAN_BOOT # define __boot __attribute__((section(".boot.text")))