From 96921a5ad83cb17b99c6ae0b28c423a7f48acf0d Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sat, 24 Sep 2016 09:53:03 -0700 Subject: [PATCH] backend: psas inslen == 0 to the backend for the INCBIN case An INCBIN "instruction" can be enormous (up to an off_t size.) There is no reason to burden the rest of the code by widening the inslen and insoffs fields just for INCBIN, so set inslen == 0 to indicate fields not valid. Signed-off-by: H. Peter Anvin --- asm/assemble.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/asm/assemble.c b/asm/assemble.c index 04d4d435..a82fc9ba 100644 --- a/asm/assemble.c +++ b/asm/assemble.c @@ -614,8 +614,16 @@ int64_t assemble(int32_t segment, int64_t start, int bits, iflag_t cp, } while (t--) { + /* + * Consider these irrelevant for INCBIN, since it is fully + * possible that these might be (way) bigger than an int + * can hold; there is, however, no reason to widen these + * types just for INCBIN. data.inslen == 0 signals to the + * backend that these fields are meaningless, if at all + * needed. + */ data.insoffs = 0; - data.inslen = len; + data.inslen = 0; if (map) { out_rawdata(&data, map, len); -- 2.11.4.GIT