mirror of
https://review.coreboot.org/flashrom.git
synced 2025-06-30 21:52:36 +02:00
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 <mathias.krause@secunet.com> Acked-by: Stefan Reinauer <stepan@coreboot.org>
This commit is contained in:
@ -114,8 +114,8 @@ int cli_classic(int argc, char *argv[])
|
||||
int operation_specified = 0;
|
||||
int i;
|
||||
|
||||
const char *optstring = "r:Rw:v:nVEfc:m:l:i:p:Lzh";
|
||||
static struct option long_options[] = {
|
||||
static const char optstring[] = "r:Rw:v:nVEfc:m:l:i:p:Lzh";
|
||||
static const struct option long_options[] = {
|
||||
{"read", 1, 0, 'r'},
|
||||
{"write", 1, 0, 'w'},
|
||||
{"erase", 0, 0, 'E'},
|
||||
|
Reference in New Issue
Block a user