From a60faab83ef86bcf2884311db07cf13f445d7f47 Mon Sep 17 00:00:00 2001 From: Mathias Krause Date: Mon, 17 Jan 2011 07:50:42 +0000 Subject: Convince compilers to put constant data into the .rodata section This patch reduces the stack usage by declaring 'const' stack variables as 'static const' so they end up in the .rodata section instead of being copied from there to the stack for every invocation of the corresponding function. As a plus we end up in having a smaller binary as the "copy from .rodata to stack" code isn't emitted by the compiler any more (roughly -100 bytes). Corresponding to flashrom svn r1252. Signed-off-by: Mathias Krause Acked-by: Stefan Reinauer --- flashrom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'flashrom.c') diff --git a/flashrom.c b/flashrom.c index f3497d0..938579c 100644 --- a/flashrom.c +++ b/flashrom.c @@ -38,7 +38,7 @@ #include "flashchips.h" #include "programmer.h" -const char * const flashrom_version = FLASHROM_VERSION; +const char flashrom_version[] = FLASHROM_VERSION; char *chip_to_probe = NULL; int verbose = 0; -- cgit v1.1