From: nasm-bot f. C. S. B. <cha...@in...> - 2018-05-05 20:48:24
|
Commit-ID: 69ed82447a13a22e52a86a51a5657c7955a6767b Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=69ed82447a13a22e52a86a51a5657c7955a6767b Author: Chang S. Bae <cha...@in...> AuthorDate: Wed, 2 May 2018 08:07:51 -0700 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sat, 5 May 2018 23:43:57 +0300 output: macho -- Check the actual size of 64-bit absolute address Even though the size is set to 64-bit, actual value can be in 32-bit range. In that case, the use of such absolute address is prevented. The side effect of 58d2ab17 is resolved. https://bugzilla.nasm.us/show_bug.cgi?id=3392468 Reported-by: Richard Russell <rtr...@gm...> Reported-by: Michael Petch <mp...@ca...> Signed-off-by: Chang S. Bae <cha...@in...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outmacho.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/output/outmacho.c b/output/outmacho.c index 266a3dd..a92b9ec 100644 --- a/output/outmacho.c +++ b/output/outmacho.c @@ -670,7 +670,8 @@ static void macho_output(int32_t secto, const void *data, nasm_error(ERR_NONFATAL, "Mach-O format does not support" " section base references"); } else if (wrt == NO_SEG) { - if (fmt.ptrsize == 8 && asize != 8) { + if (fmt.ptrsize == 8 && + (asize != 8 || addr <= UINT32_MAX)) { nasm_error(ERR_NONFATAL, "Mach-O 64-bit format does not support" " 32-bit absolute addresses"); |