[PATCH] x86/vdso: Make vdso2c print the number of sections needed on error

From: H. Peter Anvin
Date: Tue Jun 24 2014 - 14:26:18 EST


If we run out of space for section, at least make the error message
print the amount of space we need so we can actually diagnose it.
Furthermore, the test should be > instead of >= (it is okay to have
exactly the maximum number of sections.)

Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxx>
Cc: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
Link: http://lkml.kernel.org/r/20140622084754.GA15094@xxxxxxxxx
---
arch/x86/vdso/vdso2c.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/vdso/vdso2c.h b/arch/x86/vdso/vdso2c.h
index f42e2ddc663d..94158e100f26 100644
--- a/arch/x86/vdso/vdso2c.h
+++ b/arch/x86/vdso/vdso2c.h
@@ -99,8 +99,9 @@ static void BITSFUNC(copy_section)(struct BITSFUNC(fake_sections) *out,
if (!copy)
return;

- if (out->count >= out->max_count)
- fail("too many copied sections (max = %d)\n", out->max_count);
+ if (out->count > out->max_count)
+ fail("too many copied sections (max = %d, need = %d)\n",
+ out->max_count, out->count);

if (in_idx == out->in_shstrndx)
out->out_shstrndx = out->count;
--
1.9.3


--------------060901090601010703060005--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/